diff --git a/userspace/aoc2023/CMakeLists.txt b/userspace/aoc2023/CMakeLists.txt index f18fb059..f302eb00 100644 --- a/userspace/aoc2023/CMakeLists.txt +++ b/userspace/aoc2023/CMakeLists.txt @@ -14,6 +14,7 @@ set(AOC2023_PROJECTS day9 day10 day11 + day12 ) set(BANAN_AOC2023_BIN ${BANAN_BIN}/aoc2023) diff --git a/userspace/aoc2023/day12/CMakeLists.txt b/userspace/aoc2023/day12/CMakeLists.txt new file mode 100644 index 00000000..2b3b1705 --- /dev/null +++ b/userspace/aoc2023/day12/CMakeLists.txt @@ -0,0 +1,22 @@ +cmake_minimum_required(VERSION 3.26) + +project(aoc2023_day12 CXX) + +set(SOURCES + main.cpp +) + +add_executable(aoc2023_day12 ${SOURCES}) +target_compile_options(aoc2023_day12 PUBLIC -O2 -g) +target_link_libraries(aoc2023_day12 PUBLIC libc ban) + +add_dependencies(aoc2023_day12 libc-install ban-install) + +add_custom_target(aoc2023_day12-install + COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/aoc2023_day12 ${BANAN_AOC2023_BIN}/day12 + DEPENDS aoc2023_day12 + DEPENDS aoc2023_always +) + +add_dependencies(aoc2023 aoc2023_day12) +add_dependencies(aoc2023-install aoc2023_day12-install) diff --git a/userspace/aoc2023/day12/main.cpp b/userspace/aoc2023/day12/main.cpp new file mode 100644 index 00000000..3632f905 --- /dev/null +++ b/userspace/aoc2023/day12/main.cpp @@ -0,0 +1,166 @@ +#include +#include +#include +#include + +#include +#include +#include + +using i8 = int8_t; +using i16 = int16_t; +using i32 = int32_t; +using i64 = int64_t; + +using u8 = uint8_t; +using u16 = uint16_t; +using u32 = uint32_t; +using u64 = uint64_t; + +u64 parse_u64(BAN::StringView str) +{ + u64 result = 0; + for (char c : str) + if (isdigit(c)) + result = (result * 10) + (c - '0'); + return result; +} + +static BAN::HashMap s_cache; + +BAN::String build_cache_key(BAN::StringView record, BAN::Span groups) +{ + BAN::String cache_key; + MUST(cache_key.append(record)); + for (u64 group : groups) + MUST(cache_key.append(BAN::String::formatted(" {}", group))); + return cache_key; +} + +i64 count_possibilities(BAN::StringView record, BAN::Span groups) +{ + if (groups.empty()) + return !record.contains('#'); + if (record.empty()) + return 0; + + auto cache_key = build_cache_key(record, groups); + if (s_cache.contains(cache_key)) + return s_cache[cache_key]; + + i64 result = 0; + + for (size_t i = 0; i + groups[0] <= record.size(); i++) + { + bool valid = true; + + if (record.substring(i, groups[0]).contains('.')) + valid = false; + + if (i + groups[0] < record.size() && record[i + groups[0]] == '#') + valid = false; + + if (valid) + { + auto next_record = record.substring(i + groups[0]); + if (!next_record.empty()) + next_record = next_record.substring(1); + result += count_possibilities(next_record, groups.slice(1)); + } + + if (record[i] == '#') + break; + } + + //printf("inserting... "); fflush(stdout); + MUST(s_cache.insert(cache_key, result)); + //printf("done\n"); + + return result; +} + +i64 puzzle1(FILE* fp) +{ + i64 result = 0; + + char buffer[128]; + while (fgets(buffer, sizeof(buffer), fp)) + { + BAN::StringView line(buffer); + if (line.back() == '\n') + line = line.substring(0, line.size() - 1); + if (line.size() < 3) + continue; + + auto parts = MUST(line.split(' ')); + + auto record = parts[0]; + + auto continuous_strs = MUST(parts[1].split(',')); + BAN::Vector continuous(continuous_strs.size()); + for (size_t i = 0; i < continuous.size(); i++) + continuous[i] = parse_u64(continuous_strs[i]); + + result += count_possibilities(record, continuous.span()); + } + + return result; +} + +i64 puzzle2(FILE* fp) +{ + i64 result = 0; + + char buffer[128]; + while (fgets(buffer, sizeof(buffer), fp)) + { + BAN::StringView line(buffer); + if (line.back() == '\n') + line = line.substring(0, line.size() - 1); + if (line.size() < 3) + continue; + + auto parts = MUST(line.split(' ')); + + BAN::String record; + MUST(record.reserve(parts[0].size() + 4)); + for (size_t i = 0; i < 5; i++) + { + if (i > 0) + MUST(record.push_back('?')); + MUST(record.append(parts[0])); + } + + auto continuous_strs = MUST(parts[1].split(',')); + BAN::Vector continuous(5 * continuous_strs.size()); + for (size_t i = 0; i < continuous.size(); i++) + continuous[i] = parse_u64(continuous_strs[i % continuous_strs.size()]); + + result += count_possibilities(record, continuous.span()); + } + + return result; +} + +int main(int argc, char** argv) +{ + const char* file_path = "/usr/share/aoc2023/day12_input.txt"; + + if (argc >= 2) + file_path = argv[1]; + + FILE* fp = fopen(file_path, "r"); + if (fp == nullptr) + { + perror("fopen"); + return 1; + } + + printf("puzzle1: %" PRId64 "\n", puzzle1(fp)); + + fseek(fp, 0, SEEK_SET); + + printf("puzzle2: %" PRId64 "\n", puzzle2(fp)); + + fclose(fp); +} diff --git a/userspace/aoc2023/input/day12_input.txt b/userspace/aoc2023/input/day12_input.txt new file mode 100644 index 00000000..d05e1147 --- /dev/null +++ b/userspace/aoc2023/input/day12_input.txt @@ -0,0 +1,1000 @@ +??.?#??#?#??##???? 2,4,6,1 +?????#?..?#? 2,2,2 +???#???#.?#?????.# 5,1,1,1,2,1 +???#???#.#??#??##?? 1,1,1,1,9 +????###??.????#.# 5,1,2,1 +.?##?##?.?????#?#?. 6,6 +?????#???#??#???? 3,8 +???#????.?? 3,1,1 +?#?#???????#?#?.. 5,4 +??????##????.#?? 1,9,1,1 +#??????..???#?????? 2,4,1,3,1 +.#.???.#?#?#??##??. 1,1,5,4 +??????#.?????#?#???. 5,1,1,6,1 +#?????###??#?. 1,7,2 +.???????#. 1,6 +??#?#..?... 4,1 +?##?#?????##??#?# 5,2,5,1 +???#.?.?#???? 1,1,1,6 +#????.??.?. 4,1 +??##??#???? 4,1,1 +?#???#??????????? 1,9,1 +??????..??????#?#?# 1,2,1,1,6,1 +?.?.#?#?#??????#??. 1,1,5,3,1,1 +#???.????.??? 3,2,2 +.????????#??##??#??? 1,13,1 +????#??????. 1,2,3 +..?##.????#? 3,1,1 +??##??##?#???? 1,11 +???????????#???????? 6,5,1,1 +?####?#??#?.. 7,1 +.??#?#??##??????.##? 11,3 +???????????? 2,2,1,1 +??????.?.?????? 4,3 +?#.??#??.?#??? 1,2,1,1 +???????..??? 2,1,1 +???.#?.?????. 1,1,4 +?#??.?..?#???... 2,5 +.#?.#?#.?????..##??? 1,1,1,1,1,5 +???.?.?..?.???#. 3,1,1,2 +??????????.?..#??? 2,2 +?#???##????#?.?????# 1,1,2,4,2,1 +.?#????#?????#??. 2,1,3,5 +?.##.?#?##?#.??? 2,6,2 +?.???????.?.###??#?? 3,2,1,8 +???#?????.??.??.#? 5,1,2,1,1 +#?..???????#?#. 1,3,3,1 +???#???...? 4,1 +?.??#..??..???. 2,2 +...????????#.? 4,4 +????.????? 3,1 +.???.??#?#?? 3,1,1,3 +.??.#???.?#?????###? 1,4,3,5 +?#?.?????????.??##.? 1,2,4,2 +???.???#..??.?? 2,1,1,1,1 +???#????##?????.#? 6,2,3,1 +?????..????##??? 3,1,7 +???????.#.?????.?.?? 1,4,1,3,2 +?#??????.???#?#????? 1,5,10 +.??????????#?? 1,1,2,3 +?#??..???#.??##.?# 1,1,1,1,4,1 +???#?????.???#? 2,1,1,1,1 +?.##?#???.???#?#?## 6,1,7 +.??#??#?##?????? 3,4,1,1 +..??.?.??? 2,1 +??????#?#??#??.???# 1,1,7,1,2,1 +???.?..#???#?.###?? 2,5,5 +???#.#..?######.??? 1,1,1,7,1,1 +??#?#..#?.?.??## 5,2,1,4 +??#.#.?????#???#? 1,1,1,1,8 +?????#?????.. 2,1 +..?????????? 1,3,1 +?.????????#.??####? 1,1,2,1,1,5 +#???#?????.???#? 1,2,3,2 +??.?#???????. 4,1 +#?.#?#????. 1,1,5 +??????#????##??? 1,9 +.??.???????? 2,1,2 +???.#???#?????#?? 1,1,7,2 +???.##??.???#???? 1,4,4,1 +???...?.??##?##..??. 7,1 +?????#.?????##?##?? 1,1,9 +.??.?.????. 1,2,1 +??.#??????###???. 10,1 +?#???#????????? 2,2,1,1,1 +???.?????????#. 3,4 +?..????##?????..? 1,8,1,1 +?#???????# 1,1,1 +??#????#?.?#?.#??.? 9,1,2 +?#..?.??#.#.?#????? 1,1,2,1,1,4 +?.?#.?..??# 1,1,1 +??.#??.#.???#????? 1,2,1,1,3,1 +??#.??#??##??.??#?. 3,3,5,1 +.?.?????#???????# 1,8,1,2 +?#?##?#?????##???..? 9,5 +#..?..#?????#???. 1,10 +??#?#??.#?????# 2,2,7 +???????#??????.?#. 1,1,2,5,1 +??.#???#??##???.# 1,6,4,1 +?????????.?.#???#?.. 4,5 +?????####.. 1,5 +?#???#??#.#???.? 6,1,1,1 +????.?.??.???. 2,1 +?????.?#?.?#??###?? 1,1,1,3,8 +??????##????#??????# 6,1,1,1,3 +???.???#?.?? 1,3,1 +?#??????.?#??#?#? 6,7 +????????#?#?????? 1,2,1,3,3 +.???.?????..# 2,1,1,1 +#????????.?.? 6,1 +#??###???????# 1,3,1,1 +#???.?#?#?? 2,5 +.???????????????# 1,3,1,4,1 +????#???..#.#???.. 1,1,1,1,2,1 +.?????.?#???# 2,1,4,1 +???##??.???? 4,2 +????????#?#?.??#?#. 1,3,3,5 +?????#??#?????.?#? 11,2 +???.?#?#???#? 1,9 +?#???##?.?.??##??.?. 7,6 +#?#.????#??#. 3,1,5 +##???..????#??.? 4,6 +?.?#?#?.??? 1,5,1 +?#????.?#??.? 1,1,4,1 +?#????#?#??#.??? 8,2,1,1 +??????#????# 5,1 +???????#??????????. 2,2,4 +.#.?.??.??#? 1,1,1,1 +?.#??.?#????#?#? 1,2,9 +?.??..?.???##?.???. 2,1,3,2 +?#??.?.?????? 2,1,1,1 +.?#?.#.??? 1,1,1 +?#???##????.?. 7,1,1 +?.??????.#? 3,2 +??##?.??##??.? 2,6 +???##?..??? 4,1 +?#?#??????.? 1,1,4,1 +?#?.#?#????#.?#???## 1,1,3,1,7 +???#??????#?#?##? 1,2,1,4,4 +.??????.????? 1,1,2,2 +??#??????###???..?#? 13,1 +???#??.??????????.# 5,4,1,1,1 +.?##?????????????# 3,1,2,2,2 +????????## 2,2 +??????.???? 1,1,3 +?#.#?#??#.?#?? 1,6,2 +??.?????.??..?#.#?? 1,1,2,1,1,1 +?##??####?????. 4,4,1 +.?#???????#??.??.? 4,3,1 +??.?.?????#? 1,5 +##???#?#??????.? 2,3,5,1 +?#??#???#?#??#? 2,3,4,1 +#????.##??.??????? 1,1,1,4,1,3 +???.????.??#??# 2,3,1,1 +?????????. 2,4 +#??.???#???# 2,5,1 +##?.#???.#..?.????#? 3,1,1,1,1,4 +??#.?????#????#??? 2,1,4,3 +?#?????????.???? 11,1,1 +??##?????.???#??### 9,1,6 +?.?###?#?.???# 7,4 +?.#?##?#.##?#? 6,5 +.#????#?.?? 1,3,1 +????.#??#. 2,1,2 +??#????????##??.? 6,6 +??#.#??#?.?##..?#? 1,1,5,3,2 +?.?.?#?????.?? 1,7,1 +??#??#?#??#??#? 1,7,1,2 +??.????.??###? 1,3,3 +.#???????###????. 5,5,1 +?.???????????#?? 1,1,1,1,3 +.#????#.?.##????? 1,3,2,1,1 +?#??????.????#?? 5,2,1,4 +...#?????????.?? 3,3,1 +..????#???? 2,3,1 +?#????..??#.#? 1,1,3,1 +??#?????##????#.???? 12,1,1,1 +???#??..?#? 4,1 +?????.?#????# 1,1,3,1 +???#????.##?##??? 2,3,1,5,1 +??#??.????? 4,1,1 +?.???###??????.#?# 1,11,1,1 +?#?#?????????#?#. 8,1,3 +#.?.?#???????#?##?.. 1,6,6 +???.????#???#? 1,1,3,2 +?????????? 1,1,2 +.??.??.????. 1,1,1 +?###??#?###??? 10,2 +???#?..??.. 4,2 +#?##.##.??#??#?.???? 4,2,1,1,2,3 +.??.?.????#????. 1,6 +???#?#???. 4,4 +??#?#???.???.???##?? 8,3,4,1 +?#????##?.?.? 3,4,1,1 +#?.?????#???#.?????? 1,1,1,2,2,5 +#?.???#??#???? 2,2,2,1 +???????.?.#?##??? 5,1,4 +?????.?#.???# 2,2,3 +#.?.#???????#??#.. 1,4,6 +??#?#??#?#??.??????? 1,4,1,1,1,2 +?.???#?.##?. 1,4,2 +????????##???.?.??? 1,2,7,1 +#.?.?#?#.?.?????#?#? 1,1,3,1,1,4 +???..##??#????? 5,1 +???..#?.?.? 2,2 +?.??#?#?#??#??..? 3,8 +.#????##???#????. 2,7,1 +??###??#????? 3,3 +#??????##.?#?? 9,2 +?#?.?????? 1,1,1 +?.?????#?#???#?# 8,3 +?.??????#?#?#???? 1,1,3,1,6 +?#.???#?..?. 1,3,1 +#????#??#?. 1,2,2 +?.#???#?#?? 1,5,2 +?????#.???#???? 4,1,1,1 +?#.??.????? 2,1,2 +.#??.?????#??? 3,1,5 +????..????#.?..??? 1,1,1,1,1,3 +?##??????#? 3,5 +??????...?# 1,2,2 +.??????.?#.? 2,1,1 +??????#???????#? 2,2,6 +.??#????#???????.#? 1,2,6,1,1 +???.???.??????#? 3,4 +???#?.#????#?. 4,7 +????##?#?.##?.? 1,5,2 +??#??#.?#..#??.# 1,4,1,2,1 +?????.?#?????#???.?? 2,8,1,1 +?.???.#???.. 1,1,1,1 +???#??#?##????#. 13,1 +.?#?.?#?#?#????? 2,4,5 +????##???#????? 1,8,1 +?#?#??#?????????.?? 2,7,1,1,1,1 +??????#?#?? 8,1 +?.???##.#?#????#?. 1,4,9 +??.?????????????..? 8,1 +?#?###?..#?.?##??.? 6,2,5 +????.??#??????????? 3,3,9 +####.?.??.????? 4,1,1,2 +.??#...?.??#? 2,3 +?#??????#?# 1,7 +?.???#.#?# 1,1,3 +????.#??..???# 1,3,1,1 +?#??#??????? 5,1 +???.??.???#???????.# 1,1,9,1 +??#???.?#?.????#?? 4,2,1,1 +????.?#.?????#?#. 4,1,2,5 +.?????#?##??????? 10,2 +??#???.?.??? 4,1,1 +.?????#??????###?#?? 3,12 +??#?#????#?.??? 10,1 +???????????? 4,1,1 +???##????#?.???. 8,2,2 +????##?##. 1,1,5 +????#?#?#?#.?#.?? 1,1,7,1,1 +?#??#?..???? 5,1 +.???..???? 3,1 +..???.????.##?? 3,2 +??##?.#??????????# 1,2,2,2,1,2 +..??.??.?##??.? 2,4 +?#????#.?.#?? 7,2 +??##?.???#? 2,3 +?????.#??#??..? 1,2,6 +.?????.?.# 3,1 +??.?????#.???#? 2,1,1,1,3 +#?.?.????#????.????. 2,1,7,3 +??.##?#..??#??#?? 1,2,1,8 +???#?.?????? 1,1,1,1 +????????#?.??#. 1,5,1,1 +.???##??#???#?#? 5,3,3 +??#???#..???#?#?? 2,1,1,7 +?#?????#???? 7,1 +?????#???? 3,1,1 +.????.??????#?##? 4,1,6 +??.?.????? 1,3 +?#?.??????? 3,1,1 +?.?.??.?.?###? 1,1,1,5 +?#??##????.?? 8,2 +..?#???#?????? 6,2 +????.????.? 2,2,1 +???.???.??? 2,3 +?#?#??#.##?#?. 6,2,1 +.??#?????#??#?..#? 13,1 +#?#??.?????#??.? 4,5 +#?#?????????##?? 1,1,3,5 +??#??.#?#?? 2,1,1 +?###.#.??.???#.??? 3,1,2,1,1,1 +?.?.?#?#???#????.??? 1,1,1,6,1,1 +??.#????##???#.? 7,2 +????.??????# 1,1,1,1 +?????#??.?# 2,3,1 +?????.???#? 1,4 +?#.????#.?.#? 2,1,2,1 +?.?????#??#?.. 3,2,2 +#?.?????#?? 2,2,4 +.????.?.#???.??? 3,1,3,1 +??.????.?#???##??? 2,2,7 +.?.????#??????#?? 1,1,5,1,3 +??.???##?#? 1,7 +#..??????.? 1,4,1 +????#??#.???#??? 6,2,1 +??#?.????..??..??? 3,1,2,1,1,1 +#??#????#??#??? 1,10,1 +??????#????????? 1,8,2 +?##.??#?.? 2,2 +?.#?????.?.##?#? 1,1,3,1,4 +?#..?##????..?? 1,7,2 +?.??#?#??.??????# 1,7,1,1,2 +##???##?#??### 9,3 +?#.?#?????????.?#? 1,1,2,1,1,2 +.?#?.???.???? 2,3,1 +.????.??#?? 1,3 +??..#.??##????## 1,1,10 +##.???.?#?#..??. 2,1,2,1,1 +??##???##??? 5,2,1 +???#????#?.? 5,2 +???????.???.? 2,1,1,1 +??????#?????. 2,8 +?#???.?.??.?#??## 2,1,1,6 +?#.????##????? 1,1,8 +.??#???#?????????? 8,4 +???.?#???.??????? 1,4,2 +.?.??#?#???#?? 1,3,5,1 +??#??.?#?????#### 3,1,6 +????????#.? 1,1,1 +?.?##????.?. 3,1 +?.?#?????.. 3,3 +.?#?#?#???#.. 6,1 +.??????#???????#?.? 3,5,1,1,1 +?.?.??#????#?. 1,7 +???????#????#???. 6,2 +.??????#????????# 1,1,1,4,1 +???.?..???????#???. 1,2,7 +#??????#?#.? 2,2,3,1 +?????????#??????#?. 2,1,1,1,5 +??????#.??#? 5,1,1,1 +#?.##????? 1,3,1 +..#??????#?? 1,2,2 +#?#???##??.? 3,4 +???#??????# 3,4,1 +??.#????#?#??#???. 1,1,8,1 +.????????##? 1,7 +#??..????#??? 2,2,1,2 +?.#??#???#????#.??? 13,2 +?????..#???????? 3,3,2,2 +?#????.??# 3,1,3 +?#????##??#??.??#?? 3,6,1,2 +????###.??????? 6,1 +???#??#?#?#?####.. 1,14 +???.??.#?? 2,1,2 +.##???..?#? 2,2 +...???#???????? 9,1 +?#????#???.?#??#? 1,6,1,3 +???#???????#????? 4,1,9 +??????.#?? 1,2,2 +#????????#?.#???? 1,5,3,1,2 +???#?#??##?.??? 5,3,1 +??.??##???? 1,4 +???????.?????.### 5,1,1,3 +???..????? 3,1,2 +?###?#???#??????#??? 5,2,4 +.???#??.????##?? 6,3 +?#?.?????#? 1,2,3 +???????.??####?????? 4,1,1,8,1 +????.????? 1,1,1 +???.#???####?#.? 1,1,1,6 +??????##??????.?? 12,1 +??#?#???#???. 6,2,1 +#?#..#?#???? 3,7 +???.??#?#?????#?#? 1,8,4 +?##.???.#??? 3,1,1,1 +????#?#?#?????#??#.. 11,1,1 +??????????#?# 1,8,1 +#??.?##??????#?.??? 1,10,1 +.#??.###???#? 3,4,1 +.??.????## 1,2,3 +?????#????.??????##? 3,2,1,1,2,2 +??##?????..?#??? 6,2,2,1 +??????#???? 1,5 +???#????????#?? 4,5 +??#??.???? 2,1,1 +?????..???#?# 1,5 +#?.?##?#??#??.???. 1,10,1,1 +?????.??..???# 2,1,1,2 +.?????#???? 2,3 +.????.????? 1,2 +.???#.??#??#..#?? 1,1,5,1 +.#?.??#????? 2,1,1,4 +?.???.?.#?. 2,2 +..??????#????? 1,2,3,1 +.?..?#??#? 1,3,1 +??.#######???? 1,8 +?#??.#??#?.??? 2,4,1 +.#??.?#?.?? 1,2 +#??.???..???#??? 3,2,5 +?.?????..???#####. 3,8 +??#??#?.#? 4,1 +##?.?#????# 3,1,3 +????????.??# 2,1 +?#??#??#???????#??? 9,4 +????##????#?.? 5,3 +#??##??????..? 6,2,1 +?.??#..??.#??? 3,2 +????????#?. 2,3 +?????.?#???.?? 2,1,4,1 +???????????#?? 1,1,1,6 +?.?????????? 2,5 +.#?.?#.??#?????# 1,2,3,3 +??#.#????????? 1,5,1 +?..#?.?#?# 2,3 +??#??.?.????. 3,2 +.??.?.##?????#?#. 1,10 +???#???????? 1,1,1,3 +??.??????.?.???.? 1,5,1,2,1 +.??#?.?#.???? 2,2,1,1 +..?????????? 2,1 +.?#??????.?##???..? 6,5 +?.???.#????# 1,2,1,1 +???????.???.??? 2,1 +????????#? 1,1,2 +?#?.#????? 2,5 +.???#??#?????????? 6,2 +.????????##?#? 2,10 +?#.?#????? 1,4 +##.#?.#???????????? 2,2,7,1 +??#????.??.??? 7,1,1 +.?##????.??. 3,1,2 +?.?###.???#????????. 4,10 +?#?#???#?? 3,2 +??..?#?#???? 1,3,1 +??????..??.. 6,2 +.?#???..#??. 4,2 +??#?##????##????##?? 4,9 +??#??.????#???? 4,1,1,1 +.???.???#?# 1,6 +#?.??#??.???? 1,1,2,1 +??..??#??#??????# 1,1,1,3,2 +?.??.??#.???? 1,1,1,2 +???.???.?#??????.# 1,3,3,1,1 +#??#??????. 4,1 +?#.???.??#?.#??.?? 2,2,1,2,1,1 +??.???#?????#??? 1,4,1,3 +????.#??#??#???## 1,1,1,5,4 +?#?.#??#?..#??##? 2,1,1,5 +?##?.??????#.?. 3,4,1,1 +.??.???#??.??.#?#? 1,4,2,3 +???.?#????##????.#? 1,1,2,9,1 +?????????#?#? 3,1,1,1 +??#?????.#? 1,2,1 +.???????????? 1,1,1,3 +??????????.???.??.?? 1,1 +#????#.????? 1,4,1 +??????.?.?..#?????? 3,1,1,1,1,3 +??.?????#?###??? 1,1,1,7 +#.#??#????.??. 1,4,2 +????.?.?#?. 3,1,2 +??????#?.????? 8,1 +?###??#??##?..#?..#? 12,2,2 +?#??????.??.???##.?? 6,1,1,3,2 +.?????????#?????# 2,9,2 +??#??#?.???.? 6,1 +?.?.??#????#?????. 1,1,3,2,1,1 +??.?.?...? 1,1 +?.?????.???.?#?#? 1,3 +?.#?#??.?.?#?#?#.. 5,5 +???#?#?#?????#? 9,4 +?#????##?##???. 2,7 +????#??.?????# 7,3,1 +..?.???????? 1,1,3 +?#???#??.??.#??. 7,1,3 +?#???#???#??.?#? 1,2,4,1 +..???.?#???#??#????# 1,1,9,1 +??##?????# 3,1 +?#???#???#..???##??. 9,4 +?##?#..#?.??# 4,1,2 +#??.#????????#? 3,3,1,1,2 +?#???###..#?#.?.#?#? 3,3,1,1,4 +???#?.????#???.? 1,8 +.?????##?????.#? 1,2,1,1,2 +????#..?.#?#?..?# 5,1,4,1 +??????..???#??.???? 1,1,1,1,3,2 +?###???##????.?? 13,1 +.?#????????.?.#. 4,4,1 +??##?##????.#??.? 1,9,3 +..???#??????????#?. 1,1,10 +.###.?#..????? 3,1,2,1 +?#?.??????##??#? 2,11 +.?#????.?? 2,2,1 +??#?#####????#.???? 1,1,8,1,1,1 +.???..??????#?.? 2,5 +??#?????##???.??. 1,1,7,1 +???.?..##.?.?#?.?? 3,1,2,1,1,1 +..#????.#??.#?## 2,1,1,4 +?#?##??????????? 6,6 +?.#??.#.?... 2,1 +.??#??.??#??# 2,1,2,1 +??.??#?#?.???.#???? 1,5,1,1,2 +?#?.??.?#??????????. 2,1,11 +?????##???? 1,6 +.??.?##???.???.?. 1,4,1,3,1 +?#.??????####???.? 1,4,8 +???#????#?????.? 8,1 +?.???????? 1,1,1 +???#??#?#??#?#.?? 1,2,4,3,2 +#.?????#??##.?.? 1,1,6,1 +?#?.?##..???# 2,2,3 +#??#???#?.?.??? 4,1,1,1 +#?#???.????#?##?? 1,1,1,9 +.???#?#?.?..?# 4,1 +.????##?#?#??? 1,9 +#??.?####?.?.??.?? 3,5,2,1 +???#?????..?##?##?? 6,5 +..?.#????#?#.?? 2,2,1 +?????.??.?#.# 1,2,1,1 +.?#??#??#.?.?? 2,5,1 +???????#?????##??.? 8,6 +?#??????.#?##?? 4,1,5 +?.?????.?? 4,1 +?#?#???.??. 5,1 +?.????.??? 4,1 +?#???#??#.??..?# 2,3,1,1,2 +??????####?.? 1,6 +.?#?.?#??#???? 2,5 +??.??#???????#??? 1,13 +?#??##??.??#?????. 6,6 +?????#??#????? 5,4 +#???#?#?#???#?..???? 7,1,3,2 +?#??#??#?#????????? 11,2 +#?????.???? 2,3,2 +.#??.????##.?. 3,1,2,1 +????????#?????##? 3,4,1,3 +??##?#?#.?????? 7,1 +.#???#???#???#?# 7,1,1,1,1 +??.?.?.?.??#??.? 1,1,5 +??????#??#??##? 1,1,9 +...#.??#???#??. 1,3,3 +????#?????. 7,2 +????#???????.#?#..# 1,1,8,1,1,1 +?#?#??.?#?? 2,3,1 +??#?.?#.???????.?? 3,1,1,1,1,1 +.?#?#?.??##? 5,3 +?##??#?.#? 2,1,2 +#???#????##.???. 3,7,2 +.??##??#????????. 8,1 +??#????#?..#?#????. 5,2,1,4 +???#????..????. 5,2 +??.???.??.#?.? 1,1 +?#??.????? 1,1,1 +???#?????.?..#. 4,3,1,1 +??#?#???##?????????# 7,2,3,1,2 +???##???#.??? 1,3,2,3 +#.???????# 1,3,2 +..#???.#????? 2,4 +?#?.??.?.??#.? 2,1,1,2 +??.?.???#???# 1,1,6 +#??????????#??.?.? 1,2,5,2,1,1 +.??????????#???#? 8,6 +??????????#?#???? 1,10 +???#???..??.?.?? 4,1 +.???#???#???#?? 1,1,2,1,1 +???.?.#???#???. 1,1,6 +..??#??????.. 3,4 +#??.?#.????##??#? 2,2,1,2,3 +???#?.?.?.?.??? 2,1,1,1,1 +??????#?????.? 1,5,1 +?##.??..?#??#???## 3,1,5,3 +???#?#?????????#?? 10,2,1 +.??##?#??#??#?????? 1,2,2,4,1 +.???????#?. 5,1 +#?#?#??.???#???#.## 1,1,2,8,2 +???##???.??????????? 7,3,4 +?#?????.???????## 2,1,3,4 +???#..?????. 1,1,1,1 +.???#??.?#?# 1,3,4 +.?###???????.??? 9,1,1 +???????##??.?? 10,1 +.??.????#??.?? 1,2,2,1 +?????##?#??? 2,5 +?.???????.?# 1,2,1,1 +?..?????#? 1,7 +??...?..?????.?? 1,3 +.???????.#?.??? 6,2 +?????.??#???.?#? 1,1,4,1 +??#.?.?#??#? 1,1,6 +.??..##..???#?#? 2,2,6 +?.??#????? 1,1,2 +???##???#??#?#??? 1,2,1,7,1 +#??.???????#? 2,5,1 +#????#??#..?.? 3,1,1,1 +???#??#??..?????#??? 1,6,1,4,1 +?.??#..????#????. 1,3 +???#??.#.?##?#??#??? 1,1,1,1,8,1 +????##???????#? 3,4,3 +#.?????#????.? 1,8 +?.#???????.?? 3,2 +?#??????#? 3,4 +#???#??.??#???.??#? 1,1,1,1,5,1 +????##??#?.???#?.. 4,2,1,2 +?.???#???????#???? 7,5 +.??#????????#.?. 1,1,1,1,3 +?????????..?####??? 6,6 +???.?????? 2,3 +?.?#???.?..?.???#.#? 1,4,1,3,1 +??.??#.?.?#??? 1,1,5 +?#.?#?.#????.?# 1,3,1,1,1 +.?#?????.??? 3,1,1 +??#?.?.?..#?? 3,1,2 +??#??#?####.????. 1,1,7,1,2 +#?????#?#? 1,1,3 +?##.??????#.. 2,7 +..??????.??##?#?# 1,1,1,7 +.?.?????#? 1,2,1 +??????##???.?..????. 5,2 +???????#?... 1,2 +???#????????. 1,3,2 +.?#???###??#???? 8,3 +???#.??#??????? 2,8 +???#???.??.??###?? 1,1,1,1,7 +#??.?????.###? 1,1,2,3 +#.?#????#???#?.?#??? 1,2,4,2,4 +?.?#???.##?? 2,2 +???#??..?#.???? 2,2 +???????????##?????? 5,10 +.?????#.????##? 4,6 +????????????? 8,1 +?..???#?.#??.#? 1,1,2,2 +??.???#?#??# 1,1,1,2 +?#?##?????????##? 4,2,4 +?#?????????????? 9,2 +?#.###????#???? 2,3,3,1 +.????????.?#??#?? 2,1,1,2,3 +???##???.??#??.???? 7,2,3 +??#????#???.?????? 2,3,3 +#?.????##? 2,1,3 +?#??????#??####?. 1,2,1,5 +.?...??.?#???.???. 1,2 +.???.#???.#?#???.?? 1,1,1,5,2 +?????#??### 1,7 +????#?..????##??.?? 5,6 +???????.##??..# 1,1,1,4,1 +???.?##?..??.?#??? 3,4 +??#???????#????#? 3,1,7 +??..???..##. 2,2,2 +???.?#??#???? 2,5 +??#.?#??#?? 1,1,3 +????#.#?#???????# 1,1,7,1,1 +???##?##???.?#????#? 8,3,2 +??????#??...??????#? 3,4,7 +?#?##??.????????.. 4,1 +???#?#?####?. 2,1,5 +???#?#.##????..?? 3,1,3,1,1 +??#???#?##????.???? 3,7,2,3 +??.???.???.#.? 1,1,1,1 +.#????.??#?#?????? 5,5,2 +.?#??.???.??? 4,1,1 +??????#??????###? 3,6,4 +.#?.???#?? 2,1 +?????#?????.?.???? 7,1,1,2 +??#?##???.? 8,1 +???###???#??.??????? 9,1 +..?##..#???#?#?#?#?? 2,7,3 +???#?????.#????? 4,5 +?.?#????#?????#??#? 2,11 +.#?#??.?##?...?? 1,1,4,2 +????.??.?.??# 1,1,1,2 +##???.#?#. 4,3 +?????##?##?#????#. 1,6,1,3 +??????.#??# 1,1,4 +#???.??.#? 1,1,1 +##??????..??? 4,1,1,2 +??#?????????#?#? 2,4,6 +?.??????#??#? 1,1,1,2 +???.#??#???????.?? 2,1,1,1,4,1 +???.?????. 1,1,1 +???###???????#?#???? 6,8 +???????.?????#?#? 5,1,1,4 +?###??#...###???#?#? 4,1,7,1 +#.?.?#?.?.?????# 1,1,2,4,1 +??.??.????#??#?#? 1,1,1,5,1 +?#.??????? 2,1,1 +??????#?#???.????? 2,4,2 +.???#?????.??.#?# 9,3 +?.?..?????? 1,2,1 +??????.?.?.#?????? 6,1,7 +#??????##???. 1,9 +?#????????.?.?.#? 5,1,1 +?#??#???#?????? 1,3,5 +.?????##????.??## 2,7,4 +##?.??.??? 2,2,1 +?.?#????##??. 1,3 +.????.?#?? 1,2 +.?##??.#????#?? 2,7 +?.?.?#????##?##. 1,2,5,2 +?????.???.#? 1,1,1 +?##???.?.? 5,1,1 +?#?#?..?.?##?? 5,1,4 +.?#..??#????#?? 1,8 +??.#??#????? 1,4,1,2 +?#.????????. 2,1,2 +#?????.?????##???# 6,1,4,1 +????...????? 2,3 +???#??.??????? 1,3,2,1 +##???????#??? 2,8 +?#?#???????#????#?.? 1,6,8,1 +.??.?.??#??.? 1,1,4,1 +??????#?..??. 6,1 +.???#?????????? 1,3,1,3,2 +??.?#?.???..?#? 2,1,1,1,2 +#?#??????###?#???? 14,1 +????.????? 2,1,1 +##.?????#??#?. 2,2,1,2 +.??#?.?#?#.? 2,4 +??????#?#?? 2,5 +??.???#???????.???? 1,4,2,1,1,1 +?#.??#?.#???#???? 1,3,1,1,2 +?#???..??? 1,1,1 +?.??.????.. 2,1 +#?.????#.??.???????# 2,1,1,1,1,4 +#?##????##?????? 1,4,2,3,1 +#??##?????#??? 1,4,1,1 +.?????#????#?#?#?? 1,1,4,5,1 +????.??????. 1,3 +???.#??????????. 1,4,2,3 +??##?#?#??????????? 11,2,3 +??.??##??.? 1,4 +????????.#.?. 7,1 +???????????????.?#?? 1,1,4,3,2 +????.?????..???. 5,1 +?????#?#?.?##???. 3,5 +..??..????##.?.???. 6,2 +?????##?.#?????#?.?? 6,1,1,3,1 +????.????.# 2,2,1 +??#????????.?? 6,1,1,1 +???????..#????#??.#? 3,1,7,1 +??...##??? 2,3 +????##???#????.?? 2,7,1,2 +????##????.??#??#. 6,5 +???.?#??.?#?#?#?. 2,4,3,1 +.#.??.???? 1,1,1 +??.?#..?.??##?.???.? 1,3 +??#?.????. 2,1 +???#?#.###?#.?.??? 5,5,1,1 +#????????????? 4,1,3 +.#???????? 1,1,1 +??????#????#?#? 1,1,9 +????#?.#?? 3,1 +??#.#?..#.?#.??.?? 3,2,1,1,1,1 +?.?????#??????.?. 2,4,1 +.???..?.????#? 3,1,1,1 +.#?#??#??????????## 4,4,1,3 +.#?..?#?????.? 1,3,2 +???.??????#??..#.??. 7,1 +???.??????.?? 1,1,3,1 +??????#??#??#? 1,1,5,1 +?#???##??#?.?.??.?.? 3,6,1,1,1,1 +???#?#???.??#???. 5,2 +??##?#??????.. 6,2 +.??????????#? 1,5 +?#?#??#?## 6,2 +?#.?.#????#??#? 1,1,1,7 +??????#??? 1,1,1 +?.##???#??. 2,3 +??..#??#??## 1,2,1,2 +?#?..?????#??#? 3,9 +??#..#?#????????? 1,1,1,1,8 +#??#?????????####? 1,1,6,6 +#?#?#??.???????#??# 5,1,1,3,1,2 +.????##?.???#????#? 7,4,1,2 +?#??..??#. 1,1,1 +??????..#??. 3,2 +??#????.????#??.? 3,1,1,4,1 +??????????#???..? 1,4,1,1,1 +.#??.?#????#.?#? 1,2,4,1 +????###????? 5,2 +?????#?.?? 6,1 +.?.?##??.????? 1,4,1,2 +????#.????????? 4,1,2,2 +??.???#????##??????? 10,4 +?#?????#?.?? 1,1,1,1 +.?.?.?..??#???.? 1,1,1,4,1 +??????..#.#??? 2,1,2 +.??##??#?. 3,3 +?.?#???#?????#??# 1,2,3,5 +???##????#???.?#??#? 7,2,1,1,2 +##???..????. 3,1,4 +#?##?.????????.?? 4,7 +.??.#???.. 1,3 +??#???##????#????? 1,3,2,1,2 +#....??#?.#?# 1,3,3 +???.?????????? 2,2,3 +?#.#.?#.?#?? 1,1,1,2 +?.?#??##??????.? 6,2 +#???#??????.???? 5,1,3 +.???#?#???????#???#? 1,4,2,3,1,2 +.????..???..? 4,3,1 +?#????.???#??? 4,1,1,1 +.??????.?#.?? 2,1,2,1 +.???..??.# 1,1,1 +#??.?#?#??? 1,6 +???#??????????..?. 9,2,1 +.#????.??#?.?? 2,1,3 +.????#.???? 5,2 +?.#????#.????? 2,2,1,2 +#?????#?#?????? 1,8,1 +??????#?#?? 2,3,2 +??.???.?.???????? 1,3 +???.#???.?#???? 3,1,1,1,1 +.??.????#???.?. 1,7 +????.#??????? 1,2,4 +?????###??? 1,7 +???#???###.???.?? 8,2 +??#?????#???? 2,2,1,2 +#####????.????? 6,1,1 +??#??#???????#? 6,1,2 +?#?#???????#??? 5,3,1,1 +?.?#?#???#???..??? 1,1,7,1,1 +?#.#????????###?? 1,12 +?.???????.#? 1,3,2,2 +.?????.#??? 4,1 +#???..?????? 4,1,3 +?.#####????..?? 6,2 +?#?..?.#?.?????.? 2,1,2,4 +???.??.????. 1,1,1,1 +.?##????#? 4,2 +??????????.??? 2,1,2,1 +?????????#?#?## 2,3,1,4 +.?..???#??? 4,1 +??#?.?###? 2,3 +..#?..??#??##### 2,3,6 +??#???.????#? 4,1,3 +????#?#??.?#?.?### 7,1,3,3 +?#????#?#. 1,3,1 +??#???#?##?..#.??. 11,1,1 +????#??#?????#????.? 2,6,4,1 +.??#?.???????????.?. 1,1,5,3 +.??####?#?????#.? 10,1 +?#???????#????????? 10,5 +.#??????#. 1,4 +?.#???????. 4,1 +#??????#???.?#? 2,1,1,1,2 +???#?????? 4,1,1 +?#????#????????????? 2,6,1,1,1,1 +#????##???#???#??? 1,1,2,6,1 +.?.?#?#???.??#???? 1,4,1,1,2,1 +??????#?###????? 6,2 +?...?#??#???? 5,1 +?.?????.?? 1,1,1 +.??...?### 1,4 +??????.????#??##?? 1,1,1,3,4 +#?.?.??#.?#? 1,1,3,3 +????#.?????#?????# 1,1,11 +??.???.??..#?.# 1,1,2,2,1 +?#??.????###?##?.?.# 2,1,1,7,1,1 +???##???#?.? 5,3 +??#????????.?.?.?? 6,1,1,2 +#.?.?#.?.??? 1,1,1,2 +??.?#####?#??#?#??.? 15,1 +#.?.?..##?#?. 1,1,5 +?????#?##????.? 1,8,1 +??#??????#??.? 2,8 +?#?#??#???? 5,3 +????.?#???? 1,2,1 +.??#???#???# 2,6 +..?#????????.. 4,2 +??.?#??#?? 2,1 +?.?????##? 1,6 +.????#??#.?#.?? 7,1,1 +.#????????#??#???#?? 11,1,1,1 +??##??#??????? 5,2 +.?????#.#?#??#?#?? 1,1,1,6,1,1 +###??.#.#?#.#..?? 5,1,3,1,1 +???#?.??.?#??#? 1,3,1,1,2 +.?#.?#??#????.?.. 2,4,2 +.????#?##????????##? 15,2 +#.???#?#???.??????? 1,7,1,1,1,1 +??.?.?##??.?###.???. 2,4 +?.????.#?#? 2,3 +.????.??#?#? 2,5 +?.?.#????? 1,3 +.#?#??.??#?#???# 1,2,9 +????#???#? 5,1 +#????..?#????????#?? 1,1,11 +#..????.?#???.?? 1,2,2,2,1 +??.#.????.? 1,1 +?.##.###??.????#. 1,2,4,1,1 +##???????.???# 9,1,1 +?#??????.? 2,1 +????.?#?#???.#.?#?. 2,4,2,1,2 +???#?.??.?.??##?.?? 4,2,1,3,2 +????##??#?.??? 6,2 +?????#??????#??#? 2,2,9 +????????.??? 4,1,1 +?.?...?.#????#?????? 1,1,1,4,1,2 +??#?.??##?. 4,5 +.?#?#?????#?#????# 1,1,1,8 +??????#.???. 1,1,1,1 +.???????????#? 10,2 +??##?????.?#?? 6,3 +?..??????????.#????? 2,2,4 +.??#???.??? 1,3,2 +?.???????.?? 1,1,4 +???.?#.#?###???? 1,1,9 +?#?????.###??.? 4,5 +????#?###?????? 10,2 +#????#?#??????##?#? 1,16 +.?#?.??.?..?# 2,1,1,1 +???#??#??????#?????? 4,7 +?##??#????.???? 3,1,1,1,2 +???????..?? 1,2,1 +??.?##.?.??#??.?. 2,4 +?.?#?.????#??#?#???. 1,3,1,10 +???????????? 1,3 +?.?.#????#????? 1,1,6 +.?.??????.?# 1,2,2,1 +#??##????#????..? 2,7,2,1 +?#?#???????.?? 6,3,1 +.??##?##??????#?? 8,1,1,1,1 +???######.?.?? 8,1 +??#?.?????? 3,1,1 +.??##?.?????#?? 5,1,1,1 +?.???..????#??? 1,1,1,2,1 +.#???.?#??#.?#? 3,3,1,1 +?.?#?.??#??##?????.? 3,2,4,3 +#???????##?#?? 3,6 +.?#?#.?##.??. 4,3,2 +????????????#????.# 1,1,1,3,6,1 +??##????.???##? 4,1,6 +?#??.?#?##?.. 1,4 +???#??????#?#?.???? 2,2,1,5,2,1 +????#??#?#.#??????. 1,7,2,1,1 +.???#?.?##???#??#?? 5,3,4,1 +??##?.#..?#?????# 4,1,5,1 +???#???..? 4,2 +???????????##?##??#? 5,2,6,2 +???#???.????.. 6,2 +?.#.#???#?#?? 1,1,7 +.??.?#??..???#???.? 2,6 +#????????#??#??#? 1,14 +..??#????????#?? 6,3 +.???.?#..##???.?? 1,1,4 +??.??????.#?#?#..??? 1,5 +?#??#?#???? 1,5,2 +..??????.. 2,1 +?.#?.??#..???#? 2,1,1,1,1 +..??????????? 1,2,1 +???#?.????? 2,5 +??##?????#?.?????? 3,1,3,3,1 +#?.??.??#..? 2,1,1,1 +?#?????#????##???? 1,12 +?#??????.??????###?? 2,2,1,7,1 +???...#.?##.#? 2,1,2,1 +??????.???##???.? 2,3,7 +?.????###?????. 8,1 +?.???????.?????????? 1,1,2,8,1 +?????????? 1,1,2 +?#?#??##?#?#???.?#?. 5,6,2 +.?#..???#.?????. 2,2,1,1 +???????????.#??? 3,3,1 +?.??##.??????? 1,2,3,1 +.????#??#?#?##?????? 11,1 +.?#???#.?##?#?.?#?? 6,4,2 +?#?#?.#.#???..??? 4,1,4,1,1 +?##??#???###??#?. 6,6 +.#????.#?. 2,1,1 +?????##??##?. 2,7 +?.??????#?#? 1,1,5 +.???#????????#? 2,3,3 +.?#?????#?#??##.? 3,9,1 +.?..??##????????? 1,5,3,1 +??.??#?????? 2,5 +#?.??#?.#.?.??????# 1,4,1,1,7 +#????#????.????#? 1,1,3,4 +.?##????#.??? 3,2 +??.????###????.??#? 1,8,1,1,1 +?#??????????##.## 4,1,1,3,2 +?????#?#.#?.??.? 2,2,1,1,1 +.?.?#???.?#????#?#? 3,1,7,1 +?.?##????#???#..? 1,6,1,1,1 +#?#?.??#?#.. 3,1,1 +????#??.???? 2,2,1,1 +?.?????#?.??.? 1,2 +##????.??.?. 4,1 +.?#?????.? 1,1,1 +??.?????????.. 3,1 +.#??#?#??.?#? 6,1,3 +???#?????? 1,1,1 +?.?.??.??? 1,3 +?????#??#?#??..#? 9,1,1 +##??.???#??##?? 4,1,2,1 +?.#??????.?#???.?#. 4,3,2 +#??##??.???????????? 7,4,1,1 +?????..??..?. 1,1 +#??#.???.?.#? 4,1,1 +????#?#??.??#?.?#?? 6,3,2 +?#??#?.???????? 1,3,7 +????###???#??????# 11,1 +##??.??#?#???#???#? 4,1,9 +.??#???..#?#???#???? 1,1,2,1,1,4 +??.??..??#?????# 1,7,1 +#?.?.#????????# 2,2,3,1,1