diff --git a/epi_judge_cpp/CMakeLists.txt b/epi_judge_cpp/CMakeLists.txt index ac593c120..4abaa2d4c 100644 --- a/epi_judge_cpp/CMakeLists.txt +++ b/epi_judge_cpp/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.4) project(epi_judge_cpp) -set(CMAKE_CXX_STANDARD 14) +set(CMAKE_CXX_STANDARD 17) if (MSVC) add_definitions(-D_CRT_SECURE_NO_WARNINGS -wd4018 -wd4800 -wd4805) diff --git a/epi_judge_cpp/Makefile b/epi_judge_cpp/Makefile index c85218b99..f568912b5 100644 --- a/epi_judge_cpp/Makefile +++ b/epi_judge_cpp/Makefile @@ -7,7 +7,7 @@ TEST_DATA_DIR := ../test_data PROGRAM_ARGS := --test-data-dir $(TEST_DATA_DIR) CXX_COMPILER := g++ -CXX_FLAGS := -std=c++14 -pthread -Werror +CXX_FLAGS := -std=c++17 -pthread -Werror CXX_FLAGS_DEBUG := $(CXX_FLAGS) -g -O0 LAST_MODIFIED_CXX_FILE = $(shell ls -rt $(SRC_DIR)/*\.cc | tail -1) diff --git a/epi_judge_cpp/graph_clone.cc b/epi_judge_cpp/graph_clone.cc index 2181d23f2..04f9e6902 100644 --- a/epi_judge_cpp/graph_clone.cc +++ b/epi_judge_cpp/graph_clone.cc @@ -28,9 +28,8 @@ vector CopyLabels(const vector& edges) { return labels; } -void CheckAndDeallocateGraph(GraphVertex* node, - const vector& graph) { - if (node == &graph[0]) { +void CheckGraph(GraphVertex* node, const vector& graph) { + if (!node || node == &graph[0]) { throw TestFailure("Graph was not copied"); } @@ -41,14 +40,15 @@ void CheckAndDeallocateGraph(GraphVertex* node, while (!q.empty()) { auto vertex = q.front(); q.pop(); - if (vertex->label > graph.size()) { + if (vertex->label >= graph.size()) { throw TestFailure("Invalid vertex label"); } vector label1 = CopyLabels(vertex->edges), label2 = CopyLabels(graph[vertex->label].edges); - sort(begin(label1), end(label1)), sort(begin(label2), end(label2)); + sort(begin(label1), end(label1)); + sort(begin(label2), end(label2)); if (label1 != label2) { - throw TestFailure("Invalid vertex label"); + throw TestFailure("Edges mismatch"); } for (GraphVertex* e : vertex->edges) { if (!vertex_set.count(e)) { @@ -88,7 +88,7 @@ void CloneGraphTest(int k, const vector& edges) { graph[e.from].edges.push_back(&graph[e.to]); } GraphVertex* result = CloneGraph(&graph[0]); - CheckAndDeallocateGraph(result, graph); + CheckGraph(result, graph); } int main(int argc, char* argv[]) { diff --git a/epi_judge_cpp/is_string_decomposable_into_words.cc b/epi_judge_cpp/is_string_decomposable_into_words.cc index bbad8e0d3..afd0b227b 100644 --- a/epi_judge_cpp/is_string_decomposable_into_words.cc +++ b/epi_judge_cpp/is_string_decomposable_into_words.cc @@ -1,7 +1,9 @@ #include #include #include + #include "test_framework/generic_test.h" +#include "test_framework/test_failure.h" using std::string; using std::unordered_set; @@ -13,10 +15,34 @@ vector DecomposeIntoDictionaryWords( return {}; } +void DecomposeIntoDictionaryWordsWrapper( + TimedExecutor& executor, const string& domain, + const unordered_set& dictionary, bool decomposable) { + vector result = executor.Run( + [&] { return DecomposeIntoDictionaryWords(domain, dictionary); }); + if (!decomposable) { + if (!result.empty()) { + throw TestFailure("domain is not decomposable"); + } + return; + } + + if (std::any_of(std::begin(result), std::end(result), + [&](const std::string& s) { return !dictionary.count(s); })) { + throw TestFailure("Result uses words not in dictionary"); + } + + if (std::accumulate(std::begin(result), std::end(result), string()) != + domain) { + throw TestFailure("Result is not composed into domain"); + } +} + int main(int argc, char* argv[]) { std::vector args{argv + 1, argv + argc}; - std::vector param_names{"domain", "dictionary"}; + std::vector param_names{"executor", "domain", "dictionary", + "decomposable"}; return GenericTestMain(args, "is_string_decomposable_into_words.tsv", - &DecomposeIntoDictionaryWords, DefaultComparator{}, - param_names); + &DecomposeIntoDictionaryWordsWrapper, + DefaultComparator{}, param_names); } diff --git a/epi_judge_cpp/test_framework/test_utils.h b/epi_judge_cpp/test_framework/test_utils.h index 8d8b98b3a..c3e2f3c4e 100644 --- a/epi_judge_cpp/test_framework/test_utils.h +++ b/epi_judge_cpp/test_framework/test_utils.h @@ -63,7 +63,7 @@ std::string GetDefaultTestDataDirPath() { } std::string GetFilePathInJudgeDir(const std::string& file_name) { - return GetDefaultTestDataDirPath().insert(0, pardir) + platform::PathSep() + file_name; + return GetDefaultTestDataDirPath() + platform::PathSep() + std::string(pardir) + file_name; } /** diff --git a/epi_judge_cpp_solutions/CMakeLists.txt b/epi_judge_cpp_solutions/CMakeLists.txt new file mode 100644 index 000000000..4abaa2d4c --- /dev/null +++ b/epi_judge_cpp_solutions/CMakeLists.txt @@ -0,0 +1,224 @@ +cmake_minimum_required(VERSION 3.4) +project(epi_judge_cpp) + +set(CMAKE_CXX_STANDARD 17) + +if (MSVC) + add_definitions(-D_CRT_SECURE_NO_WARNINGS -wd4018 -wd4800 -wd4805) +else() + link_libraries(pthread) +endif() + +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) + +add_executable(a_b_sqrt2 a_b_sqrt2.cc) +add_executable(absent_value_array absent_value_array.cc) +add_executable(adding_credits adding_credits.cc) +add_executable(advance_by_offsets advance_by_offsets.cc) +add_executable(alternating_array alternating_array.cc) +add_executable(anagrams anagrams.cc) +add_executable(apply_permutation apply_permutation.cc) +add_executable(arbitrage arbitrage.cc) +add_executable(binomial_coefficients binomial_coefficients.cc) +add_executable(bonus bonus.cc) +add_executable(bst_from_preorder bst_from_preorder.cc) +add_executable(bst_from_sorted_array bst_from_sorted_array.cc) +add_executable(bst_merge bst_merge.cc) +add_executable(bst_to_sorted_list bst_to_sorted_list.cc) +add_executable(buy_and_sell_stock buy_and_sell_stock.cc) +add_executable(buy_and_sell_stock_k_times buy_and_sell_stock_k_times.cc) +add_executable(buy_and_sell_stock_twice buy_and_sell_stock_twice.cc) +add_executable(calendar_rendering calendar_rendering.cc) +add_executable(circular_queue circular_queue.cc) +add_executable(closest_int_same_weight closest_int_same_weight.cc) +add_executable(collatz_checker collatz_checker.cc) +add_executable(combinations combinations.cc) +add_executable(convert_base convert_base.cc) +add_executable(copy_posting_list copy_posting_list.cc) +add_executable(count_bits count_bits.cc) +add_executable(count_inversions count_inversions.cc) +add_executable(deadlock_detection deadlock_detection.cc) +add_executable(defective_jugs defective_jugs.cc) +add_executable(delete_from_list delete_from_list.cc) +add_executable(delete_kth_last_from_list delete_kth_last_from_list.cc) +add_executable(delete_node_from_list delete_node_from_list.cc) +add_executable(descendant_and_ancestor_in_bst descendant_and_ancestor_in_bst.cc) +add_executable(directory_path_normalization directory_path_normalization.cc) +add_executable(do_lists_overlap do_lists_overlap.cc) +add_executable(do_terminated_lists_overlap do_terminated_lists_overlap.cc) +add_executable(drawing_skyline drawing_skyline.cc) +add_executable(dutch_national_flag dutch_national_flag.cc) +add_executable(element_appearing_once element_appearing_once.cc) +add_executable(enumerate_balanced_parentheses enumerate_balanced_parentheses.cc) +add_executable(enumerate_palindromic_decompositions enumerate_palindromic_decompositions.cc) +add_executable(enumerate_trees enumerate_trees.cc) +add_executable(evaluate_rpn evaluate_rpn.cc) +add_executable(even_odd_array even_odd_array.cc) +add_executable(even_odd_list_merge even_odd_list_merge.cc) +add_executable(find_salary_threshold find_salary_threshold.cc) +add_executable(first_missing_positive_entry first_missing_positive_entry.cc) +add_executable(gcd gcd.cc) +add_executable(graph_clone graph_clone.cc) +add_executable(gray_code gray_code.cc) +add_executable(group_equal_entries group_equal_entries.cc) +add_executable(h_index h_index.cc) +add_executable(hanoi hanoi.cc) +add_executable(huffman_coding huffman_coding.cc) +add_executable(insert_in_list insert_in_list.cc) +add_executable(insert_operators_in_string insert_operators_in_string.cc) +add_executable(int_as_array_increment int_as_array_increment.cc) +add_executable(int_as_array_multiply int_as_array_multiply.cc) +add_executable(int_as_list_add int_as_list_add.cc) +add_executable(int_square_root int_square_root.cc) +add_executable(intersect_sorted_arrays intersect_sorted_arrays.cc) +add_executable(interval_add interval_add.cc) +add_executable(intervals_union intervals_union.cc) +add_executable(is_anonymous_letter_constructible is_anonymous_letter_constructible.cc) +add_executable(is_array_dominated is_array_dominated.cc) +add_executable(is_circuit_wirable is_circuit_wirable.cc) +add_executable(is_list_cyclic is_list_cyclic.cc) +add_executable(is_list_palindromic is_list_palindromic.cc) +add_executable(is_number_palindromic is_number_palindromic.cc) +add_executable(is_string_decomposable_into_words is_string_decomposable_into_words.cc) +add_executable(is_string_in_matrix is_string_in_matrix.cc) +add_executable(is_string_palindromic_punctuation is_string_palindromic_punctuation.cc) +add_executable(is_string_permutable_to_palindrome is_string_permutable_to_palindrome.cc) +add_executable(is_tree_a_bst is_tree_a_bst.cc) +add_executable(is_tree_balanced is_tree_balanced.cc) +add_executable(is_tree_symmetric is_tree_symmetric.cc) +add_executable(is_valid_parenthesization is_valid_parenthesization.cc) +add_executable(is_valid_sudoku is_valid_sudoku.cc) +add_executable(k_closest_stars k_closest_stars.cc) +add_executable(k_largest_in_heap k_largest_in_heap.cc) +add_executable(k_largest_values_in_bst k_largest_values_in_bst.cc) +add_executable(knapsack knapsack.cc) +add_executable(kth_largest_element_in_two_sorted_arrays kth_largest_element_in_two_sorted_arrays.cc) +add_executable(kth_largest_in_array kth_largest_in_array.cc) +add_executable(kth_node_in_tree kth_node_in_tree.cc) +add_executable(largest_rectangle_under_skyline largest_rectangle_under_skyline.cc) +add_executable(left_right_justify_text left_right_justify_text.cc) +add_executable(levenshtein_distance levenshtein_distance.cc) +add_executable(line_through_most_points line_through_most_points.cc) +add_executable(list_cyclic_right_shift list_cyclic_right_shift.cc) +add_executable(longest_contained_interval longest_contained_interval.cc) +add_executable(longest_increasing_subarray longest_increasing_subarray.cc) +add_executable(longest_nondecreasing_subsequence longest_nondecreasing_subsequence.cc) +add_executable(longest_subarray_with_distinct_values longest_subarray_with_distinct_values.cc) +add_executable(longest_subarray_with_sum_constraint longest_subarray_with_sum_constraint.cc) +add_executable(longest_substring_with_matching_parentheses longest_substring_with_matching_parentheses.cc) +add_executable(look_and_say look_and_say.cc) +add_executable(lowest_common_ancestor lowest_common_ancestor.cc) +add_executable(lowest_common_ancestor_close_ancestor lowest_common_ancestor_close_ancestor.cc) +add_executable(lowest_common_ancestor_in_bst lowest_common_ancestor_in_bst.cc) +add_executable(lowest_common_ancestor_with_parent lowest_common_ancestor_with_parent.cc) +add_executable(lru_cache lru_cache.cc) +add_executable(majority_element majority_element.cc) +add_executable(matrix_connected_regions matrix_connected_regions.cc) +add_executable(matrix_enclosed_regions matrix_enclosed_regions.cc) +add_executable(matrix_rotation matrix_rotation.cc) +add_executable(max_of_sliding_window max_of_sliding_window.cc) +add_executable(max_product_all_but_one max_product_all_but_one.cc) +add_executable(max_safe_height max_safe_height.cc) +add_executable(max_square_submatrix max_square_submatrix.cc) +add_executable(max_submatrix max_submatrix.cc) +add_executable(max_teams_in_photograph max_teams_in_photograph.cc) +add_executable(max_trapped_water max_trapped_water.cc) +add_executable(max_water_trappable max_water_trappable.cc) +add_executable(maximum_subarray_in_circular_array maximum_subarray_in_circular_array.cc) +add_executable(minimum_distance_3_sorted_arrays minimum_distance_3_sorted_arrays.cc) +add_executable(minimum_points_covering_intervals minimum_points_covering_intervals.cc) +add_executable(minimum_waiting_time minimum_waiting_time.cc) +add_executable(minimum_weight_path_in_a_triangle minimum_weight_path_in_a_triangle.cc) +add_executable(n_queens n_queens.cc) +add_executable(nearest_repeated_entries nearest_repeated_entries.cc) +add_executable(next_permutation next_permutation.cc) +add_executable(nonuniform_random_number nonuniform_random_number.cc) +add_executable(number_of_score_combinations number_of_score_combinations.cc) +add_executable(number_of_traversals_matrix number_of_traversals_matrix.cc) +add_executable(number_of_traversals_staircase number_of_traversals_staircase.cc) +add_executable(offline_sampling offline_sampling.cc) +add_executable(online_median online_median.cc) +add_executable(online_sampling online_sampling.cc) +add_executable(parity parity.cc) +add_executable(pascal_triangle pascal_triangle.cc) +add_executable(path_sum path_sum.cc) +add_executable(permutations permutations.cc) +add_executable(phone_number_mnemonic phone_number_mnemonic.cc) +add_executable(picking_up_coins picking_up_coins.cc) +add_executable(pivot_list pivot_list.cc) +add_executable(power_set power_set.cc) +add_executable(power_x_y power_x_y.cc) +add_executable(pretty_printing pretty_printing.cc) +add_executable(prime_sieve prime_sieve.cc) +add_executable(primitive_divide primitive_divide.cc) +add_executable(primitive_multiply primitive_multiply.cc) +add_executable(queue_from_stacks queue_from_stacks.cc) +add_executable(queue_with_max queue_with_max.cc) +add_executable(random_permutation random_permutation.cc) +add_executable(random_subset random_subset.cc) +add_executable(real_square_root real_square_root.cc) +add_executable(rectangle_intersection rectangle_intersection.cc) +add_executable(refueling_schedule refueling_schedule.cc) +add_executable(regular_expression regular_expression.cc) +add_executable(remove_duplicates remove_duplicates.cc) +add_executable(remove_duplicates_from_sorted_list remove_duplicates_from_sorted_list.cc) +add_executable(replace_and_remove replace_and_remove.cc) +add_executable(reverse_bits reverse_bits.cc) +add_executable(reverse_digits reverse_digits.cc) +add_executable(reverse_sublist reverse_sublist.cc) +add_executable(reverse_words reverse_words.cc) +add_executable(road_network road_network.cc) +add_executable(roman_to_integer roman_to_integer.cc) +add_executable(rook_attack rook_attack.cc) +add_executable(rotate_array rotate_array.cc) +add_executable(run_length_compression run_length_compression.cc) +add_executable(search_entry_equal_to_index search_entry_equal_to_index.cc) +add_executable(search_first_greater_value_in_bst search_first_greater_value_in_bst.cc) +add_executable(search_first_key search_first_key.cc) +add_executable(search_for_min_max_in_array search_for_min_max_in_array.cc) +add_executable(search_for_missing_element search_for_missing_element.cc) +add_executable(search_frequent_items search_frequent_items.cc) +add_executable(search_in_list search_in_list.cc) +add_executable(search_maze search_maze.cc) +add_executable(search_row_col_sorted_matrix search_row_col_sorted_matrix.cc) +add_executable(search_shifted_sorted_array search_shifted_sorted_array.cc) +add_executable(search_unknown_length_array search_unknown_length_array.cc) +add_executable(smallest_nonconstructible_value smallest_nonconstructible_value.cc) +add_executable(smallest_subarray_covering_all_values smallest_subarray_covering_all_values.cc) +add_executable(smallest_subarray_covering_set smallest_subarray_covering_set.cc) +add_executable(snake_string snake_string.cc) +add_executable(sort_almost_sorted_array sort_almost_sorted_array.cc) +add_executable(sort_increasing_decreasing_array sort_increasing_decreasing_array.cc) +add_executable(sort_list sort_list.cc) +add_executable(sorted_array_remove_dups sorted_array_remove_dups.cc) +add_executable(sorted_arrays_merge sorted_arrays_merge.cc) +add_executable(sorted_list_to_bst sorted_list_to_bst.cc) +add_executable(sorted_lists_merge sorted_lists_merge.cc) +add_executable(spiral_ordering_segments spiral_ordering_segments.cc) +add_executable(spreadsheet_encoding spreadsheet_encoding.cc) +add_executable(stack_with_max stack_with_max.cc) +add_executable(string_decompositions_into_dictionary_words string_decompositions_into_dictionary_words.cc) +add_executable(string_integer_interconversion string_integer_interconversion.cc) +add_executable(string_transformability string_transformability.cc) +add_executable(substring_match substring_match.cc) +add_executable(successor_in_tree successor_in_tree.cc) +add_executable(sudoku_solve sudoku_solve.cc) +add_executable(sum_root_to_leaf sum_root_to_leaf.cc) +add_executable(sunset_view sunset_view.cc) +add_executable(swap_bits swap_bits.cc) +add_executable(task_pairing task_pairing.cc) +add_executable(three_sum three_sum.cc) +add_executable(tree_connect_leaves tree_connect_leaves.cc) +add_executable(tree_exterior tree_exterior.cc) +add_executable(tree_from_preorder_inorder tree_from_preorder_inorder.cc) +add_executable(tree_from_preorder_with_null tree_from_preorder_with_null.cc) +add_executable(tree_inorder tree_inorder.cc) +add_executable(tree_level_order tree_level_order.cc) +add_executable(tree_postorder tree_postorder.cc) +add_executable(tree_preorder tree_preorder.cc) +add_executable(tree_right_sibling tree_right_sibling.cc) +add_executable(tree_with_parent_inorder tree_with_parent_inorder.cc) +add_executable(two_sum two_sum.cc) +add_executable(uniform_random_number uniform_random_number.cc) +add_executable(valid_ip_addresses valid_ip_addresses.cc) +add_executable(zip_list zip_list.cc) diff --git a/epi_judge_cpp_solutions/Makefile b/epi_judge_cpp_solutions/Makefile new file mode 100644 index 000000000..f568912b5 --- /dev/null +++ b/epi_judge_cpp_solutions/Makefile @@ -0,0 +1,2349 @@ +#Comile and run by "make " +BUILD_DIR := cpp_build +SRC_DIR := . +TEST_DATA_DIR := ../test_data + +# Modify this line if you want to pass custom arguments +PROGRAM_ARGS := --test-data-dir $(TEST_DATA_DIR) + +CXX_COMPILER := g++ +CXX_FLAGS := -std=c++17 -pthread -Werror +CXX_FLAGS_DEBUG := $(CXX_FLAGS) -g -O0 + +LAST_MODIFIED_CXX_FILE = $(shell ls -rt $(SRC_DIR)/*\.cc | tail -1) + + +last: $(notdir $(basename $(LAST_MODIFIED_CXX_FILE))) + +.PHONY: last + +$(BUILD_DIR): + mkdir -p $(BUILD_DIR) + + +# a_b_sqrt2.cc + +$(BUILD_DIR)/a_b_sqrt2: $(SRC_DIR)/a_b_sqrt2.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +a_b_sqrt2: $(BUILD_DIR)/a_b_sqrt2 + $< $(PROGRAM_ARGS) + +.PHONY: a_b_sqrt2 + + +# absent_value_array.cc + +$(BUILD_DIR)/absent_value_array: $(SRC_DIR)/absent_value_array.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +absent_value_array: $(BUILD_DIR)/absent_value_array + $< $(PROGRAM_ARGS) + +.PHONY: absent_value_array + + +# adding_credits.cc + +$(BUILD_DIR)/adding_credits: $(SRC_DIR)/adding_credits.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +adding_credits: $(BUILD_DIR)/adding_credits + $< $(PROGRAM_ARGS) + +.PHONY: adding_credits + + +# advance_by_offsets.cc + +$(BUILD_DIR)/advance_by_offsets: $(SRC_DIR)/advance_by_offsets.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +advance_by_offsets: $(BUILD_DIR)/advance_by_offsets + $< $(PROGRAM_ARGS) + +.PHONY: advance_by_offsets + + +# alternating_array.cc + +$(BUILD_DIR)/alternating_array: $(SRC_DIR)/alternating_array.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +alternating_array: $(BUILD_DIR)/alternating_array + $< $(PROGRAM_ARGS) + +.PHONY: alternating_array + + +# anagrams.cc + +$(BUILD_DIR)/anagrams: $(SRC_DIR)/anagrams.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +anagrams: $(BUILD_DIR)/anagrams + $< $(PROGRAM_ARGS) + +.PHONY: anagrams + + +# apply_permutation.cc + +$(BUILD_DIR)/apply_permutation: $(SRC_DIR)/apply_permutation.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +apply_permutation: $(BUILD_DIR)/apply_permutation + $< $(PROGRAM_ARGS) + +.PHONY: apply_permutation + + +# arbitrage.cc + +$(BUILD_DIR)/arbitrage: $(SRC_DIR)/arbitrage.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +arbitrage: $(BUILD_DIR)/arbitrage + $< $(PROGRAM_ARGS) + +.PHONY: arbitrage + + +# binomial_coefficients.cc + +$(BUILD_DIR)/binomial_coefficients: $(SRC_DIR)/binomial_coefficients.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +binomial_coefficients: $(BUILD_DIR)/binomial_coefficients + $< $(PROGRAM_ARGS) + +.PHONY: binomial_coefficients + + +# bonus.cc + +$(BUILD_DIR)/bonus: $(SRC_DIR)/bonus.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +bonus: $(BUILD_DIR)/bonus + $< $(PROGRAM_ARGS) + +.PHONY: bonus + + +# bst_from_preorder.cc + +$(BUILD_DIR)/bst_from_preorder: $(SRC_DIR)/bst_from_preorder.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +bst_from_preorder: $(BUILD_DIR)/bst_from_preorder + $< $(PROGRAM_ARGS) + +.PHONY: bst_from_preorder + + +# bst_from_sorted_array.cc + +$(BUILD_DIR)/bst_from_sorted_array: $(SRC_DIR)/bst_from_sorted_array.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +bst_from_sorted_array: $(BUILD_DIR)/bst_from_sorted_array + $< $(PROGRAM_ARGS) + +.PHONY: bst_from_sorted_array + + +# bst_merge.cc + +$(BUILD_DIR)/bst_merge: $(SRC_DIR)/bst_merge.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +bst_merge: $(BUILD_DIR)/bst_merge + $< $(PROGRAM_ARGS) + +.PHONY: bst_merge + + +# bst_to_sorted_list.cc + +$(BUILD_DIR)/bst_to_sorted_list: $(SRC_DIR)/bst_to_sorted_list.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +bst_to_sorted_list: $(BUILD_DIR)/bst_to_sorted_list + $< $(PROGRAM_ARGS) + +.PHONY: bst_to_sorted_list + + +# buy_and_sell_stock.cc + +$(BUILD_DIR)/buy_and_sell_stock: $(SRC_DIR)/buy_and_sell_stock.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +buy_and_sell_stock: $(BUILD_DIR)/buy_and_sell_stock + $< $(PROGRAM_ARGS) + +.PHONY: buy_and_sell_stock + + +# buy_and_sell_stock_k_times.cc + +$(BUILD_DIR)/buy_and_sell_stock_k_times: $(SRC_DIR)/buy_and_sell_stock_k_times.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +buy_and_sell_stock_k_times: $(BUILD_DIR)/buy_and_sell_stock_k_times + $< $(PROGRAM_ARGS) + +.PHONY: buy_and_sell_stock_k_times + + +# buy_and_sell_stock_twice.cc + +$(BUILD_DIR)/buy_and_sell_stock_twice: $(SRC_DIR)/buy_and_sell_stock_twice.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +buy_and_sell_stock_twice: $(BUILD_DIR)/buy_and_sell_stock_twice + $< $(PROGRAM_ARGS) + +.PHONY: buy_and_sell_stock_twice + + +# calendar_rendering.cc + +$(BUILD_DIR)/calendar_rendering: $(SRC_DIR)/calendar_rendering.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +calendar_rendering: $(BUILD_DIR)/calendar_rendering + $< $(PROGRAM_ARGS) + +.PHONY: calendar_rendering + + +# circular_queue.cc + +$(BUILD_DIR)/circular_queue: $(SRC_DIR)/circular_queue.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +circular_queue: $(BUILD_DIR)/circular_queue + $< $(PROGRAM_ARGS) + +.PHONY: circular_queue + + +# closest_int_same_weight.cc + +$(BUILD_DIR)/closest_int_same_weight: $(SRC_DIR)/closest_int_same_weight.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +closest_int_same_weight: $(BUILD_DIR)/closest_int_same_weight + $< $(PROGRAM_ARGS) + +.PHONY: closest_int_same_weight + + +# collatz_checker.cc + +$(BUILD_DIR)/collatz_checker: $(SRC_DIR)/collatz_checker.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +collatz_checker: $(BUILD_DIR)/collatz_checker + $< $(PROGRAM_ARGS) + +.PHONY: collatz_checker + + +# combinations.cc + +$(BUILD_DIR)/combinations: $(SRC_DIR)/combinations.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +combinations: $(BUILD_DIR)/combinations + $< $(PROGRAM_ARGS) + +.PHONY: combinations + + +# convert_base.cc + +$(BUILD_DIR)/convert_base: $(SRC_DIR)/convert_base.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +convert_base: $(BUILD_DIR)/convert_base + $< $(PROGRAM_ARGS) + +.PHONY: convert_base + + +# copy_posting_list.cc + +$(BUILD_DIR)/copy_posting_list: $(SRC_DIR)/copy_posting_list.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +copy_posting_list: $(BUILD_DIR)/copy_posting_list + $< $(PROGRAM_ARGS) + +.PHONY: copy_posting_list + + +# count_bits.cc + +$(BUILD_DIR)/count_bits: $(SRC_DIR)/count_bits.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +count_bits: $(BUILD_DIR)/count_bits + $< $(PROGRAM_ARGS) + +.PHONY: count_bits + + +# count_inversions.cc + +$(BUILD_DIR)/count_inversions: $(SRC_DIR)/count_inversions.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +count_inversions: $(BUILD_DIR)/count_inversions + $< $(PROGRAM_ARGS) + +.PHONY: count_inversions + + +# deadlock_detection.cc + +$(BUILD_DIR)/deadlock_detection: $(SRC_DIR)/deadlock_detection.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +deadlock_detection: $(BUILD_DIR)/deadlock_detection + $< $(PROGRAM_ARGS) + +.PHONY: deadlock_detection + + +# defective_jugs.cc + +$(BUILD_DIR)/defective_jugs: $(SRC_DIR)/defective_jugs.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +defective_jugs: $(BUILD_DIR)/defective_jugs + $< $(PROGRAM_ARGS) + +.PHONY: defective_jugs + + +# delete_from_list.cc + +$(BUILD_DIR)/delete_from_list: $(SRC_DIR)/delete_from_list.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +delete_from_list: $(BUILD_DIR)/delete_from_list + $< $(PROGRAM_ARGS) + +.PHONY: delete_from_list + + +# delete_kth_last_from_list.cc + +$(BUILD_DIR)/delete_kth_last_from_list: $(SRC_DIR)/delete_kth_last_from_list.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +delete_kth_last_from_list: $(BUILD_DIR)/delete_kth_last_from_list + $< $(PROGRAM_ARGS) + +.PHONY: delete_kth_last_from_list + + +# delete_node_from_list.cc + +$(BUILD_DIR)/delete_node_from_list: $(SRC_DIR)/delete_node_from_list.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +delete_node_from_list: $(BUILD_DIR)/delete_node_from_list + $< $(PROGRAM_ARGS) + +.PHONY: delete_node_from_list + + +# descendant_and_ancestor_in_bst.cc + +$(BUILD_DIR)/descendant_and_ancestor_in_bst: $(SRC_DIR)/descendant_and_ancestor_in_bst.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +descendant_and_ancestor_in_bst: $(BUILD_DIR)/descendant_and_ancestor_in_bst + $< $(PROGRAM_ARGS) + +.PHONY: descendant_and_ancestor_in_bst + + +# directory_path_normalization.cc + +$(BUILD_DIR)/directory_path_normalization: $(SRC_DIR)/directory_path_normalization.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +directory_path_normalization: $(BUILD_DIR)/directory_path_normalization + $< $(PROGRAM_ARGS) + +.PHONY: directory_path_normalization + + +# do_lists_overlap.cc + +$(BUILD_DIR)/do_lists_overlap: $(SRC_DIR)/do_lists_overlap.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +do_lists_overlap: $(BUILD_DIR)/do_lists_overlap + $< $(PROGRAM_ARGS) + +.PHONY: do_lists_overlap + + +# do_terminated_lists_overlap.cc + +$(BUILD_DIR)/do_terminated_lists_overlap: $(SRC_DIR)/do_terminated_lists_overlap.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +do_terminated_lists_overlap: $(BUILD_DIR)/do_terminated_lists_overlap + $< $(PROGRAM_ARGS) + +.PHONY: do_terminated_lists_overlap + + +# drawing_skyline.cc + +$(BUILD_DIR)/drawing_skyline: $(SRC_DIR)/drawing_skyline.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +drawing_skyline: $(BUILD_DIR)/drawing_skyline + $< $(PROGRAM_ARGS) + +.PHONY: drawing_skyline + + +# dutch_national_flag.cc + +$(BUILD_DIR)/dutch_national_flag: $(SRC_DIR)/dutch_national_flag.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +dutch_national_flag: $(BUILD_DIR)/dutch_national_flag + $< $(PROGRAM_ARGS) + +.PHONY: dutch_national_flag + + +# element_appearing_once.cc + +$(BUILD_DIR)/element_appearing_once: $(SRC_DIR)/element_appearing_once.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +element_appearing_once: $(BUILD_DIR)/element_appearing_once + $< $(PROGRAM_ARGS) + +.PHONY: element_appearing_once + + +# enumerate_balanced_parentheses.cc + +$(BUILD_DIR)/enumerate_balanced_parentheses: $(SRC_DIR)/enumerate_balanced_parentheses.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +enumerate_balanced_parentheses: $(BUILD_DIR)/enumerate_balanced_parentheses + $< $(PROGRAM_ARGS) + +.PHONY: enumerate_balanced_parentheses + + +# enumerate_palindromic_decompositions.cc + +$(BUILD_DIR)/enumerate_palindromic_decompositions: $(SRC_DIR)/enumerate_palindromic_decompositions.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +enumerate_palindromic_decompositions: $(BUILD_DIR)/enumerate_palindromic_decompositions + $< $(PROGRAM_ARGS) + +.PHONY: enumerate_palindromic_decompositions + + +# enumerate_trees.cc + +$(BUILD_DIR)/enumerate_trees: $(SRC_DIR)/enumerate_trees.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +enumerate_trees: $(BUILD_DIR)/enumerate_trees + $< $(PROGRAM_ARGS) + +.PHONY: enumerate_trees + + +# evaluate_rpn.cc + +$(BUILD_DIR)/evaluate_rpn: $(SRC_DIR)/evaluate_rpn.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +evaluate_rpn: $(BUILD_DIR)/evaluate_rpn + $< $(PROGRAM_ARGS) + +.PHONY: evaluate_rpn + + +# even_odd_array.cc + +$(BUILD_DIR)/even_odd_array: $(SRC_DIR)/even_odd_array.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +even_odd_array: $(BUILD_DIR)/even_odd_array + $< $(PROGRAM_ARGS) + +.PHONY: even_odd_array + + +# even_odd_list_merge.cc + +$(BUILD_DIR)/even_odd_list_merge: $(SRC_DIR)/even_odd_list_merge.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +even_odd_list_merge: $(BUILD_DIR)/even_odd_list_merge + $< $(PROGRAM_ARGS) + +.PHONY: even_odd_list_merge + + +# find_salary_threshold.cc + +$(BUILD_DIR)/find_salary_threshold: $(SRC_DIR)/find_salary_threshold.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +find_salary_threshold: $(BUILD_DIR)/find_salary_threshold + $< $(PROGRAM_ARGS) + +.PHONY: find_salary_threshold + + +# first_missing_positive_entry.cc + +$(BUILD_DIR)/first_missing_positive_entry: $(SRC_DIR)/first_missing_positive_entry.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +first_missing_positive_entry: $(BUILD_DIR)/first_missing_positive_entry + $< $(PROGRAM_ARGS) + +.PHONY: first_missing_positive_entry + + +# gcd.cc + +$(BUILD_DIR)/gcd: $(SRC_DIR)/gcd.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +gcd: $(BUILD_DIR)/gcd + $< $(PROGRAM_ARGS) + +.PHONY: gcd + + +# graph_clone.cc + +$(BUILD_DIR)/graph_clone: $(SRC_DIR)/graph_clone.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +graph_clone: $(BUILD_DIR)/graph_clone + $< $(PROGRAM_ARGS) + +.PHONY: graph_clone + + +# gray_code.cc + +$(BUILD_DIR)/gray_code: $(SRC_DIR)/gray_code.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +gray_code: $(BUILD_DIR)/gray_code + $< $(PROGRAM_ARGS) + +.PHONY: gray_code + + +# group_equal_entries.cc + +$(BUILD_DIR)/group_equal_entries: $(SRC_DIR)/group_equal_entries.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +group_equal_entries: $(BUILD_DIR)/group_equal_entries + $< $(PROGRAM_ARGS) + +.PHONY: group_equal_entries + + +# h_index.cc + +$(BUILD_DIR)/h_index: $(SRC_DIR)/h_index.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +h_index: $(BUILD_DIR)/h_index + $< $(PROGRAM_ARGS) + +.PHONY: h_index + + +# hanoi.cc + +$(BUILD_DIR)/hanoi: $(SRC_DIR)/hanoi.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +hanoi: $(BUILD_DIR)/hanoi + $< $(PROGRAM_ARGS) + +.PHONY: hanoi + + +# huffman_coding.cc + +$(BUILD_DIR)/huffman_coding: $(SRC_DIR)/huffman_coding.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +huffman_coding: $(BUILD_DIR)/huffman_coding + $< $(PROGRAM_ARGS) + +.PHONY: huffman_coding + + +# insert_in_list.cc + +$(BUILD_DIR)/insert_in_list: $(SRC_DIR)/insert_in_list.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +insert_in_list: $(BUILD_DIR)/insert_in_list + $< $(PROGRAM_ARGS) + +.PHONY: insert_in_list + + +# insert_operators_in_string.cc + +$(BUILD_DIR)/insert_operators_in_string: $(SRC_DIR)/insert_operators_in_string.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +insert_operators_in_string: $(BUILD_DIR)/insert_operators_in_string + $< $(PROGRAM_ARGS) + +.PHONY: insert_operators_in_string + + +# int_as_array_increment.cc + +$(BUILD_DIR)/int_as_array_increment: $(SRC_DIR)/int_as_array_increment.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +int_as_array_increment: $(BUILD_DIR)/int_as_array_increment + $< $(PROGRAM_ARGS) + +.PHONY: int_as_array_increment + + +# int_as_array_multiply.cc + +$(BUILD_DIR)/int_as_array_multiply: $(SRC_DIR)/int_as_array_multiply.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +int_as_array_multiply: $(BUILD_DIR)/int_as_array_multiply + $< $(PROGRAM_ARGS) + +.PHONY: int_as_array_multiply + + +# int_as_list_add.cc + +$(BUILD_DIR)/int_as_list_add: $(SRC_DIR)/int_as_list_add.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +int_as_list_add: $(BUILD_DIR)/int_as_list_add + $< $(PROGRAM_ARGS) + +.PHONY: int_as_list_add + + +# int_square_root.cc + +$(BUILD_DIR)/int_square_root: $(SRC_DIR)/int_square_root.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +int_square_root: $(BUILD_DIR)/int_square_root + $< $(PROGRAM_ARGS) + +.PHONY: int_square_root + + +# intersect_sorted_arrays.cc + +$(BUILD_DIR)/intersect_sorted_arrays: $(SRC_DIR)/intersect_sorted_arrays.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +intersect_sorted_arrays: $(BUILD_DIR)/intersect_sorted_arrays + $< $(PROGRAM_ARGS) + +.PHONY: intersect_sorted_arrays + + +# interval_add.cc + +$(BUILD_DIR)/interval_add: $(SRC_DIR)/interval_add.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +interval_add: $(BUILD_DIR)/interval_add + $< $(PROGRAM_ARGS) + +.PHONY: interval_add + + +# intervals_union.cc + +$(BUILD_DIR)/intervals_union: $(SRC_DIR)/intervals_union.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +intervals_union: $(BUILD_DIR)/intervals_union + $< $(PROGRAM_ARGS) + +.PHONY: intervals_union + + +# is_anonymous_letter_constructible.cc + +$(BUILD_DIR)/is_anonymous_letter_constructible: $(SRC_DIR)/is_anonymous_letter_constructible.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +is_anonymous_letter_constructible: $(BUILD_DIR)/is_anonymous_letter_constructible + $< $(PROGRAM_ARGS) + +.PHONY: is_anonymous_letter_constructible + + +# is_array_dominated.cc + +$(BUILD_DIR)/is_array_dominated: $(SRC_DIR)/is_array_dominated.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +is_array_dominated: $(BUILD_DIR)/is_array_dominated + $< $(PROGRAM_ARGS) + +.PHONY: is_array_dominated + + +# is_circuit_wirable.cc + +$(BUILD_DIR)/is_circuit_wirable: $(SRC_DIR)/is_circuit_wirable.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +is_circuit_wirable: $(BUILD_DIR)/is_circuit_wirable + $< $(PROGRAM_ARGS) + +.PHONY: is_circuit_wirable + + +# is_list_cyclic.cc + +$(BUILD_DIR)/is_list_cyclic: $(SRC_DIR)/is_list_cyclic.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +is_list_cyclic: $(BUILD_DIR)/is_list_cyclic + $< $(PROGRAM_ARGS) + +.PHONY: is_list_cyclic + + +# is_list_palindromic.cc + +$(BUILD_DIR)/is_list_palindromic: $(SRC_DIR)/is_list_palindromic.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +is_list_palindromic: $(BUILD_DIR)/is_list_palindromic + $< $(PROGRAM_ARGS) + +.PHONY: is_list_palindromic + + +# is_number_palindromic.cc + +$(BUILD_DIR)/is_number_palindromic: $(SRC_DIR)/is_number_palindromic.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +is_number_palindromic: $(BUILD_DIR)/is_number_palindromic + $< $(PROGRAM_ARGS) + +.PHONY: is_number_palindromic + + +# is_string_decomposable_into_words.cc + +$(BUILD_DIR)/is_string_decomposable_into_words: $(SRC_DIR)/is_string_decomposable_into_words.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +is_string_decomposable_into_words: $(BUILD_DIR)/is_string_decomposable_into_words + $< $(PROGRAM_ARGS) + +.PHONY: is_string_decomposable_into_words + + +# is_string_in_matrix.cc + +$(BUILD_DIR)/is_string_in_matrix: $(SRC_DIR)/is_string_in_matrix.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +is_string_in_matrix: $(BUILD_DIR)/is_string_in_matrix + $< $(PROGRAM_ARGS) + +.PHONY: is_string_in_matrix + + +# is_string_palindromic_punctuation.cc + +$(BUILD_DIR)/is_string_palindromic_punctuation: $(SRC_DIR)/is_string_palindromic_punctuation.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +is_string_palindromic_punctuation: $(BUILD_DIR)/is_string_palindromic_punctuation + $< $(PROGRAM_ARGS) + +.PHONY: is_string_palindromic_punctuation + + +# is_string_permutable_to_palindrome.cc + +$(BUILD_DIR)/is_string_permutable_to_palindrome: $(SRC_DIR)/is_string_permutable_to_palindrome.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +is_string_permutable_to_palindrome: $(BUILD_DIR)/is_string_permutable_to_palindrome + $< $(PROGRAM_ARGS) + +.PHONY: is_string_permutable_to_palindrome + + +# is_tree_a_bst.cc + +$(BUILD_DIR)/is_tree_a_bst: $(SRC_DIR)/is_tree_a_bst.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +is_tree_a_bst: $(BUILD_DIR)/is_tree_a_bst + $< $(PROGRAM_ARGS) + +.PHONY: is_tree_a_bst + + +# is_tree_balanced.cc + +$(BUILD_DIR)/is_tree_balanced: $(SRC_DIR)/is_tree_balanced.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +is_tree_balanced: $(BUILD_DIR)/is_tree_balanced + $< $(PROGRAM_ARGS) + +.PHONY: is_tree_balanced + + +# is_tree_symmetric.cc + +$(BUILD_DIR)/is_tree_symmetric: $(SRC_DIR)/is_tree_symmetric.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +is_tree_symmetric: $(BUILD_DIR)/is_tree_symmetric + $< $(PROGRAM_ARGS) + +.PHONY: is_tree_symmetric + + +# is_valid_parenthesization.cc + +$(BUILD_DIR)/is_valid_parenthesization: $(SRC_DIR)/is_valid_parenthesization.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +is_valid_parenthesization: $(BUILD_DIR)/is_valid_parenthesization + $< $(PROGRAM_ARGS) + +.PHONY: is_valid_parenthesization + + +# is_valid_sudoku.cc + +$(BUILD_DIR)/is_valid_sudoku: $(SRC_DIR)/is_valid_sudoku.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +is_valid_sudoku: $(BUILD_DIR)/is_valid_sudoku + $< $(PROGRAM_ARGS) + +.PHONY: is_valid_sudoku + + +# k_closest_stars.cc + +$(BUILD_DIR)/k_closest_stars: $(SRC_DIR)/k_closest_stars.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +k_closest_stars: $(BUILD_DIR)/k_closest_stars + $< $(PROGRAM_ARGS) + +.PHONY: k_closest_stars + + +# k_largest_in_heap.cc + +$(BUILD_DIR)/k_largest_in_heap: $(SRC_DIR)/k_largest_in_heap.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +k_largest_in_heap: $(BUILD_DIR)/k_largest_in_heap + $< $(PROGRAM_ARGS) + +.PHONY: k_largest_in_heap + + +# k_largest_values_in_bst.cc + +$(BUILD_DIR)/k_largest_values_in_bst: $(SRC_DIR)/k_largest_values_in_bst.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +k_largest_values_in_bst: $(BUILD_DIR)/k_largest_values_in_bst + $< $(PROGRAM_ARGS) + +.PHONY: k_largest_values_in_bst + + +# knapsack.cc + +$(BUILD_DIR)/knapsack: $(SRC_DIR)/knapsack.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +knapsack: $(BUILD_DIR)/knapsack + $< $(PROGRAM_ARGS) + +.PHONY: knapsack + + +# kth_largest_element_in_two_sorted_arrays.cc + +$(BUILD_DIR)/kth_largest_element_in_two_sorted_arrays: $(SRC_DIR)/kth_largest_element_in_two_sorted_arrays.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +kth_largest_element_in_two_sorted_arrays: $(BUILD_DIR)/kth_largest_element_in_two_sorted_arrays + $< $(PROGRAM_ARGS) + +.PHONY: kth_largest_element_in_two_sorted_arrays + + +# kth_largest_in_array.cc + +$(BUILD_DIR)/kth_largest_in_array: $(SRC_DIR)/kth_largest_in_array.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +kth_largest_in_array: $(BUILD_DIR)/kth_largest_in_array + $< $(PROGRAM_ARGS) + +.PHONY: kth_largest_in_array + + +# kth_node_in_tree.cc + +$(BUILD_DIR)/kth_node_in_tree: $(SRC_DIR)/kth_node_in_tree.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +kth_node_in_tree: $(BUILD_DIR)/kth_node_in_tree + $< $(PROGRAM_ARGS) + +.PHONY: kth_node_in_tree + + +# largest_rectangle_under_skyline.cc + +$(BUILD_DIR)/largest_rectangle_under_skyline: $(SRC_DIR)/largest_rectangle_under_skyline.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +largest_rectangle_under_skyline: $(BUILD_DIR)/largest_rectangle_under_skyline + $< $(PROGRAM_ARGS) + +.PHONY: largest_rectangle_under_skyline + + +# left_right_justify_text.cc + +$(BUILD_DIR)/left_right_justify_text: $(SRC_DIR)/left_right_justify_text.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +left_right_justify_text: $(BUILD_DIR)/left_right_justify_text + $< $(PROGRAM_ARGS) + +.PHONY: left_right_justify_text + + +# levenshtein_distance.cc + +$(BUILD_DIR)/levenshtein_distance: $(SRC_DIR)/levenshtein_distance.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +levenshtein_distance: $(BUILD_DIR)/levenshtein_distance + $< $(PROGRAM_ARGS) + +.PHONY: levenshtein_distance + + +# line_through_most_points.cc + +$(BUILD_DIR)/line_through_most_points: $(SRC_DIR)/line_through_most_points.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +line_through_most_points: $(BUILD_DIR)/line_through_most_points + $< $(PROGRAM_ARGS) + +.PHONY: line_through_most_points + + +# list_cyclic_right_shift.cc + +$(BUILD_DIR)/list_cyclic_right_shift: $(SRC_DIR)/list_cyclic_right_shift.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +list_cyclic_right_shift: $(BUILD_DIR)/list_cyclic_right_shift + $< $(PROGRAM_ARGS) + +.PHONY: list_cyclic_right_shift + + +# longest_contained_interval.cc + +$(BUILD_DIR)/longest_contained_interval: $(SRC_DIR)/longest_contained_interval.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +longest_contained_interval: $(BUILD_DIR)/longest_contained_interval + $< $(PROGRAM_ARGS) + +.PHONY: longest_contained_interval + + +# longest_increasing_subarray.cc + +$(BUILD_DIR)/longest_increasing_subarray: $(SRC_DIR)/longest_increasing_subarray.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +longest_increasing_subarray: $(BUILD_DIR)/longest_increasing_subarray + $< $(PROGRAM_ARGS) + +.PHONY: longest_increasing_subarray + + +# longest_nondecreasing_subsequence.cc + +$(BUILD_DIR)/longest_nondecreasing_subsequence: $(SRC_DIR)/longest_nondecreasing_subsequence.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +longest_nondecreasing_subsequence: $(BUILD_DIR)/longest_nondecreasing_subsequence + $< $(PROGRAM_ARGS) + +.PHONY: longest_nondecreasing_subsequence + + +# longest_subarray_with_distinct_values.cc + +$(BUILD_DIR)/longest_subarray_with_distinct_values: $(SRC_DIR)/longest_subarray_with_distinct_values.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +longest_subarray_with_distinct_values: $(BUILD_DIR)/longest_subarray_with_distinct_values + $< $(PROGRAM_ARGS) + +.PHONY: longest_subarray_with_distinct_values + + +# longest_subarray_with_sum_constraint.cc + +$(BUILD_DIR)/longest_subarray_with_sum_constraint: $(SRC_DIR)/longest_subarray_with_sum_constraint.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +longest_subarray_with_sum_constraint: $(BUILD_DIR)/longest_subarray_with_sum_constraint + $< $(PROGRAM_ARGS) + +.PHONY: longest_subarray_with_sum_constraint + + +# longest_substring_with_matching_parentheses.cc + +$(BUILD_DIR)/longest_substring_with_matching_parentheses: $(SRC_DIR)/longest_substring_with_matching_parentheses.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +longest_substring_with_matching_parentheses: $(BUILD_DIR)/longest_substring_with_matching_parentheses + $< $(PROGRAM_ARGS) + +.PHONY: longest_substring_with_matching_parentheses + + +# look_and_say.cc + +$(BUILD_DIR)/look_and_say: $(SRC_DIR)/look_and_say.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +look_and_say: $(BUILD_DIR)/look_and_say + $< $(PROGRAM_ARGS) + +.PHONY: look_and_say + + +# lowest_common_ancestor.cc + +$(BUILD_DIR)/lowest_common_ancestor: $(SRC_DIR)/lowest_common_ancestor.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +lowest_common_ancestor: $(BUILD_DIR)/lowest_common_ancestor + $< $(PROGRAM_ARGS) + +.PHONY: lowest_common_ancestor + + +# lowest_common_ancestor_close_ancestor.cc + +$(BUILD_DIR)/lowest_common_ancestor_close_ancestor: $(SRC_DIR)/lowest_common_ancestor_close_ancestor.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +lowest_common_ancestor_close_ancestor: $(BUILD_DIR)/lowest_common_ancestor_close_ancestor + $< $(PROGRAM_ARGS) + +.PHONY: lowest_common_ancestor_close_ancestor + + +# lowest_common_ancestor_in_bst.cc + +$(BUILD_DIR)/lowest_common_ancestor_in_bst: $(SRC_DIR)/lowest_common_ancestor_in_bst.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +lowest_common_ancestor_in_bst: $(BUILD_DIR)/lowest_common_ancestor_in_bst + $< $(PROGRAM_ARGS) + +.PHONY: lowest_common_ancestor_in_bst + + +# lowest_common_ancestor_with_parent.cc + +$(BUILD_DIR)/lowest_common_ancestor_with_parent: $(SRC_DIR)/lowest_common_ancestor_with_parent.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +lowest_common_ancestor_with_parent: $(BUILD_DIR)/lowest_common_ancestor_with_parent + $< $(PROGRAM_ARGS) + +.PHONY: lowest_common_ancestor_with_parent + + +# lru_cache.cc + +$(BUILD_DIR)/lru_cache: $(SRC_DIR)/lru_cache.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +lru_cache: $(BUILD_DIR)/lru_cache + $< $(PROGRAM_ARGS) + +.PHONY: lru_cache + + +# majority_element.cc + +$(BUILD_DIR)/majority_element: $(SRC_DIR)/majority_element.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +majority_element: $(BUILD_DIR)/majority_element + $< $(PROGRAM_ARGS) + +.PHONY: majority_element + + +# matrix_connected_regions.cc + +$(BUILD_DIR)/matrix_connected_regions: $(SRC_DIR)/matrix_connected_regions.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +matrix_connected_regions: $(BUILD_DIR)/matrix_connected_regions + $< $(PROGRAM_ARGS) + +.PHONY: matrix_connected_regions + + +# matrix_enclosed_regions.cc + +$(BUILD_DIR)/matrix_enclosed_regions: $(SRC_DIR)/matrix_enclosed_regions.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +matrix_enclosed_regions: $(BUILD_DIR)/matrix_enclosed_regions + $< $(PROGRAM_ARGS) + +.PHONY: matrix_enclosed_regions + + +# matrix_rotation.cc + +$(BUILD_DIR)/matrix_rotation: $(SRC_DIR)/matrix_rotation.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +matrix_rotation: $(BUILD_DIR)/matrix_rotation + $< $(PROGRAM_ARGS) + +.PHONY: matrix_rotation + + +# max_of_sliding_window.cc + +$(BUILD_DIR)/max_of_sliding_window: $(SRC_DIR)/max_of_sliding_window.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +max_of_sliding_window: $(BUILD_DIR)/max_of_sliding_window + $< $(PROGRAM_ARGS) + +.PHONY: max_of_sliding_window + + +# max_product_all_but_one.cc + +$(BUILD_DIR)/max_product_all_but_one: $(SRC_DIR)/max_product_all_but_one.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +max_product_all_but_one: $(BUILD_DIR)/max_product_all_but_one + $< $(PROGRAM_ARGS) + +.PHONY: max_product_all_but_one + + +# max_safe_height.cc + +$(BUILD_DIR)/max_safe_height: $(SRC_DIR)/max_safe_height.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +max_safe_height: $(BUILD_DIR)/max_safe_height + $< $(PROGRAM_ARGS) + +.PHONY: max_safe_height + + +# max_square_submatrix.cc + +$(BUILD_DIR)/max_square_submatrix: $(SRC_DIR)/max_square_submatrix.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +max_square_submatrix: $(BUILD_DIR)/max_square_submatrix + $< $(PROGRAM_ARGS) + +.PHONY: max_square_submatrix + + +# max_submatrix.cc + +$(BUILD_DIR)/max_submatrix: $(SRC_DIR)/max_submatrix.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +max_submatrix: $(BUILD_DIR)/max_submatrix + $< $(PROGRAM_ARGS) + +.PHONY: max_submatrix + + +# max_teams_in_photograph.cc + +$(BUILD_DIR)/max_teams_in_photograph: $(SRC_DIR)/max_teams_in_photograph.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +max_teams_in_photograph: $(BUILD_DIR)/max_teams_in_photograph + $< $(PROGRAM_ARGS) + +.PHONY: max_teams_in_photograph + + +# max_trapped_water.cc + +$(BUILD_DIR)/max_trapped_water: $(SRC_DIR)/max_trapped_water.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +max_trapped_water: $(BUILD_DIR)/max_trapped_water + $< $(PROGRAM_ARGS) + +.PHONY: max_trapped_water + + +# max_water_trappable.cc + +$(BUILD_DIR)/max_water_trappable: $(SRC_DIR)/max_water_trappable.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +max_water_trappable: $(BUILD_DIR)/max_water_trappable + $< $(PROGRAM_ARGS) + +.PHONY: max_water_trappable + + +# maximum_subarray_in_circular_array.cc + +$(BUILD_DIR)/maximum_subarray_in_circular_array: $(SRC_DIR)/maximum_subarray_in_circular_array.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +maximum_subarray_in_circular_array: $(BUILD_DIR)/maximum_subarray_in_circular_array + $< $(PROGRAM_ARGS) + +.PHONY: maximum_subarray_in_circular_array + + +# minimum_distance_3_sorted_arrays.cc + +$(BUILD_DIR)/minimum_distance_3_sorted_arrays: $(SRC_DIR)/minimum_distance_3_sorted_arrays.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +minimum_distance_3_sorted_arrays: $(BUILD_DIR)/minimum_distance_3_sorted_arrays + $< $(PROGRAM_ARGS) + +.PHONY: minimum_distance_3_sorted_arrays + + +# minimum_points_covering_intervals.cc + +$(BUILD_DIR)/minimum_points_covering_intervals: $(SRC_DIR)/minimum_points_covering_intervals.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +minimum_points_covering_intervals: $(BUILD_DIR)/minimum_points_covering_intervals + $< $(PROGRAM_ARGS) + +.PHONY: minimum_points_covering_intervals + + +# minimum_waiting_time.cc + +$(BUILD_DIR)/minimum_waiting_time: $(SRC_DIR)/minimum_waiting_time.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +minimum_waiting_time: $(BUILD_DIR)/minimum_waiting_time + $< $(PROGRAM_ARGS) + +.PHONY: minimum_waiting_time + + +# minimum_weight_path_in_a_triangle.cc + +$(BUILD_DIR)/minimum_weight_path_in_a_triangle: $(SRC_DIR)/minimum_weight_path_in_a_triangle.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +minimum_weight_path_in_a_triangle: $(BUILD_DIR)/minimum_weight_path_in_a_triangle + $< $(PROGRAM_ARGS) + +.PHONY: minimum_weight_path_in_a_triangle + + +# n_queens.cc + +$(BUILD_DIR)/n_queens: $(SRC_DIR)/n_queens.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +n_queens: $(BUILD_DIR)/n_queens + $< $(PROGRAM_ARGS) + +.PHONY: n_queens + + +# nearest_repeated_entries.cc + +$(BUILD_DIR)/nearest_repeated_entries: $(SRC_DIR)/nearest_repeated_entries.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +nearest_repeated_entries: $(BUILD_DIR)/nearest_repeated_entries + $< $(PROGRAM_ARGS) + +.PHONY: nearest_repeated_entries + + +# next_permutation.cc + +$(BUILD_DIR)/next_permutation: $(SRC_DIR)/next_permutation.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +next_permutation: $(BUILD_DIR)/next_permutation + $< $(PROGRAM_ARGS) + +.PHONY: next_permutation + + +# nonuniform_random_number.cc + +$(BUILD_DIR)/nonuniform_random_number: $(SRC_DIR)/nonuniform_random_number.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +nonuniform_random_number: $(BUILD_DIR)/nonuniform_random_number + $< $(PROGRAM_ARGS) + +.PHONY: nonuniform_random_number + + +# number_of_score_combinations.cc + +$(BUILD_DIR)/number_of_score_combinations: $(SRC_DIR)/number_of_score_combinations.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +number_of_score_combinations: $(BUILD_DIR)/number_of_score_combinations + $< $(PROGRAM_ARGS) + +.PHONY: number_of_score_combinations + + +# number_of_traversals_matrix.cc + +$(BUILD_DIR)/number_of_traversals_matrix: $(SRC_DIR)/number_of_traversals_matrix.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +number_of_traversals_matrix: $(BUILD_DIR)/number_of_traversals_matrix + $< $(PROGRAM_ARGS) + +.PHONY: number_of_traversals_matrix + + +# number_of_traversals_staircase.cc + +$(BUILD_DIR)/number_of_traversals_staircase: $(SRC_DIR)/number_of_traversals_staircase.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +number_of_traversals_staircase: $(BUILD_DIR)/number_of_traversals_staircase + $< $(PROGRAM_ARGS) + +.PHONY: number_of_traversals_staircase + + +# offline_sampling.cc + +$(BUILD_DIR)/offline_sampling: $(SRC_DIR)/offline_sampling.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +offline_sampling: $(BUILD_DIR)/offline_sampling + $< $(PROGRAM_ARGS) + +.PHONY: offline_sampling + + +# online_median.cc + +$(BUILD_DIR)/online_median: $(SRC_DIR)/online_median.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +online_median: $(BUILD_DIR)/online_median + $< $(PROGRAM_ARGS) + +.PHONY: online_median + + +# online_sampling.cc + +$(BUILD_DIR)/online_sampling: $(SRC_DIR)/online_sampling.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +online_sampling: $(BUILD_DIR)/online_sampling + $< $(PROGRAM_ARGS) + +.PHONY: online_sampling + + +# parity.cc + +$(BUILD_DIR)/parity: $(SRC_DIR)/parity.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +parity: $(BUILD_DIR)/parity + $< $(PROGRAM_ARGS) + +.PHONY: parity + + +# pascal_triangle.cc + +$(BUILD_DIR)/pascal_triangle: $(SRC_DIR)/pascal_triangle.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +pascal_triangle: $(BUILD_DIR)/pascal_triangle + $< $(PROGRAM_ARGS) + +.PHONY: pascal_triangle + + +# path_sum.cc + +$(BUILD_DIR)/path_sum: $(SRC_DIR)/path_sum.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +path_sum: $(BUILD_DIR)/path_sum + $< $(PROGRAM_ARGS) + +.PHONY: path_sum + + +# permutations.cc + +$(BUILD_DIR)/permutations: $(SRC_DIR)/permutations.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +permutations: $(BUILD_DIR)/permutations + $< $(PROGRAM_ARGS) + +.PHONY: permutations + + +# phone_number_mnemonic.cc + +$(BUILD_DIR)/phone_number_mnemonic: $(SRC_DIR)/phone_number_mnemonic.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +phone_number_mnemonic: $(BUILD_DIR)/phone_number_mnemonic + $< $(PROGRAM_ARGS) + +.PHONY: phone_number_mnemonic + + +# picking_up_coins.cc + +$(BUILD_DIR)/picking_up_coins: $(SRC_DIR)/picking_up_coins.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +picking_up_coins: $(BUILD_DIR)/picking_up_coins + $< $(PROGRAM_ARGS) + +.PHONY: picking_up_coins + + +# pivot_list.cc + +$(BUILD_DIR)/pivot_list: $(SRC_DIR)/pivot_list.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +pivot_list: $(BUILD_DIR)/pivot_list + $< $(PROGRAM_ARGS) + +.PHONY: pivot_list + + +# power_set.cc + +$(BUILD_DIR)/power_set: $(SRC_DIR)/power_set.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +power_set: $(BUILD_DIR)/power_set + $< $(PROGRAM_ARGS) + +.PHONY: power_set + + +# power_x_y.cc + +$(BUILD_DIR)/power_x_y: $(SRC_DIR)/power_x_y.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +power_x_y: $(BUILD_DIR)/power_x_y + $< $(PROGRAM_ARGS) + +.PHONY: power_x_y + + +# pretty_printing.cc + +$(BUILD_DIR)/pretty_printing: $(SRC_DIR)/pretty_printing.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +pretty_printing: $(BUILD_DIR)/pretty_printing + $< $(PROGRAM_ARGS) + +.PHONY: pretty_printing + + +# prime_sieve.cc + +$(BUILD_DIR)/prime_sieve: $(SRC_DIR)/prime_sieve.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +prime_sieve: $(BUILD_DIR)/prime_sieve + $< $(PROGRAM_ARGS) + +.PHONY: prime_sieve + + +# primitive_divide.cc + +$(BUILD_DIR)/primitive_divide: $(SRC_DIR)/primitive_divide.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +primitive_divide: $(BUILD_DIR)/primitive_divide + $< $(PROGRAM_ARGS) + +.PHONY: primitive_divide + + +# primitive_multiply.cc + +$(BUILD_DIR)/primitive_multiply: $(SRC_DIR)/primitive_multiply.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +primitive_multiply: $(BUILD_DIR)/primitive_multiply + $< $(PROGRAM_ARGS) + +.PHONY: primitive_multiply + + +# queue_from_stacks.cc + +$(BUILD_DIR)/queue_from_stacks: $(SRC_DIR)/queue_from_stacks.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +queue_from_stacks: $(BUILD_DIR)/queue_from_stacks + $< $(PROGRAM_ARGS) + +.PHONY: queue_from_stacks + + +# queue_with_max.cc + +$(BUILD_DIR)/queue_with_max: $(SRC_DIR)/queue_with_max.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +queue_with_max: $(BUILD_DIR)/queue_with_max + $< $(PROGRAM_ARGS) + +.PHONY: queue_with_max + + +# random_permutation.cc + +$(BUILD_DIR)/random_permutation: $(SRC_DIR)/random_permutation.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +random_permutation: $(BUILD_DIR)/random_permutation + $< $(PROGRAM_ARGS) + +.PHONY: random_permutation + + +# random_subset.cc + +$(BUILD_DIR)/random_subset: $(SRC_DIR)/random_subset.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +random_subset: $(BUILD_DIR)/random_subset + $< $(PROGRAM_ARGS) + +.PHONY: random_subset + + +# real_square_root.cc + +$(BUILD_DIR)/real_square_root: $(SRC_DIR)/real_square_root.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +real_square_root: $(BUILD_DIR)/real_square_root + $< $(PROGRAM_ARGS) + +.PHONY: real_square_root + + +# rectangle_intersection.cc + +$(BUILD_DIR)/rectangle_intersection: $(SRC_DIR)/rectangle_intersection.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +rectangle_intersection: $(BUILD_DIR)/rectangle_intersection + $< $(PROGRAM_ARGS) + +.PHONY: rectangle_intersection + + +# refueling_schedule.cc + +$(BUILD_DIR)/refueling_schedule: $(SRC_DIR)/refueling_schedule.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +refueling_schedule: $(BUILD_DIR)/refueling_schedule + $< $(PROGRAM_ARGS) + +.PHONY: refueling_schedule + + +# regular_expression.cc + +$(BUILD_DIR)/regular_expression: $(SRC_DIR)/regular_expression.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +regular_expression: $(BUILD_DIR)/regular_expression + $< $(PROGRAM_ARGS) + +.PHONY: regular_expression + + +# remove_duplicates.cc + +$(BUILD_DIR)/remove_duplicates: $(SRC_DIR)/remove_duplicates.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +remove_duplicates: $(BUILD_DIR)/remove_duplicates + $< $(PROGRAM_ARGS) + +.PHONY: remove_duplicates + + +# remove_duplicates_from_sorted_list.cc + +$(BUILD_DIR)/remove_duplicates_from_sorted_list: $(SRC_DIR)/remove_duplicates_from_sorted_list.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +remove_duplicates_from_sorted_list: $(BUILD_DIR)/remove_duplicates_from_sorted_list + $< $(PROGRAM_ARGS) + +.PHONY: remove_duplicates_from_sorted_list + + +# replace_and_remove.cc + +$(BUILD_DIR)/replace_and_remove: $(SRC_DIR)/replace_and_remove.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +replace_and_remove: $(BUILD_DIR)/replace_and_remove + $< $(PROGRAM_ARGS) + +.PHONY: replace_and_remove + + +# reverse_bits.cc + +$(BUILD_DIR)/reverse_bits: $(SRC_DIR)/reverse_bits.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +reverse_bits: $(BUILD_DIR)/reverse_bits + $< $(PROGRAM_ARGS) + +.PHONY: reverse_bits + + +# reverse_digits.cc + +$(BUILD_DIR)/reverse_digits: $(SRC_DIR)/reverse_digits.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +reverse_digits: $(BUILD_DIR)/reverse_digits + $< $(PROGRAM_ARGS) + +.PHONY: reverse_digits + + +# reverse_sublist.cc + +$(BUILD_DIR)/reverse_sublist: $(SRC_DIR)/reverse_sublist.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +reverse_sublist: $(BUILD_DIR)/reverse_sublist + $< $(PROGRAM_ARGS) + +.PHONY: reverse_sublist + + +# reverse_words.cc + +$(BUILD_DIR)/reverse_words: $(SRC_DIR)/reverse_words.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +reverse_words: $(BUILD_DIR)/reverse_words + $< $(PROGRAM_ARGS) + +.PHONY: reverse_words + + +# road_network.cc + +$(BUILD_DIR)/road_network: $(SRC_DIR)/road_network.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +road_network: $(BUILD_DIR)/road_network + $< $(PROGRAM_ARGS) + +.PHONY: road_network + + +# roman_to_integer.cc + +$(BUILD_DIR)/roman_to_integer: $(SRC_DIR)/roman_to_integer.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +roman_to_integer: $(BUILD_DIR)/roman_to_integer + $< $(PROGRAM_ARGS) + +.PHONY: roman_to_integer + + +# rook_attack.cc + +$(BUILD_DIR)/rook_attack: $(SRC_DIR)/rook_attack.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +rook_attack: $(BUILD_DIR)/rook_attack + $< $(PROGRAM_ARGS) + +.PHONY: rook_attack + + +# rotate_array.cc + +$(BUILD_DIR)/rotate_array: $(SRC_DIR)/rotate_array.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +rotate_array: $(BUILD_DIR)/rotate_array + $< $(PROGRAM_ARGS) + +.PHONY: rotate_array + + +# run_length_compression.cc + +$(BUILD_DIR)/run_length_compression: $(SRC_DIR)/run_length_compression.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +run_length_compression: $(BUILD_DIR)/run_length_compression + $< $(PROGRAM_ARGS) + +.PHONY: run_length_compression + + +# search_entry_equal_to_index.cc + +$(BUILD_DIR)/search_entry_equal_to_index: $(SRC_DIR)/search_entry_equal_to_index.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +search_entry_equal_to_index: $(BUILD_DIR)/search_entry_equal_to_index + $< $(PROGRAM_ARGS) + +.PHONY: search_entry_equal_to_index + + +# search_first_greater_value_in_bst.cc + +$(BUILD_DIR)/search_first_greater_value_in_bst: $(SRC_DIR)/search_first_greater_value_in_bst.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +search_first_greater_value_in_bst: $(BUILD_DIR)/search_first_greater_value_in_bst + $< $(PROGRAM_ARGS) + +.PHONY: search_first_greater_value_in_bst + + +# search_first_key.cc + +$(BUILD_DIR)/search_first_key: $(SRC_DIR)/search_first_key.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +search_first_key: $(BUILD_DIR)/search_first_key + $< $(PROGRAM_ARGS) + +.PHONY: search_first_key + + +# search_for_min_max_in_array.cc + +$(BUILD_DIR)/search_for_min_max_in_array: $(SRC_DIR)/search_for_min_max_in_array.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +search_for_min_max_in_array: $(BUILD_DIR)/search_for_min_max_in_array + $< $(PROGRAM_ARGS) + +.PHONY: search_for_min_max_in_array + + +# search_for_missing_element.cc + +$(BUILD_DIR)/search_for_missing_element: $(SRC_DIR)/search_for_missing_element.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +search_for_missing_element: $(BUILD_DIR)/search_for_missing_element + $< $(PROGRAM_ARGS) + +.PHONY: search_for_missing_element + + +# search_frequent_items.cc + +$(BUILD_DIR)/search_frequent_items: $(SRC_DIR)/search_frequent_items.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +search_frequent_items: $(BUILD_DIR)/search_frequent_items + $< $(PROGRAM_ARGS) + +.PHONY: search_frequent_items + + +# search_in_list.cc + +$(BUILD_DIR)/search_in_list: $(SRC_DIR)/search_in_list.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +search_in_list: $(BUILD_DIR)/search_in_list + $< $(PROGRAM_ARGS) + +.PHONY: search_in_list + + +# search_maze.cc + +$(BUILD_DIR)/search_maze: $(SRC_DIR)/search_maze.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +search_maze: $(BUILD_DIR)/search_maze + $< $(PROGRAM_ARGS) + +.PHONY: search_maze + + +# search_row_col_sorted_matrix.cc + +$(BUILD_DIR)/search_row_col_sorted_matrix: $(SRC_DIR)/search_row_col_sorted_matrix.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +search_row_col_sorted_matrix: $(BUILD_DIR)/search_row_col_sorted_matrix + $< $(PROGRAM_ARGS) + +.PHONY: search_row_col_sorted_matrix + + +# search_shifted_sorted_array.cc + +$(BUILD_DIR)/search_shifted_sorted_array: $(SRC_DIR)/search_shifted_sorted_array.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +search_shifted_sorted_array: $(BUILD_DIR)/search_shifted_sorted_array + $< $(PROGRAM_ARGS) + +.PHONY: search_shifted_sorted_array + + +# search_unknown_length_array.cc + +$(BUILD_DIR)/search_unknown_length_array: $(SRC_DIR)/search_unknown_length_array.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +search_unknown_length_array: $(BUILD_DIR)/search_unknown_length_array + $< $(PROGRAM_ARGS) + +.PHONY: search_unknown_length_array + + +# smallest_nonconstructible_value.cc + +$(BUILD_DIR)/smallest_nonconstructible_value: $(SRC_DIR)/smallest_nonconstructible_value.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +smallest_nonconstructible_value: $(BUILD_DIR)/smallest_nonconstructible_value + $< $(PROGRAM_ARGS) + +.PHONY: smallest_nonconstructible_value + + +# smallest_subarray_covering_all_values.cc + +$(BUILD_DIR)/smallest_subarray_covering_all_values: $(SRC_DIR)/smallest_subarray_covering_all_values.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +smallest_subarray_covering_all_values: $(BUILD_DIR)/smallest_subarray_covering_all_values + $< $(PROGRAM_ARGS) + +.PHONY: smallest_subarray_covering_all_values + + +# smallest_subarray_covering_set.cc + +$(BUILD_DIR)/smallest_subarray_covering_set: $(SRC_DIR)/smallest_subarray_covering_set.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +smallest_subarray_covering_set: $(BUILD_DIR)/smallest_subarray_covering_set + $< $(PROGRAM_ARGS) + +.PHONY: smallest_subarray_covering_set + + +# snake_string.cc + +$(BUILD_DIR)/snake_string: $(SRC_DIR)/snake_string.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +snake_string: $(BUILD_DIR)/snake_string + $< $(PROGRAM_ARGS) + +.PHONY: snake_string + + +# sort_almost_sorted_array.cc + +$(BUILD_DIR)/sort_almost_sorted_array: $(SRC_DIR)/sort_almost_sorted_array.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +sort_almost_sorted_array: $(BUILD_DIR)/sort_almost_sorted_array + $< $(PROGRAM_ARGS) + +.PHONY: sort_almost_sorted_array + + +# sort_increasing_decreasing_array.cc + +$(BUILD_DIR)/sort_increasing_decreasing_array: $(SRC_DIR)/sort_increasing_decreasing_array.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +sort_increasing_decreasing_array: $(BUILD_DIR)/sort_increasing_decreasing_array + $< $(PROGRAM_ARGS) + +.PHONY: sort_increasing_decreasing_array + + +# sort_list.cc + +$(BUILD_DIR)/sort_list: $(SRC_DIR)/sort_list.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +sort_list: $(BUILD_DIR)/sort_list + $< $(PROGRAM_ARGS) + +.PHONY: sort_list + + +# sorted_array_remove_dups.cc + +$(BUILD_DIR)/sorted_array_remove_dups: $(SRC_DIR)/sorted_array_remove_dups.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +sorted_array_remove_dups: $(BUILD_DIR)/sorted_array_remove_dups + $< $(PROGRAM_ARGS) + +.PHONY: sorted_array_remove_dups + + +# sorted_arrays_merge.cc + +$(BUILD_DIR)/sorted_arrays_merge: $(SRC_DIR)/sorted_arrays_merge.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +sorted_arrays_merge: $(BUILD_DIR)/sorted_arrays_merge + $< $(PROGRAM_ARGS) + +.PHONY: sorted_arrays_merge + + +# sorted_list_to_bst.cc + +$(BUILD_DIR)/sorted_list_to_bst: $(SRC_DIR)/sorted_list_to_bst.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +sorted_list_to_bst: $(BUILD_DIR)/sorted_list_to_bst + $< $(PROGRAM_ARGS) + +.PHONY: sorted_list_to_bst + + +# sorted_lists_merge.cc + +$(BUILD_DIR)/sorted_lists_merge: $(SRC_DIR)/sorted_lists_merge.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +sorted_lists_merge: $(BUILD_DIR)/sorted_lists_merge + $< $(PROGRAM_ARGS) + +.PHONY: sorted_lists_merge + + +# spiral_ordering_segments.cc + +$(BUILD_DIR)/spiral_ordering_segments: $(SRC_DIR)/spiral_ordering_segments.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +spiral_ordering_segments: $(BUILD_DIR)/spiral_ordering_segments + $< $(PROGRAM_ARGS) + +.PHONY: spiral_ordering_segments + + +# spreadsheet_encoding.cc + +$(BUILD_DIR)/spreadsheet_encoding: $(SRC_DIR)/spreadsheet_encoding.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +spreadsheet_encoding: $(BUILD_DIR)/spreadsheet_encoding + $< $(PROGRAM_ARGS) + +.PHONY: spreadsheet_encoding + + +# stack_with_max.cc + +$(BUILD_DIR)/stack_with_max: $(SRC_DIR)/stack_with_max.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +stack_with_max: $(BUILD_DIR)/stack_with_max + $< $(PROGRAM_ARGS) + +.PHONY: stack_with_max + + +# string_decompositions_into_dictionary_words.cc + +$(BUILD_DIR)/string_decompositions_into_dictionary_words: $(SRC_DIR)/string_decompositions_into_dictionary_words.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +string_decompositions_into_dictionary_words: $(BUILD_DIR)/string_decompositions_into_dictionary_words + $< $(PROGRAM_ARGS) + +.PHONY: string_decompositions_into_dictionary_words + + +# string_integer_interconversion.cc + +$(BUILD_DIR)/string_integer_interconversion: $(SRC_DIR)/string_integer_interconversion.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +string_integer_interconversion: $(BUILD_DIR)/string_integer_interconversion + $< $(PROGRAM_ARGS) + +.PHONY: string_integer_interconversion + + +# string_transformability.cc + +$(BUILD_DIR)/string_transformability: $(SRC_DIR)/string_transformability.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +string_transformability: $(BUILD_DIR)/string_transformability + $< $(PROGRAM_ARGS) + +.PHONY: string_transformability + + +# substring_match.cc + +$(BUILD_DIR)/substring_match: $(SRC_DIR)/substring_match.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +substring_match: $(BUILD_DIR)/substring_match + $< $(PROGRAM_ARGS) + +.PHONY: substring_match + + +# successor_in_tree.cc + +$(BUILD_DIR)/successor_in_tree: $(SRC_DIR)/successor_in_tree.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +successor_in_tree: $(BUILD_DIR)/successor_in_tree + $< $(PROGRAM_ARGS) + +.PHONY: successor_in_tree + + +# sudoku_solve.cc + +$(BUILD_DIR)/sudoku_solve: $(SRC_DIR)/sudoku_solve.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +sudoku_solve: $(BUILD_DIR)/sudoku_solve + $< $(PROGRAM_ARGS) + +.PHONY: sudoku_solve + + +# sum_root_to_leaf.cc + +$(BUILD_DIR)/sum_root_to_leaf: $(SRC_DIR)/sum_root_to_leaf.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +sum_root_to_leaf: $(BUILD_DIR)/sum_root_to_leaf + $< $(PROGRAM_ARGS) + +.PHONY: sum_root_to_leaf + + +# sunset_view.cc + +$(BUILD_DIR)/sunset_view: $(SRC_DIR)/sunset_view.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +sunset_view: $(BUILD_DIR)/sunset_view + $< $(PROGRAM_ARGS) + +.PHONY: sunset_view + + +# swap_bits.cc + +$(BUILD_DIR)/swap_bits: $(SRC_DIR)/swap_bits.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +swap_bits: $(BUILD_DIR)/swap_bits + $< $(PROGRAM_ARGS) + +.PHONY: swap_bits + + +# task_pairing.cc + +$(BUILD_DIR)/task_pairing: $(SRC_DIR)/task_pairing.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +task_pairing: $(BUILD_DIR)/task_pairing + $< $(PROGRAM_ARGS) + +.PHONY: task_pairing + + +# three_sum.cc + +$(BUILD_DIR)/three_sum: $(SRC_DIR)/three_sum.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +three_sum: $(BUILD_DIR)/three_sum + $< $(PROGRAM_ARGS) + +.PHONY: three_sum + + +# tree_connect_leaves.cc + +$(BUILD_DIR)/tree_connect_leaves: $(SRC_DIR)/tree_connect_leaves.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +tree_connect_leaves: $(BUILD_DIR)/tree_connect_leaves + $< $(PROGRAM_ARGS) + +.PHONY: tree_connect_leaves + + +# tree_exterior.cc + +$(BUILD_DIR)/tree_exterior: $(SRC_DIR)/tree_exterior.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +tree_exterior: $(BUILD_DIR)/tree_exterior + $< $(PROGRAM_ARGS) + +.PHONY: tree_exterior + + +# tree_from_preorder_inorder.cc + +$(BUILD_DIR)/tree_from_preorder_inorder: $(SRC_DIR)/tree_from_preorder_inorder.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +tree_from_preorder_inorder: $(BUILD_DIR)/tree_from_preorder_inorder + $< $(PROGRAM_ARGS) + +.PHONY: tree_from_preorder_inorder + + +# tree_from_preorder_with_null.cc + +$(BUILD_DIR)/tree_from_preorder_with_null: $(SRC_DIR)/tree_from_preorder_with_null.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +tree_from_preorder_with_null: $(BUILD_DIR)/tree_from_preorder_with_null + $< $(PROGRAM_ARGS) + +.PHONY: tree_from_preorder_with_null + + +# tree_inorder.cc + +$(BUILD_DIR)/tree_inorder: $(SRC_DIR)/tree_inorder.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +tree_inorder: $(BUILD_DIR)/tree_inorder + $< $(PROGRAM_ARGS) + +.PHONY: tree_inorder + + +# tree_level_order.cc + +$(BUILD_DIR)/tree_level_order: $(SRC_DIR)/tree_level_order.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +tree_level_order: $(BUILD_DIR)/tree_level_order + $< $(PROGRAM_ARGS) + +.PHONY: tree_level_order + + +# tree_postorder.cc + +$(BUILD_DIR)/tree_postorder: $(SRC_DIR)/tree_postorder.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +tree_postorder: $(BUILD_DIR)/tree_postorder + $< $(PROGRAM_ARGS) + +.PHONY: tree_postorder + + +# tree_preorder.cc + +$(BUILD_DIR)/tree_preorder: $(SRC_DIR)/tree_preorder.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +tree_preorder: $(BUILD_DIR)/tree_preorder + $< $(PROGRAM_ARGS) + +.PHONY: tree_preorder + + +# tree_right_sibling.cc + +$(BUILD_DIR)/tree_right_sibling: $(SRC_DIR)/tree_right_sibling.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +tree_right_sibling: $(BUILD_DIR)/tree_right_sibling + $< $(PROGRAM_ARGS) + +.PHONY: tree_right_sibling + + +# tree_with_parent_inorder.cc + +$(BUILD_DIR)/tree_with_parent_inorder: $(SRC_DIR)/tree_with_parent_inorder.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +tree_with_parent_inorder: $(BUILD_DIR)/tree_with_parent_inorder + $< $(PROGRAM_ARGS) + +.PHONY: tree_with_parent_inorder + + +# two_sum.cc + +$(BUILD_DIR)/two_sum: $(SRC_DIR)/two_sum.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +two_sum: $(BUILD_DIR)/two_sum + $< $(PROGRAM_ARGS) + +.PHONY: two_sum + + +# uniform_random_number.cc + +$(BUILD_DIR)/uniform_random_number: $(SRC_DIR)/uniform_random_number.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +uniform_random_number: $(BUILD_DIR)/uniform_random_number + $< $(PROGRAM_ARGS) + +.PHONY: uniform_random_number + + +# valid_ip_addresses.cc + +$(BUILD_DIR)/valid_ip_addresses: $(SRC_DIR)/valid_ip_addresses.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +valid_ip_addresses: $(BUILD_DIR)/valid_ip_addresses + $< $(PROGRAM_ARGS) + +.PHONY: valid_ip_addresses + + +# zip_list.cc + +$(BUILD_DIR)/zip_list: $(SRC_DIR)/zip_list.cc | $(BUILD_DIR) + $(CXX_COMPILER) $(CXX_FLAGS_DEBUG) -o $@ $< +zip_list: $(BUILD_DIR)/zip_list + $< $(PROGRAM_ARGS) + +.PHONY: zip_list + +all: \ + $(BUILD_DIR)/a_b_sqrt2 \ + $(BUILD_DIR)/absent_value_array \ + $(BUILD_DIR)/adding_credits \ + $(BUILD_DIR)/advance_by_offsets \ + $(BUILD_DIR)/alternating_array \ + $(BUILD_DIR)/anagrams \ + $(BUILD_DIR)/apply_permutation \ + $(BUILD_DIR)/arbitrage \ + $(BUILD_DIR)/binomial_coefficients \ + $(BUILD_DIR)/bonus \ + $(BUILD_DIR)/bst_from_preorder \ + $(BUILD_DIR)/bst_from_sorted_array \ + $(BUILD_DIR)/bst_merge \ + $(BUILD_DIR)/bst_to_sorted_list \ + $(BUILD_DIR)/buy_and_sell_stock \ + $(BUILD_DIR)/buy_and_sell_stock_k_times \ + $(BUILD_DIR)/buy_and_sell_stock_twice \ + $(BUILD_DIR)/calendar_rendering \ + $(BUILD_DIR)/circular_queue \ + $(BUILD_DIR)/closest_int_same_weight \ + $(BUILD_DIR)/collatz_checker \ + $(BUILD_DIR)/combinations \ + $(BUILD_DIR)/convert_base \ + $(BUILD_DIR)/copy_posting_list \ + $(BUILD_DIR)/count_bits \ + $(BUILD_DIR)/count_inversions \ + $(BUILD_DIR)/deadlock_detection \ + $(BUILD_DIR)/defective_jugs \ + $(BUILD_DIR)/delete_from_list \ + $(BUILD_DIR)/delete_kth_last_from_list \ + $(BUILD_DIR)/delete_node_from_list \ + $(BUILD_DIR)/descendant_and_ancestor_in_bst \ + $(BUILD_DIR)/directory_path_normalization \ + $(BUILD_DIR)/do_lists_overlap \ + $(BUILD_DIR)/do_terminated_lists_overlap \ + $(BUILD_DIR)/drawing_skyline \ + $(BUILD_DIR)/dutch_national_flag \ + $(BUILD_DIR)/element_appearing_once \ + $(BUILD_DIR)/enumerate_balanced_parentheses \ + $(BUILD_DIR)/enumerate_palindromic_decompositions \ + $(BUILD_DIR)/enumerate_trees \ + $(BUILD_DIR)/evaluate_rpn \ + $(BUILD_DIR)/even_odd_array \ + $(BUILD_DIR)/even_odd_list_merge \ + $(BUILD_DIR)/find_salary_threshold \ + $(BUILD_DIR)/first_missing_positive_entry \ + $(BUILD_DIR)/gcd \ + $(BUILD_DIR)/graph_clone \ + $(BUILD_DIR)/gray_code \ + $(BUILD_DIR)/group_equal_entries \ + $(BUILD_DIR)/h_index \ + $(BUILD_DIR)/hanoi \ + $(BUILD_DIR)/huffman_coding \ + $(BUILD_DIR)/insert_in_list \ + $(BUILD_DIR)/insert_operators_in_string \ + $(BUILD_DIR)/int_as_array_increment \ + $(BUILD_DIR)/int_as_array_multiply \ + $(BUILD_DIR)/int_as_list_add \ + $(BUILD_DIR)/int_square_root \ + $(BUILD_DIR)/intersect_sorted_arrays \ + $(BUILD_DIR)/interval_add \ + $(BUILD_DIR)/intervals_union \ + $(BUILD_DIR)/is_anonymous_letter_constructible \ + $(BUILD_DIR)/is_array_dominated \ + $(BUILD_DIR)/is_circuit_wirable \ + $(BUILD_DIR)/is_list_cyclic \ + $(BUILD_DIR)/is_list_palindromic \ + $(BUILD_DIR)/is_number_palindromic \ + $(BUILD_DIR)/is_string_decomposable_into_words \ + $(BUILD_DIR)/is_string_in_matrix \ + $(BUILD_DIR)/is_string_palindromic_punctuation \ + $(BUILD_DIR)/is_string_permutable_to_palindrome \ + $(BUILD_DIR)/is_tree_a_bst \ + $(BUILD_DIR)/is_tree_balanced \ + $(BUILD_DIR)/is_tree_symmetric \ + $(BUILD_DIR)/is_valid_parenthesization \ + $(BUILD_DIR)/is_valid_sudoku \ + $(BUILD_DIR)/k_closest_stars \ + $(BUILD_DIR)/k_largest_in_heap \ + $(BUILD_DIR)/k_largest_values_in_bst \ + $(BUILD_DIR)/knapsack \ + $(BUILD_DIR)/kth_largest_element_in_two_sorted_arrays \ + $(BUILD_DIR)/kth_largest_in_array \ + $(BUILD_DIR)/kth_node_in_tree \ + $(BUILD_DIR)/largest_rectangle_under_skyline \ + $(BUILD_DIR)/left_right_justify_text \ + $(BUILD_DIR)/levenshtein_distance \ + $(BUILD_DIR)/line_through_most_points \ + $(BUILD_DIR)/list_cyclic_right_shift \ + $(BUILD_DIR)/longest_contained_interval \ + $(BUILD_DIR)/longest_increasing_subarray \ + $(BUILD_DIR)/longest_nondecreasing_subsequence \ + $(BUILD_DIR)/longest_subarray_with_distinct_values \ + $(BUILD_DIR)/longest_subarray_with_sum_constraint \ + $(BUILD_DIR)/longest_substring_with_matching_parentheses \ + $(BUILD_DIR)/look_and_say \ + $(BUILD_DIR)/lowest_common_ancestor \ + $(BUILD_DIR)/lowest_common_ancestor_close_ancestor \ + $(BUILD_DIR)/lowest_common_ancestor_in_bst \ + $(BUILD_DIR)/lowest_common_ancestor_with_parent \ + $(BUILD_DIR)/lru_cache \ + $(BUILD_DIR)/majority_element \ + $(BUILD_DIR)/matrix_connected_regions \ + $(BUILD_DIR)/matrix_enclosed_regions \ + $(BUILD_DIR)/matrix_rotation \ + $(BUILD_DIR)/max_of_sliding_window \ + $(BUILD_DIR)/max_product_all_but_one \ + $(BUILD_DIR)/max_safe_height \ + $(BUILD_DIR)/max_square_submatrix \ + $(BUILD_DIR)/max_submatrix \ + $(BUILD_DIR)/max_teams_in_photograph \ + $(BUILD_DIR)/max_trapped_water \ + $(BUILD_DIR)/max_water_trappable \ + $(BUILD_DIR)/maximum_subarray_in_circular_array \ + $(BUILD_DIR)/minimum_distance_3_sorted_arrays \ + $(BUILD_DIR)/minimum_points_covering_intervals \ + $(BUILD_DIR)/minimum_waiting_time \ + $(BUILD_DIR)/minimum_weight_path_in_a_triangle \ + $(BUILD_DIR)/n_queens \ + $(BUILD_DIR)/nearest_repeated_entries \ + $(BUILD_DIR)/next_permutation \ + $(BUILD_DIR)/nonuniform_random_number \ + $(BUILD_DIR)/number_of_score_combinations \ + $(BUILD_DIR)/number_of_traversals_matrix \ + $(BUILD_DIR)/number_of_traversals_staircase \ + $(BUILD_DIR)/offline_sampling \ + $(BUILD_DIR)/online_median \ + $(BUILD_DIR)/online_sampling \ + $(BUILD_DIR)/parity \ + $(BUILD_DIR)/pascal_triangle \ + $(BUILD_DIR)/path_sum \ + $(BUILD_DIR)/permutations \ + $(BUILD_DIR)/phone_number_mnemonic \ + $(BUILD_DIR)/picking_up_coins \ + $(BUILD_DIR)/pivot_list \ + $(BUILD_DIR)/power_set \ + $(BUILD_DIR)/power_x_y \ + $(BUILD_DIR)/pretty_printing \ + $(BUILD_DIR)/prime_sieve \ + $(BUILD_DIR)/primitive_divide \ + $(BUILD_DIR)/primitive_multiply \ + $(BUILD_DIR)/queue_from_stacks \ + $(BUILD_DIR)/queue_with_max \ + $(BUILD_DIR)/random_permutation \ + $(BUILD_DIR)/random_subset \ + $(BUILD_DIR)/real_square_root \ + $(BUILD_DIR)/rectangle_intersection \ + $(BUILD_DIR)/refueling_schedule \ + $(BUILD_DIR)/regular_expression \ + $(BUILD_DIR)/remove_duplicates \ + $(BUILD_DIR)/remove_duplicates_from_sorted_list \ + $(BUILD_DIR)/replace_and_remove \ + $(BUILD_DIR)/reverse_bits \ + $(BUILD_DIR)/reverse_digits \ + $(BUILD_DIR)/reverse_sublist \ + $(BUILD_DIR)/reverse_words \ + $(BUILD_DIR)/road_network \ + $(BUILD_DIR)/roman_to_integer \ + $(BUILD_DIR)/rook_attack \ + $(BUILD_DIR)/rotate_array \ + $(BUILD_DIR)/run_length_compression \ + $(BUILD_DIR)/search_entry_equal_to_index \ + $(BUILD_DIR)/search_first_greater_value_in_bst \ + $(BUILD_DIR)/search_first_key \ + $(BUILD_DIR)/search_for_min_max_in_array \ + $(BUILD_DIR)/search_for_missing_element \ + $(BUILD_DIR)/search_frequent_items \ + $(BUILD_DIR)/search_in_list \ + $(BUILD_DIR)/search_maze \ + $(BUILD_DIR)/search_row_col_sorted_matrix \ + $(BUILD_DIR)/search_shifted_sorted_array \ + $(BUILD_DIR)/search_unknown_length_array \ + $(BUILD_DIR)/smallest_nonconstructible_value \ + $(BUILD_DIR)/smallest_subarray_covering_all_values \ + $(BUILD_DIR)/smallest_subarray_covering_set \ + $(BUILD_DIR)/snake_string \ + $(BUILD_DIR)/sort_almost_sorted_array \ + $(BUILD_DIR)/sort_increasing_decreasing_array \ + $(BUILD_DIR)/sort_list \ + $(BUILD_DIR)/sorted_array_remove_dups \ + $(BUILD_DIR)/sorted_arrays_merge \ + $(BUILD_DIR)/sorted_list_to_bst \ + $(BUILD_DIR)/sorted_lists_merge \ + $(BUILD_DIR)/spiral_ordering_segments \ + $(BUILD_DIR)/spreadsheet_encoding \ + $(BUILD_DIR)/stack_with_max \ + $(BUILD_DIR)/string_decompositions_into_dictionary_words \ + $(BUILD_DIR)/string_integer_interconversion \ + $(BUILD_DIR)/string_transformability \ + $(BUILD_DIR)/substring_match \ + $(BUILD_DIR)/successor_in_tree \ + $(BUILD_DIR)/sudoku_solve \ + $(BUILD_DIR)/sum_root_to_leaf \ + $(BUILD_DIR)/sunset_view \ + $(BUILD_DIR)/swap_bits \ + $(BUILD_DIR)/task_pairing \ + $(BUILD_DIR)/three_sum \ + $(BUILD_DIR)/tree_connect_leaves \ + $(BUILD_DIR)/tree_exterior \ + $(BUILD_DIR)/tree_from_preorder_inorder \ + $(BUILD_DIR)/tree_from_preorder_with_null \ + $(BUILD_DIR)/tree_inorder \ + $(BUILD_DIR)/tree_level_order \ + $(BUILD_DIR)/tree_postorder \ + $(BUILD_DIR)/tree_preorder \ + $(BUILD_DIR)/tree_right_sibling \ + $(BUILD_DIR)/tree_with_parent_inorder \ + $(BUILD_DIR)/two_sum \ + $(BUILD_DIR)/uniform_random_number \ + $(BUILD_DIR)/valid_ip_addresses \ + $(BUILD_DIR)/zip_list + +clean: + rm -r $(BUILD_DIR) + +.PHONY: all clean diff --git a/epi_judge_cpp_solutions/a_b_sqrt2.cc b/epi_judge_cpp_solutions/a_b_sqrt2.cc new file mode 100644 index 000000000..846f8cb7b --- /dev/null +++ b/epi_judge_cpp_solutions/a_b_sqrt2.cc @@ -0,0 +1,44 @@ +#include +#include +#include +#include +#include "test_framework/generic_test.h" + +using std::function; +using std::set; +using std::vector; + +// These numbers have very interesting property, and people called it ugly +// numbers. It is also called Quadratic integer rings. +struct Number { + Number(int a, int b) : a(a), b(b), val(a + b * sqrt(2)) {} + + int a, b; + double val; +}; + +vector GenerateFirstKABSqrt2(int k) { + set> candidates( + [](const Number &a, const Number &b) { return a.val < b.val; }); + // Initial for 0 + 0 * sqrt(2). + candidates.emplace(0, 0); + + vector result; + while (size(result) < k) { + auto next_smallest = cbegin(candidates); + result.emplace_back(next_smallest->val); + + // Adds the next two numbers derived from next_smallest. + candidates.emplace(next_smallest->a + 1, next_smallest->b); + candidates.emplace(next_smallest->a, next_smallest->b + 1); + candidates.erase(next_smallest); + } + return result; +} + +int main(int argc, char *argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"k"}; + return GenericTestMain(args, "a_b_sqrt2.tsv", &GenerateFirstKABSqrt2, + DefaultComparator{}, param_names); +} diff --git a/epi_judge_cpp_solutions/absent_value_array.cc b/epi_judge_cpp_solutions/absent_value_array.cc new file mode 100644 index 000000000..a6b01b30c --- /dev/null +++ b/epi_judge_cpp_solutions/absent_value_array.cc @@ -0,0 +1,69 @@ +#include +#include +#include + +#include "test_framework/generic_test.h" +#include "test_framework/test_failure.h" + +using std::bitset; +using std::invalid_argument; +using std::vector; + +int FindMissingElement(vector::const_iterator stream_begin, + const vector::const_iterator& stream_end) { + const int kNumBucket = 1 << 16; + vector counter(kNumBucket, 0); + vector::const_iterator stream_begin_copy = stream_begin; + while (stream_begin != stream_end) { + int upper_part_x = *stream_begin >> 16; + ++counter[upper_part_x]; + ++stream_begin; + } + + // Look for a bucket that contains less than (1 << 16) elements. + const int kBucketCapacity = 1 << 16; + int candidate_bucket; + for (int i = 0; i < kNumBucket; ++i) { + if (counter[i] < kBucketCapacity) { + candidate_bucket = i; + break; + } + } + + // Finds all IP addresses in the stream whose first 16 bits + // are equal to candidate_bucket. + bitset candidates; + stream_begin = stream_begin_copy; + while (stream_begin != stream_end) { + int x = *stream_begin++; + if (int upper_part_x = x >> 16; candidate_bucket == upper_part_x) { + // Records the presence of 16 LSB of x. + int lower_part_x = ((1 << 16) - 1) & x; + candidates.set(lower_part_x); + } + } + + // At least one of the LSB combinations is absent, find it. + for (int i = 0; i < kBucketCapacity; ++i) { + if (candidates[i] == 0) { + return (candidate_bucket << 16) | i; + } + } + throw invalid_argument("no missing element"); +} + +int FindMissingElementWrapper(const vector& stream) { + try { + return FindMissingElement(cbegin(stream), cend(stream)); + } catch (invalid_argument&) { + throw TestFailure("Unexpected no_missing_element exception"); + } +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"stream"}; + return GenericTestMain(args, "absent_value_array.tsv", + &FindMissingElementWrapper, DefaultComparator{}, + param_names); +} diff --git a/epi_judge_cpp_solutions/adding_credits.cc b/epi_judge_cpp_solutions/adding_credits.cc new file mode 100644 index 000000000..93620fdc4 --- /dev/null +++ b/epi_judge_cpp_solutions/adding_credits.cc @@ -0,0 +1,124 @@ +#include +#include +#include +#include +#include +#include + +#include "test_framework/fmt_print.h" +#include "test_framework/generic_test.h" +#include "test_framework/test_failure.h" + +using std::map; +using std::string; +using std::unordered_map; +using std::unordered_set; + +class ClientsCreditsInfo { + public: + void Insert(const string& client_id, int c) { + Remove(client_id); + client_to_credit_.emplace(client_id, c - offset_); + credit_to_clients_[c - offset_].emplace(client_id); + } + + bool Remove(const string& client_id) { + if (auto credit_iter = client_to_credit_.find(client_id); + credit_iter != end(client_to_credit_)) { + credit_to_clients_[credit_iter->second].erase(client_id); + if (empty(credit_to_clients_[credit_iter->second])) { + credit_to_clients_.erase(credit_iter->second); + } + client_to_credit_.erase(credit_iter); + return true; + } + return false; + } + + int Lookup(const string& client_id) const { + auto credit_iter = client_to_credit_.find(client_id); + return credit_iter == cend(client_to_credit_) + ? -1 + : credit_iter->second + offset_; + } + + void AddAll(int C) { offset_ += C; } + + string Max() const { + auto iter = crbegin(credit_to_clients_); + return iter == crend(credit_to_clients_) || empty(iter->second) + ? "" + : *cbegin(iter->second); + } + friend std::ostream& operator<<(std::ostream& os, + const ClientsCreditsInfo& info) { + PrintTo(os, info.credit_to_clients_); + return os; + } + + private: + int offset_ = 0; + unordered_map client_to_credit_; + map> credit_to_clients_; +}; + +struct Operation { + std::string op; + std::string s_arg; + int i_arg; +}; + +std::ostream& operator<<(std::ostream& out, const Operation& op) { + return out << FmtStr("{}({}, {})", op.op, op.s_arg, op.i_arg); +} + +template <> +struct SerializationTraits + : UserSerTraits {}; + +void ClientsCreditsInfoTester(const std::vector& ops) { + ClientsCreditsInfo cr; + int op_idx = 0; + for (auto& op : ops) { + if (op.op == "ClientsCreditsInfo") { + continue; + } else if (op.op == "remove") { + bool result = cr.Remove(op.s_arg); + if (result != op.i_arg) { + throw TestFailure() + .WithProperty(PropertyName::STATE, cr) + .WithProperty(PropertyName::COMMAND, op) + .WithMismatchInfo(op_idx, op.i_arg, result); + } + } else if (op.op == "max") { + auto result = cr.Max(); + if (result != op.s_arg) { + throw TestFailure() + .WithProperty(PropertyName::STATE, cr) + .WithProperty(PropertyName::COMMAND, op) + .WithMismatchInfo(op_idx, op.i_arg, result); + } + } else if (op.op == "insert") { + cr.Insert(op.s_arg, op.i_arg); + } else if (op.op == "add_all") { + cr.AddAll(op.i_arg); + } else if (op.op == "lookup") { + auto result = cr.Lookup(op.s_arg); + if (result != op.i_arg) { + throw TestFailure() + .WithProperty(PropertyName::STATE, cr) + .WithProperty(PropertyName::COMMAND, op) + .WithMismatchInfo(op_idx, op.i_arg, result); + ; + } + } + op_idx++; + } +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"ops"}; + return GenericTestMain(args, "adding_credits.tsv", &ClientsCreditsInfoTester, + DefaultComparator{}, param_names); +} diff --git a/epi_judge_cpp_solutions/advance_by_offsets.cc b/epi_judge_cpp_solutions/advance_by_offsets.cc new file mode 100644 index 000000000..e1f4ede52 --- /dev/null +++ b/epi_judge_cpp_solutions/advance_by_offsets.cc @@ -0,0 +1,23 @@ +#include +#include +#include "test_framework/generic_test.h" + +using std::max; +using std::vector; + +bool CanReachEnd(const vector& max_advance_steps) { + int furthest_reach_so_far = 0, last_index = size(max_advance_steps) - 1; + for (int i = 0; + i <= furthest_reach_so_far && furthest_reach_so_far < last_index; ++i) { + furthest_reach_so_far = + max(furthest_reach_so_far, max_advance_steps[i] + i); + } + return furthest_reach_so_far >= last_index; +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"max_advance_steps"}; + return GenericTestMain(args, "advance_by_offsets.tsv", &CanReachEnd, + DefaultComparator{}, param_names); +} diff --git a/epi_judge_cpp_solutions/alternating_array.cc b/epi_judge_cpp_solutions/alternating_array.cc new file mode 100644 index 000000000..c6448245f --- /dev/null +++ b/epi_judge_cpp_solutions/alternating_array.cc @@ -0,0 +1,71 @@ +#include +#include +#include + +#include "test_framework/fmt_print.h" +#include "test_framework/generic_test.h" +#include "test_framework/test_failure.h" +#include "test_framework/timed_executor.h" + +using std::swap; +using std::vector; + +void Rearrange(vector* A_ptr) { + vector& A = *A_ptr; + for (size_t i = 1; i < size(A); ++i) { + if ((!(i % 2) && A[i - 1] < A[i]) || ((i % 2) && A[i - 1] > A[i])) { + swap(A[i - 1], A[i]); + } + } +} + +void CheckAnswer(const vector& A) { + for (int i = 0; i < A.size(); ++i) { + if (i % 2) { + if (A[i] < A[i - 1]) { + throw TestFailure() + .WithProperty(PropertyName::RESULT, A) + .WithMismatchInfo(i, FmtStr("A[{}] <= A[{}]", i - 1, i), + FmtStr("{} > {}", A[i - 1], A[i])); + } + if (i + 1 < A.size()) { + if (A[i] < A[i + 1]) { + throw TestFailure() + .WithProperty(PropertyName::RESULT, A) + .WithMismatchInfo(i, FmtStr("A[{}] >= A[{}]", i, i + 1), + FmtStr("{} < {}", A[i], A[i + 1])); + } + } + } else { + if (i > 0) { + if (A[i - 1] < A[i]) { + throw TestFailure() + .WithProperty(PropertyName::RESULT, A) + .WithMismatchInfo(i, FmtStr("A[{}] >= A[{}]", i - 1, i), + FmtStr("{} < {}", A[i - 1], A[i])); + } + } + if (i + 1 < A.size()) { + if (A[i + 1] < A[i]) { + throw TestFailure() + .WithProperty(PropertyName::RESULT, A) + .WithMismatchInfo(i, FmtStr("A[{}] <= A[{}]", i, i + 1), + FmtStr("{} > {}", A[i], A[i + 1])); + } + } + } + } +} + +void RearrangeWrapper(TimedExecutor& executor, vector A) { + executor.Run([&] { Rearrange(&A); }); + + CheckAnswer(A); +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"executor", "A"}; + return GenericTestMain(args, "alternating_array.tsv", &RearrangeWrapper, + DefaultComparator{}, param_names); +} diff --git a/epi_judge_cpp_solutions/anagrams.cc b/epi_judge_cpp_solutions/anagrams.cc new file mode 100644 index 000000000..4e25d62ca --- /dev/null +++ b/epi_judge_cpp_solutions/anagrams.cc @@ -0,0 +1,38 @@ +#include +#include +#include +#include +#include "test_framework/generic_test.h" + +using std::string; +using std::unordered_map; +using std::vector; + +vector> FindAnagrams(const vector& dictionary) { + unordered_map> sorted_string_to_anagrams; + for (const string& s : dictionary) { + // Sorts the string, uses it as a key, and then appends + // the original string as another value into hash table. + string sorted_str(s); + sort(begin(sorted_str), end(sorted_str)); + sorted_string_to_anagrams[sorted_str].emplace_back(s); + } + + vector> anagram_groups; + for (const auto & [ key, group ] : sorted_string_to_anagrams) { + if (size(group) >= 2) { // Found anagrams. + anagram_groups.emplace_back(group); + } + } + return anagram_groups; +} + +// clang-format off + + +int main(int argc, char* argv[]) { + std::vector args {argv + 1, argv + argc}; + std::vector param_names {"dictionary"}; + return GenericTestMain(args, "anagrams.tsv", &FindAnagrams, &UnorderedComparator>>, param_names); +} +// clang-format on diff --git a/epi_judge_cpp_solutions/apply_permutation.cc b/epi_judge_cpp_solutions/apply_permutation.cc new file mode 100644 index 000000000..312ffa0ad --- /dev/null +++ b/epi_judge_cpp_solutions/apply_permutation.cc @@ -0,0 +1,39 @@ +#include +#include +#include "test_framework/generic_test.h" + +using std::swap; +using std::vector; + +void ApplyPermutation(vector* perm_ptr, vector* A_ptr) { + vector&perm = *perm_ptr, &A = *A_ptr; + for (int i = 0; i < size(A); ++i) { + // Check if the element at index i has not been moved by checking if + // perm[i] is nonnegative. + int next = i; + while (perm[next] >= 0) { + swap(A[i], A[perm[next]]); + int temp = perm[next]; + // Subtracts size(perm) from an entry in perm to make it negative, + // which indicates the corresponding move has been performed. + perm[next] -= size(perm); + next = temp; + } + } + + // Restore perm. + for_each(begin(perm), end(perm), [&perm](int& x) { x += size(perm); }); +} + +vector ApplyPermutationWrapper(vector perm, vector A) { + ApplyPermutation(&perm, &A); + return A; +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"perm", "A"}; + return GenericTestMain(args, "apply_permutation.tsv", + &ApplyPermutationWrapper, DefaultComparator{}, + param_names); +} diff --git a/epi_judge_cpp_solutions/arbitrage.cc b/epi_judge_cpp_solutions/arbitrage.cc new file mode 100644 index 000000000..e8e286698 --- /dev/null +++ b/epi_judge_cpp_solutions/arbitrage.cc @@ -0,0 +1,62 @@ +#include +#include +#include +#include +#include "test_framework/generic_test.h" + +using std::numeric_limits; +using std::vector; + +bool BellmanFord(const vector>& graph, int source); + +bool IsArbitrageExist(vector> graph) { + // Transforms each edge in graph. + for_each(begin(graph), end(graph), [](vector& edge_list) { + for_each(begin(edge_list), end(edge_list), + [](double& edge) { edge = -log10(edge); }); + }); + + // Uses Bellman-Ford to find negative weight cycle. + return BellmanFord(graph, 0); +} + +bool BellmanFord(const vector>& graph, int source) { + vector dis_to_source(size(graph), numeric_limits::max()); + dis_to_source[source] = 0; + + for (int times = 1; times < size(graph); ++times) { + bool have_update = false; + for (int i = 0; i < size(graph); ++i) { + for (int j = 0; j < size(graph[i]); ++j) { + if (dis_to_source[i] != numeric_limits::max() && + dis_to_source[j] > dis_to_source[i] + graph[i][j]) { + have_update = true; + dis_to_source[j] = dis_to_source[i] + graph[i][j]; + } + } + } + + // No update in this iteration means no negative cycle. + if (have_update == false) { + return false; + } + } + + // Detects cycle if there is any further update. + for (int i = 0; i < size(graph); ++i) { + for (int j = 0; j < size(graph[i]); ++j) { + if (dis_to_source[i] != numeric_limits::max() && + dis_to_source[j] > dis_to_source[i] + graph[i][j]) { + return true; + } + } + } + return false; +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"graph"}; + return GenericTestMain(args, "arbitrage.tsv", &IsArbitrageExist, + DefaultComparator{}, param_names); +} diff --git a/epi_judge_cpp_solutions/binary_tree_node.h b/epi_judge_cpp_solutions/binary_tree_node.h new file mode 100644 index 000000000..3a28b3b21 --- /dev/null +++ b/epi_judge_cpp_solutions/binary_tree_node.h @@ -0,0 +1,20 @@ +#include +#include +#include +#include "test_framework/binary_tree_utils.h" +#include "test_framework/test_utils_serialization_traits.h" +#pragma once + +using std::unique_ptr; + +template +struct BinaryTreeNode { + T data; + unique_ptr> left, right; + explicit BinaryTreeNode(const T& data) : data(data) {} + BinaryTreeNode(T data, unique_ptr> left, + unique_ptr> right) + : data(data), left(std::move(left)), right(std::move(right)) {} +}; + +DECLARE_BINARY_TREE_TYPE(KeyT, std::unique_ptr>, false) diff --git a/epi_judge_cpp_solutions/binary_tree_with_parent_prototype.h b/epi_judge_cpp_solutions/binary_tree_with_parent_prototype.h new file mode 100644 index 000000000..be8f03060 --- /dev/null +++ b/epi_judge_cpp_solutions/binary_tree_with_parent_prototype.h @@ -0,0 +1,16 @@ +#include +#include "test_framework/binary_tree_utils.h" +#include "test_framework/test_utils_serialization_traits.h" +#pragma once + +using std::unique_ptr; + +template +struct BinaryTreeNode { + T data; + unique_ptr> left, right; + BinaryTreeNode* parent; + explicit BinaryTreeNode(const T& data) : data(data), parent(nullptr) {} +}; + +DECLARE_BINARY_TREE_TYPE(KeyT, std::unique_ptr>, true) diff --git a/epi_judge_cpp_solutions/binomial_coefficients.cc b/epi_judge_cpp_solutions/binomial_coefficients.cc new file mode 100644 index 000000000..95ff34784 --- /dev/null +++ b/epi_judge_cpp_solutions/binomial_coefficients.cc @@ -0,0 +1,52 @@ +#include +#include +#include "test_framework/generic_test.h" + +using std::make_unique; +using std::min; +using std::vector; + +int ComputeXChooseY(int, int, vector>*); + +int ComputeBinomialCoefficient(int n, int k) { + return ComputeXChooseY( + n, k, + make_unique>>(n + 1, vector(k + 1, 0)).get()); +} + +int ComputeXChooseY(int x, int y, vector>* x_choose_y_ptr) { + if (y == 0 || x == y) { + return 1; + } + + vector>& x_choose_y = *x_choose_y_ptr; + if (x_choose_y[x][y] == 0) { + int without_y = ComputeXChooseY(x - 1, y, x_choose_y_ptr); + int with_y = ComputeXChooseY(x - 1, y - 1, x_choose_y_ptr); + x_choose_y[x][y] = without_y + with_y; + } + return x_choose_y[x][y]; +} + +int ComputeBinomialCoefficientsSpaceEfficient(int n, int k) { + k = min(k, n - k); + vector table(k + 1, 0); + table[0] = 1; // C(0, 0). + // C(i, j) = C(i - 1, j) + C(i - 1, j - 1). + for (int i = 1; i <= n; ++i) { + for (int j = min(i, k); j >= 1; --j) { + table[j] = table[j] + table[j - 1]; + } + } + return table[k]; +} + +// clang-format off + + +int main(int argc, char* argv[]) { + std::vector args {argv + 1, argv + argc}; + std::vector param_names {"n", "k"}; + return GenericTestMain(args, "binomial_coefficients.tsv", &ComputeBinomialCoefficient, DefaultComparator{}, param_names); +} +// clang-format on diff --git a/epi_judge_cpp_solutions/bonus.cc b/epi_judge_cpp_solutions/bonus.cc new file mode 100644 index 000000000..8974bd363 --- /dev/null +++ b/epi_judge_cpp_solutions/bonus.cc @@ -0,0 +1,50 @@ +#include +#include +#include +#include +#include +#include "test_framework/generic_test.h" + +using std::function; +using std::max; +using std::priority_queue; +using std::vector; + +int CalculateBonus(const vector& productivity) { + struct EmployeeData { + int productivity, index; + }; + priority_queue, + function> + min_heap([](const EmployeeData& a, const EmployeeData& b) { + return a.productivity > b.productivity; + }); + for (int i = 0; i < size(productivity); ++i) { + min_heap.emplace(EmployeeData{productivity[i], i}); + } + + // Initially assigns one ticket to everyone. + vector tickets(size(productivity), 1); + // Fills tickets from lowest rating to highest rating. + while (!empty(min_heap)) { + int next_dev = min_heap.top().index; + // Handles the left neighbor. + if (next_dev > 0 && productivity[next_dev] > productivity[next_dev - 1]) { + tickets[next_dev] = tickets[next_dev - 1] + 1; + } + // Handles the right neighbor. + if (next_dev + 1 < size(tickets) && + productivity[next_dev] > productivity[next_dev + 1]) { + tickets[next_dev] = max(tickets[next_dev], tickets[next_dev + 1] + 1); + } + min_heap.pop(); + } + return accumulate(begin(tickets), end(tickets), 0); +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"productivity"}; + return GenericTestMain(args, "bonus.tsv", &CalculateBonus, + DefaultComparator{}, param_names); +} diff --git a/epi_judge_cpp_solutions/bst_from_preorder.cc b/epi_judge_cpp_solutions/bst_from_preorder.cc new file mode 100644 index 000000000..1aac5efdf --- /dev/null +++ b/epi_judge_cpp_solutions/bst_from_preorder.cc @@ -0,0 +1,44 @@ +#include +#include + +#include "bst_node.h" +#include "test_framework/generic_test.h" + +using std::find_if_not; +using std::make_unique; +using std::unique_ptr; +using std::vector; + +unique_ptr> RebuildBSTFromPreorderHelper(const vector&, int, + int); + +unique_ptr> RebuildBSTFromPreorder( + const vector& preorder_sequence) { + return RebuildBSTFromPreorderHelper(preorder_sequence, 0, + size(preorder_sequence)); +} + +// Builds a BST from preorder_sequence[start, end - 1]. +unique_ptr> RebuildBSTFromPreorderHelper( + const vector& preorder_sequence, int start, int end) { + if (start >= end) { + return nullptr; + } + + int transition_point = distance( + cbegin(preorder_sequence), + find_if_not(cbegin(preorder_sequence) + start, cend(preorder_sequence), + [&](int a) { return a <= preorder_sequence[start]; })); + return make_unique>(BstNode{ + preorder_sequence[start], + RebuildBSTFromPreorderHelper(preorder_sequence, start + 1, + transition_point), + RebuildBSTFromPreorderHelper(preorder_sequence, transition_point, end)}); +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"preorder_sequence"}; + return GenericTestMain(args, "bst_from_preorder.tsv", &RebuildBSTFromPreorder, + DefaultComparator{}, param_names); +} diff --git a/epi_judge_cpp_solutions/bst_from_sorted_array.cc b/epi_judge_cpp_solutions/bst_from_sorted_array.cc new file mode 100644 index 000000000..c5a07533d --- /dev/null +++ b/epi_judge_cpp_solutions/bst_from_sorted_array.cc @@ -0,0 +1,53 @@ +#include +#include + +#include "bst_node.h" +#include "test_framework/binary_tree_utils.h" +#include "test_framework/generic_test.h" +#include "test_framework/test_failure.h" +#include "test_framework/timed_executor.h" + +using std::make_unique; +using std::unique_ptr; +using std::vector; + +unique_ptr> BuildMinHeightBSTFromSortedSubarray(const vector&, + int, int); + +unique_ptr> BuildMinHeightBSTFromSortedArray( + const vector& A) { + return BuildMinHeightBSTFromSortedSubarray(A, 0, size(A)); +} + +// Build a min-height BST over the entries in A[start, end - 1]. +unique_ptr> BuildMinHeightBSTFromSortedSubarray( + const vector& A, int start, int end) { + if (start >= end) { + return nullptr; + } + int mid = start + ((end - start) / 2); + return make_unique>( + BstNode{A[mid], BuildMinHeightBSTFromSortedSubarray(A, start, mid), + BuildMinHeightBSTFromSortedSubarray(A, mid + 1, end)}); +} + +int BuildMinHeightBSTFromSortedArrayWrapper(TimedExecutor& executor, + const vector& A) { + unique_ptr> result = + executor.Run([&] { return BuildMinHeightBSTFromSortedArray(A); }); + + if (GenerateInorder(result) != A) { + throw TestFailure("Result binary tree mismatches input array"); + } + return BinaryTreeHeight(result); +} + +// clang-format off + + +int main(int argc, char* argv[]) { + std::vector args {argv + 1, argv + argc}; + std::vector param_names {"executor", "A"}; + return GenericTestMain(args, "bst_from_sorted_array.tsv", &BuildMinHeightBSTFromSortedArrayWrapper, DefaultComparator{}, param_names); +} +// clang-format on diff --git a/epi_judge_cpp_solutions/bst_merge.cc b/epi_judge_cpp_solutions/bst_merge.cc new file mode 100644 index 000000000..eaab670c5 --- /dev/null +++ b/epi_judge_cpp_solutions/bst_merge.cc @@ -0,0 +1,129 @@ +#include + +#include "bst_prototype_shared_ptr.h" +#include "test_framework/generic_test.h" + +using std::shared_ptr; + +shared_ptr> BSTToDoublyListHelper(const shared_ptr>&); + +shared_ptr> MergeTwoSortedLists(shared_ptr>, + shared_ptr>); + +void AppendNode(shared_ptr>*, shared_ptr>*); + +// Build a BST from the (s + 1)-th to the e-th node in L. +shared_ptr> BuildBSTFromSortedDoublyListHelper( + shared_ptr>* L, int s, int e) { + shared_ptr> curr = nullptr; + if (s < e) { + int m = s + ((e - s) / 2); + auto temp = BuildBSTFromSortedDoublyListHelper(L, s, m); + curr = *L; + curr->left = temp; + *L = (*L)->right; + curr->right = BuildBSTFromSortedDoublyListHelper(L, m + 1, e); + } + return curr; +} + +shared_ptr> BuildBSTFromSortedDoublyList( + shared_ptr> L, int n) { + return BuildBSTFromSortedDoublyListHelper(&L, 0, n); +} + +shared_ptr> BSTToDoublyList(const shared_ptr>& n) { + auto result = BSTToDoublyListHelper(n); + result->left->right = nullptr; // breaks the link from tail to head. + result->left = nullptr; // breaks the link from head to tail. + return result; +} + +// Transform a BST into a circular sorted doubly linked list in-place, +// return the head of the list. +shared_ptr> BSTToDoublyListHelper( + const shared_ptr>& n) { + // Empty subtree. + if (!n) { + return nullptr; + } + + // Recursively build the list from left and right subtrees. + auto l_head(BSTToDoublyListHelper(n->left)), + r_head(BSTToDoublyListHelper(n->right)); + + // Append n to the list from left subtree. + shared_ptr> l_tail = nullptr; + if (l_head) { + l_tail = l_head->left; + l_tail->right = n; + n->left = l_tail; + l_tail = n; + } else { + l_head = l_tail = n; + } + + // Append the list from right subtree to n. + shared_ptr> r_tail = nullptr; + if (r_head) { + r_tail = r_head->left; + l_tail->right = r_head; + r_head->left = l_tail; + } else { + r_tail = l_tail; + } + r_tail->right = l_head, l_head->left = r_tail; + + return l_head; +} + +// Count the list length till end. +int CountLength(shared_ptr> L) { + int length = 0; + while (L) { + ++length, L = L->right; + } + return length; +} + +shared_ptr> MergeTwoBSTs(shared_ptr> A, + shared_ptr> B) { + A = BSTToDoublyList(A), B = BSTToDoublyList(B); + int A_length = CountLength(A), B_length = CountLength(B); + return BuildBSTFromSortedDoublyList(MergeTwoSortedLists(A, B), + A_length + B_length); +} + +// Merges two sorted doubly linked lists, returns the head of merged list. +shared_ptr> MergeTwoSortedLists(shared_ptr> A, + shared_ptr> B) { + shared_ptr> sorted_head(new BstNode(0)); + shared_ptr> tail = sorted_head; + + while (A && B) { + AppendNode(A->data < B->data ? &A : &B, &tail); + } + + if (A) { + // Appends the remaining of A. + AppendNode(&A, &tail); + } else if (B) { + // Appends the remaining of B. + AppendNode(&B, &tail); + } + return sorted_head->right; +} + +void AppendNode(shared_ptr>* node, + shared_ptr>* tail) { + (*tail)->right = *node; + *tail = *node; // Resets tail to the last node. + *node = (*node)->right; +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"A", "B"}; + return GenericTestMain(args, "bst_merge.tsv", &MergeTwoBSTs, + DefaultComparator{}, param_names); +} diff --git a/epi_judge_cpp_solutions/bst_node.h b/epi_judge_cpp_solutions/bst_node.h new file mode 100644 index 000000000..6a1991b55 --- /dev/null +++ b/epi_judge_cpp_solutions/bst_node.h @@ -0,0 +1,18 @@ +#include +#include "test_framework/binary_tree_utils.h" +#include "test_framework/test_utils_serialization_traits.h" +#pragma once + +using std::unique_ptr; + +template +struct BstNode { + T data; + unique_ptr> left, right; + explicit BstNode(const T& data) : data(data) {} + + BstNode(T data, unique_ptr> left, unique_ptr> right) + : data(data), left(std::move(left)), right(std::move(right)) {} +}; + +DECLARE_BINARY_TREE_TYPE(KeyT, std::unique_ptr>, false) diff --git a/epi_judge_cpp_solutions/bst_prototype_shared_ptr.h b/epi_judge_cpp_solutions/bst_prototype_shared_ptr.h new file mode 100644 index 000000000..3a78dcb8f --- /dev/null +++ b/epi_judge_cpp_solutions/bst_prototype_shared_ptr.h @@ -0,0 +1,15 @@ +#include +#include "test_framework/binary_tree_utils.h" +#include "test_framework/test_utils_serialization_traits.h" +#pragma once + +using std::shared_ptr; + +template +struct BstNode { + T data; + shared_ptr> left, right; + explicit BstNode(const T& data) : data(data) {} +}; + +DECLARE_BINARY_TREE_TYPE(KeyT, std::shared_ptr>, false) diff --git a/epi_judge_cpp_solutions/bst_to_sorted_list.cc b/epi_judge_cpp_solutions/bst_to_sorted_list.cc new file mode 100644 index 000000000..a77260e03 --- /dev/null +++ b/epi_judge_cpp_solutions/bst_to_sorted_list.cc @@ -0,0 +1,77 @@ +#include +#include + +#include "bst_prototype_shared_ptr.h" +#include "test_framework/generic_test.h" +#include "test_framework/test_failure.h" +#include "test_framework/timed_executor.h" + +using std::shared_ptr; + +struct HeadAndTail; +HeadAndTail BSTToDoublyLinkedListHelper(const shared_ptr>&); + +struct HeadAndTail { + shared_ptr> head, tail; +}; + +shared_ptr> BSTToDoublyLinkedList( + const shared_ptr>& tree) { + return BSTToDoublyLinkedListHelper(tree).head; +} + +// Transforms a BST into a sorted doubly linked list in-place, +// and return the head and tail of the list. +HeadAndTail BSTToDoublyLinkedListHelper(const shared_ptr>& tree) { + // Empty subtree. + if (!tree) { + return {nullptr, nullptr}; + } + + // Recursively builds the list from left and right subtrees. + HeadAndTail left = BSTToDoublyLinkedListHelper(tree->left); + HeadAndTail right = BSTToDoublyLinkedListHelper(tree->right); + + // Appends tree to the list from left subtree. + if (left.tail) { + left.tail->right = tree; + } + tree->left = left.tail; + + // Appends the list from right subtree to tree. + tree->right = right.head; + if (right.head) { + right.head->left = tree; + } + + return {left.head ? left.head : tree, right.tail ? right.tail : tree}; +} + +std::vector BSTToDoublyLinkedListWrapper( + TimedExecutor& executor, const std::shared_ptr>& tree) { + auto list = executor.Run([&] { return BSTToDoublyLinkedList(tree); }); + + if (list->left) { + throw TestFailure( + "Function must return the head of the list. Left link must be null"); + } + std::vector v; + while (list) { + v.push_back(list->data); + if (list->right && list->right->left != list) { + throw TestFailure("List is ill-formed"); + } + list = list->right; + } + return v; +} + +// clang-format off + + +int main(int argc, char* argv[]) { + std::vector args {argv + 1, argv + argc}; + std::vector param_names {"executor", "tree"}; + return GenericTestMain(args, "bst_to_sorted_list.tsv", &BSTToDoublyLinkedListWrapper, DefaultComparator{}, param_names); +} +// clang-format on diff --git a/epi_judge_cpp_solutions/buy_and_sell_stock.cc b/epi_judge_cpp_solutions/buy_and_sell_stock.cc new file mode 100644 index 000000000..74a020888 --- /dev/null +++ b/epi_judge_cpp_solutions/buy_and_sell_stock.cc @@ -0,0 +1,26 @@ +#include +#include +#include +#include "test_framework/generic_test.h" + +using std::max; +using std::min; +using std::numeric_limits; +using std::vector; + +double BuyAndSellStockOnce(const vector& prices) { + double min_price_so_far = numeric_limits::max(), max_profit = 0; + for (double price : prices) { + double max_profit_sell_today = price - min_price_so_far; + max_profit = max(max_profit, max_profit_sell_today); + min_price_so_far = min(min_price_so_far, price); + } + return max_profit; +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"prices"}; + return GenericTestMain(args, "buy_and_sell_stock.tsv", &BuyAndSellStockOnce, + DefaultComparator{}, param_names); +} diff --git a/epi_judge_cpp_solutions/buy_and_sell_stock_k_times.cc b/epi_judge_cpp_solutions/buy_and_sell_stock_k_times.cc new file mode 100644 index 000000000..f32b7531b --- /dev/null +++ b/epi_judge_cpp_solutions/buy_and_sell_stock_k_times.cc @@ -0,0 +1,45 @@ +#include +#include +#include +#include "test_framework/generic_test.h" + +using std::max; +using std::min; +using std::numeric_limits; +using std::vector; + +double UnlimitedPairsProfits(const vector &); + +double BuyAndSellStockKTimes(const vector &prices, int k) { + if (!k) { + return 0.0; + } else if (2 * k >= size(prices)) { + return UnlimitedPairsProfits(prices); + } + vector min_prices(k, numeric_limits::max()), + max_profits(k, 0.0); + for (double price : prices) { + for (int i = k - 1; i >= 0; --i) { + max_profits[i] = max(max_profits[i], price - min_prices[i]); + min_prices[i] = + min(min_prices[i], price - (i ? max_profits[i - 1] : 0.0)); + } + } + return max_profits.back(); +} + +double UnlimitedPairsProfits(const vector &prices) { + double profit = 0.0; + for (int i = 1; i < size(prices); ++i) { + profit += max(0.0, prices[i] - prices[i - 1]); + } + return profit; +} + +int main(int argc, char *argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"prices", "k"}; + return GenericTestMain(args, "buy_and_sell_stock_k_times.tsv", + &BuyAndSellStockKTimes, DefaultComparator{}, + param_names); +} diff --git a/epi_judge_cpp_solutions/buy_and_sell_stock_twice.cc b/epi_judge_cpp_solutions/buy_and_sell_stock_twice.cc new file mode 100644 index 000000000..b43390b33 --- /dev/null +++ b/epi_judge_cpp_solutions/buy_and_sell_stock_twice.cc @@ -0,0 +1,59 @@ +#include +#include +#include +#include +#include +#include "test_framework/generic_test.h" + +using std::array; +using std::max; +using std::min; +using std::numeric_limits; +using std::size; +using std::vector; + +double BuyAndSellStockTwice(const vector& prices) { + double max_total_profit = 0; + vector first_buy_sell_profits(size(prices), 0); + double min_price_so_far = numeric_limits::max(); + + // Forward phase. For each day, we record maximum profit if we + // sell on that day. + for (int i = 0; i < size(prices); ++i) { + min_price_so_far = min(min_price_so_far, prices[i]); + max_total_profit = max(max_total_profit, prices[i] - min_price_so_far); + first_buy_sell_profits[i] = max_total_profit; + } + + // Backward phase. For each day, find the maximum profit if we make + // the second buy on that day. + double max_price_so_far = numeric_limits::min(); + for (int i = size(prices) - 1; i > 0; --i) { + max_price_so_far = max(max_price_so_far, prices[i]); + max_total_profit = max(max_total_profit, max_price_so_far - prices[i] + + first_buy_sell_profits[i - 1]); + } + return max_total_profit; +} + +double BuyAndSellStockTwiceConstantSpace(const vector& prices) { + array min_prices = {numeric_limits::max(), + numeric_limits::max()}, + max_profits = {0.0, 0.0}; + for (double price : prices) { + for (int i = 1; i >= 0; --i) { + max_profits[i] = max(max_profits[i], price - min_prices[i]); + min_prices[i] = + min(min_prices[i], price - (i - 1 >= 0 ? max_profits[i - 1] : 0.0)); + } + } + return max_profits[1]; +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"prices"}; + return GenericTestMain(args, "buy_and_sell_stock_twice.tsv", + &BuyAndSellStockTwice, DefaultComparator{}, + param_names); +} diff --git a/epi_judge_cpp_solutions/calendar_rendering.cc b/epi_judge_cpp_solutions/calendar_rendering.cc new file mode 100644 index 000000000..99bd41b26 --- /dev/null +++ b/epi_judge_cpp_solutions/calendar_rendering.cc @@ -0,0 +1,58 @@ +#include +#include +#include + +#include "test_framework/generic_test.h" +#include "test_framework/test_utils_serialization_traits.h" + +using std::max; +using std::vector; + +struct Event { + int start, finish; +}; + +struct Endpoint { + int time; + bool is_start; +}; + +int FindMaxSimultaneousEvents(const vector& A) { + // Builds an array of all endpoints. + vector E; + for (const Event& event : A) { + E.emplace_back(Endpoint{event.start, true}); + E.emplace_back(Endpoint{event.finish, false}); + } + // Sorts the endpoint array according to the time, breaking ties + // by putting start times before end times. + sort(begin(E), end(E), [](const Endpoint& a, const Endpoint& b) { + // If times are equal, an endpoint that starts an interval comes first. + return a.time != b.time ? a.time < b.time : (a.is_start && !b.is_start); + }); + + // Track the number of simultaneous events, and record the maximum + // number of simultaneous events. + int max_num_simultaneous_events = 0, num_simultaneous_events = 0; + for (const Endpoint& endpoint : E) { + if (endpoint.is_start) { + ++num_simultaneous_events; + max_num_simultaneous_events = + max(num_simultaneous_events, max_num_simultaneous_events); + } else { + --num_simultaneous_events; + } + } + return max_num_simultaneous_events; +} + +template <> +struct SerializationTraits : UserSerTraits {}; + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"A"}; + return GenericTestMain(args, "calendar_rendering.tsv", + &FindMaxSimultaneousEvents, DefaultComparator{}, + param_names); +} diff --git a/epi_judge_cpp_solutions/circular_queue.cc b/epi_judge_cpp_solutions/circular_queue.cc new file mode 100644 index 000000000..a955eb20d --- /dev/null +++ b/epi_judge_cpp_solutions/circular_queue.cc @@ -0,0 +1,111 @@ +#include +#include +#include +#include + +#include "test_framework/generic_test.h" +#include "test_framework/test_failure.h" +#include "test_framework/test_utils_serialization_traits.h" + +using std::length_error; +using std::rotate; +using std::vector; + +class Queue { + public: + Queue(size_t capacity) {} + explicit Queue(int capacity) : entries_(capacity) {} + + void Enqueue(int x) { + if (num_queue_elements == size(entries_)) { // Needs to resize. + // Makes the queue elements appear consecutively. + rotate(begin(entries_), begin(entries_) + head_, end(entries_)); + head_ = 0, tail_ = num_queue_elements; // Resets head and tail. + entries_.resize(size(entries_) * kScaleFactor); + } + + entries_[tail_] = x; + tail_ = (tail_ + 1) % size(entries_), ++num_queue_elements; + } + + int Dequeue() { + if (!num_queue_elements) { + throw length_error("empty queue"); + } + --num_queue_elements; + int result = entries_[head_]; + head_ = (head_ + 1) % size(entries_); + return result; + } + + int Size() const { return num_queue_elements; } + + private: + const int kScaleFactor = 2; + int head_ = 0, tail_ = 0, num_queue_elements = 0; + vector entries_; +}; + +struct QueueOp { + enum { kConstruct, kDequeue, kEnqueue, kSize } op; + int argument; + + QueueOp(const std::string& op_string, int arg) : argument(arg) { + if (op_string == "Queue") { + op = kConstruct; + } else if (op_string == "dequeue") { + op = kDequeue; + } else if (op_string == "enqueue") { + op = kEnqueue; + } else if (op_string == "size") { + op = kSize; + } else { + throw std::runtime_error("Unsupported queue operation: " + op_string); + } + } + + void execute(Queue& q) const { + switch (op) { + case kConstruct: + // Hack to bypass deleted assign operator + q.~Queue(); + new (&q) Queue(argument); + break; + case kDequeue: { + int result = q.Dequeue(); + if (result != argument) { + throw TestFailure("Dequeue: expected " + std::to_string(argument) + + ", got " + std::to_string(result)); + } + } break; + case kEnqueue: + q.Enqueue(argument); + break; + case kSize: { + int s = q.Size(); + if (s != argument) { + throw TestFailure("Size: expected " + std::to_string(argument) + + ", got " + std::to_string(s)); + } + } break; + } + } +}; + +template <> +struct SerializationTraits : UserSerTraits { +}; + +void QueueTester(const std::vector& ops) { + Queue q(0); + for (auto& op : ops) { + op.execute(q); + } +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"ops"}; + return GenericTestMain(args, "circular_queue.tsv", &QueueTester, + DefaultComparator{}, param_names); +} diff --git a/epi_judge_cpp_solutions/closest_int_same_weight.cc b/epi_judge_cpp_solutions/closest_int_same_weight.cc new file mode 100644 index 000000000..19e617c4c --- /dev/null +++ b/epi_judge_cpp_solutions/closest_int_same_weight.cc @@ -0,0 +1,25 @@ +#include +#include "test_framework/generic_test.h" + +using std::invalid_argument; + +unsigned long long ClosestIntSameBitCount(unsigned long long x) { + const static int kNumUnsignedBits = 64; + for (int i = 0; i < kNumUnsignedBits - 1; ++i) { + if (((x >> i) & 1) != ((x >> (i + 1)) & 1)) { + x ^= (1UL << i) | (1UL << (i + 1)); // Swaps bit-i and bit-(i + 1). + return x; + } + } + + // Throw error if all bits of x are 0 or 1. + throw invalid_argument("All bits are 0 or 1"); +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"x"}; + return GenericTestMain(args, "closest_int_same_weight.tsv", + &ClosestIntSameBitCount, DefaultComparator{}, + param_names); +} diff --git a/epi_judge_cpp_solutions/collatz_checker.cc b/epi_judge_cpp_solutions/collatz_checker.cc new file mode 100644 index 000000000..498c18c3f --- /dev/null +++ b/epi_judge_cpp_solutions/collatz_checker.cc @@ -0,0 +1,50 @@ +#include +#include +#include +#include +#include "test_framework/generic_test.h" + +using std::overflow_error; +using std::to_string; +using std::unordered_set; +using std::vector; + +bool TestCollatzConjecture(int n) { + // Stores odd numbers already tested to converge to 1. + unordered_set verified_numbers; + + // Starts from 3, since hypothesis holds trivially for 1 and 2. + for (int i = 3; i <= n; i += 2) { + unordered_set sequence; + long long test_i = i; + while (test_i >= i) { + if (!sequence.emplace(test_i).second) { + // We previously encountered test_i, so the Collatz sequence + // has fallen into a loop. This disproves the hypothesis, so + // we short-circuit, returning false. + return false; + } + + if (test_i % 2) { // Odd number. + if (!verified_numbers.emplace(test_i).second) { + break; // test_i has already been verified to converge to 1. + } + long long next_test_i = 3 * test_i + 1; // Multiply by 3 and add 1. + if (next_test_i <= test_i) { + throw overflow_error("Collatz sequence overflow for " + to_string(i)); + } + test_i = next_test_i; + } else { + test_i /= 2; // Even number, halve it. + } + } + } + return true; +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"n"}; + return GenericTestMain(args, "collatz_checker.tsv", &TestCollatzConjecture, + DefaultComparator{}, param_names); +} diff --git a/epi_judge_cpp_solutions/combinations.cc b/epi_judge_cpp_solutions/combinations.cc new file mode 100644 index 000000000..994f808e2 --- /dev/null +++ b/epi_judge_cpp_solutions/combinations.cc @@ -0,0 +1,42 @@ +#include +#include +#include "test_framework/generic_test.h" + +using std::make_unique; +using std::vector; + +void DirectedCombinations(int, int, int, vector*, vector>*); + +vector> Combinations(int n, int k) { + vector> result; + DirectedCombinations(n, k, 1, make_unique>().get(), &result); + return result; +} + +void DirectedCombinations(int n, int k, int offset, + vector* partial_combination, + vector>* result) { + if (size(*partial_combination) == k) { + result->emplace_back(*partial_combination); + return; + } + + // Generate remaining combinations over {offset, ..., n - 1} of size + // num_remaining. + const int num_remaining = k - size(*partial_combination); + for (int i = offset; i <= n && num_remaining <= n - i + 1; ++i) { + partial_combination->emplace_back(i); + DirectedCombinations(n, k, i + 1, partial_combination, result); + partial_combination->pop_back(); + } +} + +// clang-format off + + +int main(int argc, char* argv[]) { + std::vector args {argv + 1, argv + argc}; + std::vector param_names {"n", "k"}; + return GenericTestMain(args, "combinations.tsv", &Combinations, &UnorderedComparator>>, param_names); +} +// clang-format on diff --git a/epi_judge_cpp_solutions/convert_base.cc b/epi_judge_cpp_solutions/convert_base.cc new file mode 100644 index 000000000..5f860d499 --- /dev/null +++ b/epi_judge_cpp_solutions/convert_base.cc @@ -0,0 +1,34 @@ +#include +#include +#include "test_framework/generic_test.h" + +using std::accumulate; +using std::string; + +string ConstructFromBase(int, int); + +string ConvertBase(const string& num_as_string, int b1, int b2) { + bool is_negative = num_as_string.front() == '-'; + int num_as_int = + accumulate(begin(num_as_string) + is_negative, end(num_as_string), 0, + [b1](int x, char c) { + return x * b1 + (isdigit(c) ? c - '0' : c - 'A' + 10); + }); + return (is_negative ? "-" : "") + + (num_as_int == 0 ? "0" : ConstructFromBase(num_as_int, b2)); +} + +string ConstructFromBase(int num_as_int, int base) { + return num_as_int == 0 + ? "" + : ConstructFromBase(num_as_int / base, base) + + (char)(num_as_int % base >= 10 ? 'A' + num_as_int % base - 10 + : '0' + num_as_int % base); +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"num_as_string", "b1", "b2"}; + return GenericTestMain(args, "convert_base.tsv", &ConvertBase, + DefaultComparator{}, param_names); +} diff --git a/epi_judge_cpp_solutions/copy_posting_list.cc b/epi_judge_cpp_solutions/copy_posting_list.cc new file mode 100644 index 000000000..bf5062c34 --- /dev/null +++ b/epi_judge_cpp_solutions/copy_posting_list.cc @@ -0,0 +1,133 @@ +#include +#include +#include + +#include "posting_list_node.h" +#include "test_framework/generic_test.h" +#include "test_framework/test_failure.h" +#include "test_framework/test_utils_serialization_traits.h" +#include "test_framework/timed_executor.h" + +using std::make_shared; +using std::shared_ptr; + +shared_ptr CopyPostingsList( + const shared_ptr& l) { + if (l == nullptr) { + return nullptr; + } + + // Stage 1: Makes a copy of the original list without assigning the jump + // field, and creates the mapping for each node in the original + // list to the copied list. + auto iter = l; + while (iter) { + auto new_node = make_shared( + PostingListNode{iter->order, iter->next, nullptr}); + iter->next = new_node; + iter = new_node->next; + } + + // Stage 2: Assigns the jump field in the copied list. + iter = l; + while (iter) { + if (iter->jump) { + iter->next->jump = iter->jump->next.get(); + } + iter = iter->next->next; + } + + // Stage 3: Reverts the original list, and assigns the next field of + // the copied list. + iter = l; + auto new_list_head = iter->next; + while (iter->next) { + auto temp = iter->next; + iter->next = temp->next; + iter = temp; + } + return new_list_head; +} + +using PostingListPtr = std::shared_ptr; + +struct SerializedNode { + int order; + int jump_index; +}; + +template <> +struct SerializationTraits + : UserSerTraits {}; + +PostingListPtr CreatePostingList( + const std::vector& serialized) { + std::map key_mapping; + PostingListPtr head; + for (auto it = rbegin(serialized); it != rend(serialized); ++it) { + head = make_shared(it->order, head, nullptr); + key_mapping[it->order] = head; + } + auto list_it = head; + for (auto it = begin(serialized); it != end(serialized); + ++it, list_it = list_it->next) { + if (it->jump_index != -1) { + list_it->jump = key_mapping[it->jump_index].get(); + if (!list_it->jump) throw std::runtime_error("Jump index out of range"); + } + } + + return head; +} + +void AssertListsEqual(const PostingListPtr& orig, const PostingListPtr& copy) { + std::map node_mapping; + auto o_it = orig; + auto c_it = copy; + while (o_it) { + if (!c_it) { + throw TestFailure("Copied list has fewer nodes than the original"); + } + if (o_it->order != c_it->order) { + throw TestFailure("Order value mismatch"); + } + node_mapping[o_it.get()] = c_it.get(); + o_it = o_it->next; + c_it = c_it->next; + } + + if (c_it) { + throw TestFailure("Copied list has more nodes than the original"); + } + + o_it = orig; + c_it = copy; + while (o_it) { + if (node_mapping.count(c_it.get())) { + throw TestFailure("Copied list contains a node from the original list"); + } + if (node_mapping[o_it->jump] != c_it->jump) { + throw TestFailure( + "Jump link points to a different nodes in the copied list"); + } + o_it = o_it->next; + c_it = c_it->next; + } +} + +void CopyPostingsListWrapper(TimedExecutor& executor, + const std::vector& l) { + auto head = CreatePostingList(l); + + auto copy = executor.Run([&] { return CopyPostingsList(head); }); + + AssertListsEqual(head, copy); +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"executor", "l"}; + return GenericTestMain(args, "copy_posting_list.tsv", + &CopyPostingsListWrapper, DefaultComparator{}, + param_names); +} diff --git a/epi_judge_cpp_solutions/count_bits.cc b/epi_judge_cpp_solutions/count_bits.cc new file mode 100644 index 000000000..e616d1930 --- /dev/null +++ b/epi_judge_cpp_solutions/count_bits.cc @@ -0,0 +1,16 @@ +#include "test_framework/generic_test.h" +short CountBits(unsigned int x) { + short num_bits = 0; + while (x) { + num_bits += x & 1; + x >>= 1; + } + return num_bits; +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"x"}; + return GenericTestMain(args, "count_bits.tsv", &CountBits, + DefaultComparator{}, param_names); +} diff --git a/epi_judge_cpp_solutions/count_inversions.cc b/epi_judge_cpp_solutions/count_inversions.cc new file mode 100644 index 000000000..36837b254 --- /dev/null +++ b/epi_judge_cpp_solutions/count_inversions.cc @@ -0,0 +1,57 @@ +#include +#include +#include "test_framework/generic_test.h" + +using std::vector; + +int CountSubarrayInversions(int, int, vector*); +int MergeSortAndCountInversionsAcrossSubarrays(int, int, int, vector*); + +int CountInversions(vector A) { + return CountSubarrayInversions(0, size(A), &A); +} + +// Return the number of inversions in (*A_ptr)[start, finish - 1]. +int CountSubarrayInversions(int start, int finish, vector* A_ptr) { + if (finish - start <= 1) { + return 0; + } + + int mid = start + ((finish - start) / 2); + return CountSubarrayInversions(start, mid, A_ptr) + + CountSubarrayInversions(mid, finish, A_ptr) + + MergeSortAndCountInversionsAcrossSubarrays(start, mid, finish, A_ptr); +} + +// Merge two sorted subarrays A[start, mid - 1] and A[mid, finish - 1] into +// A[start, finish - 1] and return the number of inversions across A[start, +// mid - 1] and A[mid, finish - 1]. +int MergeSortAndCountInversionsAcrossSubarrays(int start, int mid, int finish, + vector* A_ptr) { + vector sorted_A; + int left_start = start, right_start = mid, inversion_count = 0; + + vector& A = *A_ptr; + while (left_start < mid && right_start < finish) { + if (A[left_start] <= A[right_start]) { + sorted_A.emplace_back(A[left_start++]); + } else { + // A[left_start, mid - 1] are the inversions of A[right_start]. + inversion_count += mid - left_start; + sorted_A.emplace_back(A[right_start++]); + } + } + copy(begin(A) + left_start, begin(A) + mid, back_inserter(sorted_A)); + copy(begin(A) + right_start, begin(A) + finish, back_inserter(sorted_A)); + + // Updates A with sorted_A. + copy(begin(sorted_A), end(sorted_A), begin(A) + start); + return inversion_count; +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"A"}; + return GenericTestMain(args, "count_inversions.tsv", &CountInversions, + DefaultComparator{}, param_names); +} diff --git a/epi_judge_cpp_solutions/deadlock_detection.cc b/epi_judge_cpp_solutions/deadlock_detection.cc new file mode 100644 index 000000000..069c60bf9 --- /dev/null +++ b/epi_judge_cpp_solutions/deadlock_detection.cc @@ -0,0 +1,76 @@ +#include +#include + +#include "test_framework/generic_test.h" +#include "test_framework/test_utils_serialization_traits.h" +#include "test_framework/timed_executor.h" + +using std::vector; + +struct GraphVertex; +bool HasCycle(GraphVertex*); + +struct GraphVertex { + enum Color { kWhite, kGray, kBlack } color = kWhite; + vector edges; +}; + +bool IsDeadlocked(vector* graph) { + return any_of(begin(*graph), end(*graph), [](GraphVertex& vertex) { + return vertex.color == GraphVertex::kWhite && HasCycle(&vertex); + }); +} + +bool HasCycle(GraphVertex* cur) { + // Visiting a gray vertex means a cycle. + if (cur->color == GraphVertex::kGray) { + return true; + } + + cur->color = GraphVertex::kGray; // Marks current vertex as a gray one. + // Traverse the neighbor vertices. + for (GraphVertex*& next : cur->edges) { + if (next->color != GraphVertex::kBlack && HasCycle(next)) { + return true; + } + } + cur->color = GraphVertex::kBlack; // Marks current vertex as black. + return false; +} + +struct Edge { + int from; + int to; +}; + +template <> +struct SerializationTraits : UserSerTraits {}; + +bool HasCycleWrapper(TimedExecutor& executor, int num_nodes, + const vector& edges) { + vector graph; + if (num_nodes <= 0) { + throw std::runtime_error("Invalid num_nodes value"); + } + graph.reserve(num_nodes); + + for (int i = 0; i < num_nodes; i++) { + graph.push_back(GraphVertex{}); + } + + for (const Edge& e : edges) { + if (e.from < 0 || e.from >= num_nodes || e.to < 0 || e.to >= num_nodes) { + throw std::runtime_error("Invalid vertex index"); + } + graph[e.from].edges.push_back(&graph[e.to]); + } + + return executor.Run([&] { return IsDeadlocked(&graph); }); +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"executor", "num_nodes", "edges"}; + return GenericTestMain(args, "deadlock_detection.tsv", &HasCycleWrapper, + DefaultComparator{}, param_names); +} diff --git a/epi_judge_cpp_solutions/defective_jugs.cc b/epi_judge_cpp_solutions/defective_jugs.cc new file mode 100644 index 000000000..a95144b3e --- /dev/null +++ b/epi_judge_cpp_solutions/defective_jugs.cc @@ -0,0 +1,74 @@ +#include +#include +#include +#include + +#include "test_framework/generic_test.h" +#include "test_framework/test_utils_serialization_traits.h" + +using std::make_unique; +using std::unordered_set; +using std::vector; + +struct Jug; + +struct VolumeRange; +struct HashVolumeRange; + +bool CheckFeasibleHelper(const vector&, int, int, + unordered_set*); + +struct Jug { + int low, high; +}; + +struct VolumeRange { + int low, high; + + bool operator==(const VolumeRange& that) const { + return low == that.low && high == that.high; + } +}; + +struct HashVolumeRange { + size_t operator()(const VolumeRange& p) const { + return static_cast(31) * p.low + p.high; + } +}; + +bool CheckFeasible(const vector& jugs, int L, int H) { + return CheckFeasibleHelper( + jugs, L, H, + make_unique>().get()); +} + +bool CheckFeasibleHelper(const vector& jugs, int L, int H, + unordered_set* c) { + if (L > H || c->find({L, H}) != cend(*c) || (L < 0 && H < 0)) { + return false; + } + + // Checks the volume for each jug to see if it is possible. + if (any_of(begin(jugs), end(jugs), [&](const Jug& j) { + return (L <= j.low && j.high <= H) || + CheckFeasibleHelper(jugs, L - j.low, H - j.high, c); + })) { + return true; + } + c->emplace(VolumeRange{L, H}); // Marks this as impossible. + return false; +} + +template <> +struct SerializationTraits : UserSerTraits {}; + +bool operator==(const Jug& lhs, const Jug& rhs) { + return lhs.low == rhs.low && lhs.high == rhs.high; +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"jugs", "L", "H"}; + return GenericTestMain(args, "defective_jugs.tsv", &CheckFeasible, + DefaultComparator{}, param_names); +} diff --git a/epi_judge_cpp_solutions/delete_from_list.cc b/epi_judge_cpp_solutions/delete_from_list.cc new file mode 100644 index 000000000..9fb882116 --- /dev/null +++ b/epi_judge_cpp_solutions/delete_from_list.cc @@ -0,0 +1,34 @@ +#include + +#include "list_node.h" +#include "test_framework/generic_test.h" +#include "test_framework/timed_executor.h" + +using std::shared_ptr; + +// Delete the node past this one. Assume node is not a tail. +void DeleteAfter(const shared_ptr>& node) { + node->next = node->next->next; +} + +shared_ptr> DeleteFromListWrapper( + TimedExecutor& executor, const shared_ptr>& head, + int node_idx) { + shared_ptr> selected_node = head; + shared_ptr> prev; + while (node_idx-- > 0) { + if (!selected_node || !selected_node->next) + throw std::runtime_error("Node index is out of range"); + prev = selected_node; + selected_node = selected_node->next; + } + executor.Run([&] { DeleteAfter(prev); }); + return head; +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"executor", "head", "node_idx"}; + return GenericTestMain(args, "delete_from_list.tsv", &DeleteFromListWrapper, + DefaultComparator{}, param_names); +} diff --git a/epi_judge_cpp_solutions/delete_kth_last_from_list.cc b/epi_judge_cpp_solutions/delete_kth_last_from_list.cc new file mode 100644 index 000000000..2506c2e3d --- /dev/null +++ b/epi_judge_cpp_solutions/delete_kth_last_from_list.cc @@ -0,0 +1,31 @@ +#include + +#include "list_node.h" +#include "test_framework/generic_test.h" + +using std::shared_ptr; + +// Assumes L has at least k nodes, deletes the k-th last node in L. +shared_ptr> RemoveKthLast(const shared_ptr>& L, + int k) { + auto dummy_head = make_shared>(ListNode{0, L}); + auto first = dummy_head->next; + while (k--) { + first = first->next; + } + + auto second = dummy_head; + while (first) { + second = second->next, first = first->next; + } + // second points to the (k + 1)-th last node, deletes its successor. + second->next = second->next->next; + return dummy_head->next; +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"L", "k"}; + return GenericTestMain(args, "delete_kth_last_from_list.tsv", &RemoveKthLast, + DefaultComparator{}, param_names); +} diff --git a/epi_judge_cpp_solutions/delete_node_from_list.cc b/epi_judge_cpp_solutions/delete_node_from_list.cc new file mode 100644 index 000000000..6fe5c4567 --- /dev/null +++ b/epi_judge_cpp_solutions/delete_node_from_list.cc @@ -0,0 +1,32 @@ +#include "list_node.h" +#include "test_framework/generic_test.h" +#include "test_framework/timed_executor.h" + +// Assumes node_to_delete is not tail. +void DeletionFromList(const shared_ptr>& node_to_delete) { + node_to_delete->data = node_to_delete->next->data; + node_to_delete->next = node_to_delete->next->next; +} + +shared_ptr> DeletionFromListWrapper( + TimedExecutor& executor, const shared_ptr>& head, + int node_to_delete_idx) { + shared_ptr> selected_node = head; + while (node_to_delete_idx-- > 0) { + if (!selected_node || !selected_node->next) + throw std::runtime_error("Node index is out of range"); + selected_node = selected_node->next; + } + + executor.Run([&] { DeletionFromList(selected_node); }); + return head; +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"executor", "head", + "node_to_delete_idx"}; + return GenericTestMain(args, "delete_node_from_list.tsv", + &DeletionFromListWrapper, DefaultComparator{}, + param_names); +} diff --git a/epi_judge_cpp_solutions/descendant_and_ancestor_in_bst.cc b/epi_judge_cpp_solutions/descendant_and_ancestor_in_bst.cc new file mode 100644 index 000000000..b4312d7aa --- /dev/null +++ b/epi_judge_cpp_solutions/descendant_and_ancestor_in_bst.cc @@ -0,0 +1,83 @@ +#include + +#include "bst_node.h" +#include "test_framework/binary_tree_utils.h" +#include "test_framework/generic_test.h" +#include "test_framework/timed_executor.h" + +using std::unique_ptr; + +bool SearchTarget(const unique_ptr>&, + const unique_ptr>&); + +bool PairIncludesAncestorAndDescendantOfM( + const unique_ptr>& possible_anc_or_desc_0, + const unique_ptr>& possible_anc_or_desc_1, + const unique_ptr>& middle) { + auto* search_0 = possible_anc_or_desc_0.get(); + auto* search_1 = possible_anc_or_desc_1.get(); + + // Perform interleaved searching from possible_anc_or_desc_0 and + // possible_anc_or_desc_1 for middle. + while (search_0 != possible_anc_or_desc_1.get() && search_0 != middle.get() && + search_1 != possible_anc_or_desc_0.get() && search_1 != middle.get() && + (search_0 || search_1)) { + if (search_0) { + search_0 = search_0->data > middle->data ? search_0->left.get() + : search_0->right.get(); + } + if (search_1) { + search_1 = search_1->data > middle->data ? search_1->left.get() + : search_1->right.get(); + } + } + + // If both searches were unsuccessful, or we got from + // possible_anc_or_desc_0 to possible_anc_or_desc_1 without seeing middle, + // or from possible_anc_or_desc_1 to possible_anc_or_desc_0 without seeing + // middle, middle cannot lie between possible_anc_or_desc_0 and + // possible_anc_or_desc_1. + if ((search_0 != middle.get() && search_1 != middle.get()) || + search_0 == possible_anc_or_desc_1.get() || + search_1 == possible_anc_or_desc_0.get()) { + return false; + } + + // If we get here, we already know one of possible_anc_or_desc_0 or + // possible_anc_or_desc_1 has a path to middle. Check if middle has a path + // to possible_anc_or_desc_1 or to possible_anc_or_desc_0. + return SearchTarget(middle, search_0 == middle.get() + ? possible_anc_or_desc_1 + : possible_anc_or_desc_0); +} + +bool SearchTarget(const unique_ptr>& from, + const unique_ptr>& target) { + auto* iter = from.get(); + while (iter && iter != target.get()) { + iter = iter->data > target->data ? iter->left.get() : iter->right.get(); + } + return iter == target.get(); +} + +bool PairIncludesAncestorAndDescendantOfMWrapper( + TimedExecutor& executor, const unique_ptr>& tree, + int possible_anc_or_desc_0, int possible_anc_or_desc_1, int middle) { + auto& candidate0 = MustFindNode(tree, possible_anc_or_desc_0); + auto& candidate1 = MustFindNode(tree, possible_anc_or_desc_1); + auto& middle_node = MustFindNode(tree, middle); + return executor.Run([&] { + return PairIncludesAncestorAndDescendantOfM(candidate0, candidate1, + middle_node); + }); +} + +// clang-format off + + +int main(int argc, char* argv[]) { + std::vector args {argv + 1, argv + argc}; + std::vector param_names {"executor", "tree", "possible_anc_or_desc_0", "possible_anc_or_desc_1", "middle"}; + return GenericTestMain(args, "descendant_and_ancestor_in_bst.tsv", &PairIncludesAncestorAndDescendantOfMWrapper, DefaultComparator{}, param_names); +} +// clang-format on diff --git a/epi_judge_cpp_solutions/directory_path_normalization.cc b/epi_judge_cpp_solutions/directory_path_normalization.cc new file mode 100644 index 000000000..f9e75398e --- /dev/null +++ b/epi_judge_cpp_solutions/directory_path_normalization.cc @@ -0,0 +1,60 @@ +#include +#include +#include +#include +#include "test_framework/generic_test.h" + +using std::invalid_argument; +using std::string; +using std::stringstream; +using std::vector; + +string ShortestEquivalentPath(const string& path) { + if (empty(path)) { + throw invalid_argument("Empty string is not a valid path."); + } + + vector path_names; // Uses vector as a stack. + // Special case: starts with "/", which is an absolute path. + if (path.front() == '/') { + path_names.emplace_back("/"); + } + + stringstream ss(path); + string token; + while (getline(ss, token, '/')) { + if (token == "..") { + if (empty(path_names) || path_names.back() == "..") { + path_names.emplace_back(token); + } else { + if (path_names.back() == "/") { + throw invalid_argument("Path error"); + } + path_names.pop_back(); + } + } else if (token != "." && token != "") { // Must be a name. + path_names.emplace_back(token); + } + } + + string result; + if (!empty(path_names)) { + result = path_names.front(); + for (int i = 1; i < size(path_names); ++i) { + if (i == 1 && result == "/") { // Avoid starting "//". + result += path_names[i]; + } else { + result += "/" + path_names[i]; + } + } + } + return result; +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"path"}; + return GenericTestMain(args, "directory_path_normalization.tsv", + &ShortestEquivalentPath, DefaultComparator{}, + param_names); +} diff --git a/epi_judge_cpp_solutions/do_lists_overlap.cc b/epi_judge_cpp_solutions/do_lists_overlap.cc new file mode 100644 index 000000000..0a1369146 --- /dev/null +++ b/epi_judge_cpp_solutions/do_lists_overlap.cc @@ -0,0 +1,144 @@ +#include +#include + +#define main _main +#include "do_terminated_lists_overlap.cc" +#undef main +#define main __main +#include "is_list_cyclic.cc" +#undef main +#include "list_node.h" +#include "test_framework/generic_test.h" +#include "test_framework/test_failure.h" +#include "test_framework/timed_executor.h" + +int Distance(shared_ptr> a, shared_ptr> b); + +shared_ptr> OverlappingLists(shared_ptr> l0, + shared_ptr> l1) { + // Store the start of cycle if any. + auto root0 = HasCycle(l0), root1 = HasCycle(l1); + + if (!root0 && !root1) { + // Both lists don't have cycles. + return OverlappingNoCycleLists(l0, l1); + } else if ((root0 && !root1) || (!root0 && root1)) { + // One list has cycle, and one list has no cycle. + return nullptr; + } + // Both lists have cycles. + auto temp = root1; + do { + temp = temp->next; + } while (temp != root0 && temp != root1); + + // l0 and l1 do not end in the same cycle. + if (temp != root0) { + return nullptr; // Cycles are disjoint. + } + + // l0 and l1 end in the same cycle, locate the overlapping node if they + // first overlap before cycle starts. + int stem0_length = Distance(l0, root0), stem1_length = Distance(l1, root1); + AdvanceListByK(abs(stem0_length - stem1_length), + stem0_length > stem1_length ? &l0 : &l1); + while (l0 != l1 && l0 != root0 && l1 != root1) { + l0 = l0->next, l1 = l1->next; + } + + // If l0 == l1 before reaching root0, it means the overlap first occurs + // before the cycle starts; otherwise, the first overlapping node is not + // unique, so we can return any node on the cycle. + return l0 == l1 ? l0 : root0; +} + +// Calculates the distance between a and b. +int Distance(shared_ptr> a, shared_ptr> b) { + int dis = 0; + while (a != b) { + a = a->next, ++dis; + } + return dis; +} + +void OverlappingListsWrapper(TimedExecutor& executor, + shared_ptr> l0, + shared_ptr> l1, + shared_ptr> common, int cycle0, + int cycle1) { + if (common) { + if (!l0) { + l0 = common; + } else { + auto it = l0; + while (it->next) { + it = it->next; + } + it->next = common; + } + + if (!l1) { + l1 = common; + } else { + auto it = l1; + while (it->next) { + it = it->next; + } + it->next = common; + } + } + + if (cycle0 != -1 && l0) { + auto last = l0; + while (last->next) { + last = last->next; + } + auto it = l0; + while (cycle0-- > 0) { + if (!it) { + throw std::runtime_error("Invalid input data"); + } + it = it->next; + } + last->next = it; + } + + if (cycle1 != -1 && l1) { + auto last = l1; + while (last->next) { + last = last->next; + } + auto it = l1; + while (cycle1-- > 0) { + if (!it) { + throw std::runtime_error("Invalid input data"); + } + it = it->next; + } + last->next = it; + } + + std::set>> common_nodes; + auto it = common; + while (it && common_nodes.count(it) == 0) { + common_nodes.insert(it); + it = it->next; + } + + auto result = executor.Run([&] { return OverlappingLists(l0, l1); }); + + if (!((common_nodes.empty() && result == nullptr) || + common_nodes.count(result) > 0)) { + throw TestFailure("Invalid result"); + } +} + +// clang-format off + + +int main(int argc, char* argv[]) { + std::vector args {argv + 1, argv + argc}; + std::vector param_names {"executor", "l0", "l1", "common", "cycle0", "cycle1"}; + return GenericTestMain(args, "do_lists_overlap.tsv", &OverlappingListsWrapper, DefaultComparator{}, param_names); +} +// clang-format on diff --git a/epi_judge_cpp_solutions/do_terminated_lists_overlap.cc b/epi_judge_cpp_solutions/do_terminated_lists_overlap.cc new file mode 100644 index 000000000..4d824647c --- /dev/null +++ b/epi_judge_cpp_solutions/do_terminated_lists_overlap.cc @@ -0,0 +1,82 @@ +#include + +#include "list_node.h" +#include "test_framework/generic_test.h" +#include "test_framework/test_failure.h" +#include "test_framework/timed_executor.h" + +using std::shared_ptr; + +int Length(shared_ptr> L); +void AdvanceListByK(int k, shared_ptr>* L); + +shared_ptr> OverlappingNoCycleLists( + shared_ptr> l0, shared_ptr> l1) { + int l0_len = Length(l0), l1_len = Length(l1); + + // Advances the longer list to get equal length lists. + AdvanceListByK(abs(l0_len - l1_len), l0_len > l1_len ? &l0 : &l1); + + while (l0 && l1 && l0 != l1) { + l0 = l0->next, l1 = l1->next; + } + return l0; // nullptr implies there is no overlap between l0 and l1. +} + +int Length(shared_ptr> L) { + int length = 0; + while (L) { + ++length, L = L->next; + } + return length; +} + +// Advances L by k steps. +void AdvanceListByK(int k, shared_ptr>* L) { + while (k--) { + *L = (*L)->next; + } +} + +void OverlappingNoCycleListsWrapper(TimedExecutor& executor, + shared_ptr> l0, + shared_ptr> l1, + shared_ptr> common) { + if (common) { + if (l0) { + auto i = l0; + while (i->next) { + i = i->next; + } + i->next = common; + } else { + l0 = common; + } + + if (l1) { + auto i = l1; + while (i->next) { + i = i->next; + } + i->next = common; + } else { + l1 = common; + } + } + + auto result = executor.Run([&] { return OverlappingNoCycleLists(l0, l1); }); + + if (result != common) { + throw TestFailure("Invalid result"); + } +} + +// clang-format off + + +int main(int argc, char* argv[]) { + std::vector args {argv + 1, argv + argc}; + std::vector param_names {"executor", "l0", "l1", "common"}; + return GenericTestMain(args, "do_terminated_lists_overlap.tsv", &OverlappingNoCycleListsWrapper, DefaultComparator{}, param_names); +} +// clang-format on diff --git a/epi_judge_cpp_solutions/doubly_list_node.h b/epi_judge_cpp_solutions/doubly_list_node.h new file mode 100644 index 000000000..ab7cc6392 --- /dev/null +++ b/epi_judge_cpp_solutions/doubly_list_node.h @@ -0,0 +1,13 @@ +#include +#pragma once + +using std::shared_ptr; + +template +struct ListNode { + T data; + shared_ptr> prev, next; + ListNode(T data, const shared_ptr>& prev, + const shared_ptr>& next) + : data(data), prev(prev), next(next) {} +}; diff --git a/epi_judge_cpp_solutions/drawing_skyline.cc b/epi_judge_cpp_solutions/drawing_skyline.cc new file mode 100644 index 000000000..9f27f00b2 --- /dev/null +++ b/epi_judge_cpp_solutions/drawing_skyline.cc @@ -0,0 +1,66 @@ +#include +#include + +#include "test_framework/fmt_print.h" +#include "test_framework/generic_test.h" +#include "test_framework/test_utils_serialization_traits.h" + +using std::max; +using std::min; +using std::numeric_limits; +using std::vector; + +struct Rectangle; +typedef vector Skyline; + +struct Rectangle { + int left, right, height; +}; +typedef vector Skyline; + +Skyline ComputeSkyline(const vector& buildings) { + int min_left = numeric_limits::max(), + max_right = numeric_limits::min(); + for (const Rectangle& building : buildings) { + min_left = min(min_left, building.left); + max_right = max(max_right, building.right); + } + + vector heights(max_right - min_left + 1, 0); + for (const Rectangle& building : buildings) { + for (int i = building.left; i <= building.right; ++i) { + heights[i - min_left] = max(heights[i - min_left], building.height); + } + } + + Skyline result; + int left = 0; + for (int i = 1; i < size(heights); ++i) { + if (heights[i] != heights[i - 1]) { + result.emplace_back( + Rectangle{left + min_left, i - 1 + min_left, heights[i - 1]}); + left = i; + } + } + result.emplace_back(Rectangle{left + min_left, max_right, heights.back()}); + return result; +} + +bool operator==(const Rectangle& a, const Rectangle& b) { + return a.left == b.left && a.right == b.right && a.height == b.height; +} + +template <> +struct SerializationTraits + : UserSerTraits {}; + +std::ostream& operator<<(std::ostream& out, const Rectangle& r) { + return PrintTo(out, std::make_tuple(r.left, r.right, r.height)); +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"buildings"}; + return GenericTestMain(args, "drawing_skyline.tsv", &ComputeSkyline, + DefaultComparator{}, param_names); +} diff --git a/epi_judge_cpp_solutions/dutch_national_flag.cc b/epi_judge_cpp_solutions/dutch_national_flag.cc new file mode 100644 index 000000000..78e7da1fb --- /dev/null +++ b/epi_judge_cpp_solutions/dutch_national_flag.cc @@ -0,0 +1,81 @@ +#include +#include +#include + +#include "test_framework/generic_test.h" +#include "test_framework/test_failure.h" +#include "test_framework/timed_executor.h" + +using std::swap; +using std::vector; + +typedef enum { kRed, kWhite, kBlue } Color; + +void DutchFlagPartition(int pivot_index, vector* A_ptr) { + vector& A = *A_ptr; + Color pivot = A[pivot_index]; + /** + * Keep the following invariants during partitioning: + * bottom group: A[0, smaller - 1]. + * middle group: A[smaller, equal - 1]. + * unclassified group: A[equal, larger - 1]. + * top group: A[larger, size(A) - 1]. + */ + int smaller = 0, equal = 0, larger = size(A); + // Keep iterating as long as there is an unclassified element. + while (equal < larger) { + // A[equal] is the incoming unclassified element. + if (A[equal] < pivot) { + swap(A[smaller++], A[equal++]); + } else if (A[equal] == pivot) { + ++equal; + } else { // A[equal] > pivot. + swap(A[equal], A[--larger]); + } + } +} + +void DutchFlagPartitionWrapper(TimedExecutor& executor, const vector& A, + int pivot_idx) { + vector colors; + colors.resize(A.size()); + std::array count = {0, 0, 0}; + for (size_t i = 0; i < A.size(); i++) { + count[A[i]]++; + colors[i] = static_cast(A[i]); + } + Color pivot = colors[pivot_idx]; + + executor.Run([&] { DutchFlagPartition(pivot_idx, &colors); }); + + int i = 0; + while (i < colors.size() && colors[i] < pivot) { + count[colors[i]]--; + ++i; + } + + while (i < colors.size() && colors[i] == pivot) { + count[colors[i]]--; + ++i; + } + + while (i < colors.size() && colors[i] > pivot) { + count[colors[i]]--; + ++i; + } + + if (i != colors.size()) { + throw TestFailure("Not partitioned after " + std::to_string(i) + + "th element"); + } else if (count != std::array{0, 0, 0}) { + throw TestFailure("Some elements are missing from original array"); + } +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"executor", "A", "pivot_idx"}; + return GenericTestMain(args, "dutch_national_flag.tsv", + &DutchFlagPartitionWrapper, DefaultComparator{}, + param_names); +} diff --git a/epi_judge_cpp_solutions/element_appearing_once.cc b/epi_judge_cpp_solutions/element_appearing_once.cc new file mode 100644 index 000000000..3faae6807 --- /dev/null +++ b/epi_judge_cpp_solutions/element_appearing_once.cc @@ -0,0 +1,56 @@ +#include +#include +#include "test_framework/generic_test.h" + +using std::array; +using std::vector; + +int FindElementAppearsOnce(const vector &A) { + array counts = {}; + for (int x : A) { + for (int i = 0; i < 32; ++i) { + counts[i] += x & 1; + x >>= 1; + } + } + + int result = 0; + for (int i = 0; i < 32; ++i) { + result |= (counts[i] % 3) << i; + } + return result; +} + +int FindElementAppearsOnceAlternative(const vector &A) { + // ones denotes whether a bit-position has been set once (modulo 3) so far. + // twos denotes whether a bit-position has been set twice (modulo 3) so far. + int ones = 0, twos = 0; + int next_ones, next_twos; + for (const int &i : A) { + // After reading A[i], bit-position j has a count of 1 modulo 3 + // if it had a count of 1 modulo 3 (the j-th bit in ones is set) + // and the j-th bit in A[i] is 0 or the count was 0 modulo 3 + // (the j-th bit is not set in ones and in not set in twos) and + // the j-th bit in A[i] is 1. + next_ones = (~i & ones) | (i & ~ones & ~twos); + + // After reading A[i], bit-position j has a count of 2 modulo 3 + // if it had a count of 2 modulo 3 (the j-th bit in twos is set) + // and the j-th bit in A[i] is a 0 or the count was 1 modulo 3 + // (the j-th bit is set in ones) and the j-th bit in A[i] is a 1. + next_twos = (~i & twos) | (i & ones); + + ones = next_ones, twos = next_twos; + } + // Since ones denotes bit-positions which have been set once (modulo 3), + // it is the element which appears only once. + return ones; +} + +int main(int argc, char *argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"A"}; + return GenericTestMain(args, "element_appearing_once.tsv", + &FindElementAppearsOnce, DefaultComparator{}, + param_names); +} diff --git a/epi_judge_cpp_solutions/enumerate_balanced_parentheses.cc b/epi_judge_cpp_solutions/enumerate_balanced_parentheses.cc new file mode 100644 index 000000000..8836c6c74 --- /dev/null +++ b/epi_judge_cpp_solutions/enumerate_balanced_parentheses.cc @@ -0,0 +1,47 @@ +#include +#include +#include "test_framework/generic_test.h" + +using std::string; +using std::vector; + +void DirectedGenerateBalancedParentheses(int, int, const string&, + vector*); + +vector GenerateBalancedParentheses(int num_pairs) { + vector result; + DirectedGenerateBalancedParentheses(num_pairs, num_pairs, "", &result); + return result; +} + +void DirectedGenerateBalancedParentheses(int num_left_parens_needed, + int num_right_parens_needed, + const string& valid_prefix, + vector* result) { + if (!num_right_parens_needed) { + result->emplace_back(valid_prefix); + return; + } + + if (num_left_parens_needed > 0) { // Able to insert '('. + DirectedGenerateBalancedParentheses(num_left_parens_needed - 1, + num_right_parens_needed, + valid_prefix + '(', result); + } + if (num_left_parens_needed < num_right_parens_needed) { + // Able to insert ')'. + DirectedGenerateBalancedParentheses(num_left_parens_needed, + num_right_parens_needed - 1, + valid_prefix + ')', result); + } +} + +// clang-format off + + +int main(int argc, char* argv[]) { + std::vector args {argv + 1, argv + argc}; + std::vector param_names {"num_pairs"}; + return GenericTestMain(args, "enumerate_balanced_parentheses.tsv", &GenerateBalancedParentheses, &UnorderedComparator>, param_names); +} +// clang-format on diff --git a/epi_judge_cpp_solutions/enumerate_palindromic_decompositions.cc b/epi_judge_cpp_solutions/enumerate_palindromic_decompositions.cc new file mode 100644 index 000000000..7edb1c0e1 --- /dev/null +++ b/epi_judge_cpp_solutions/enumerate_palindromic_decompositions.cc @@ -0,0 +1,65 @@ +#include +#include +#include +#include +#include +#include "test_framework/generic_test.h" + +using std::make_unique; +using std::string; +using std::vector; + +bool IsPalindrome(const string&); + +void DirectedPalindromeDecompositions(const string&, int, vector*, + vector>*); + +vector> PalindromeDecompositions(const string& input) { + vector> result; + DirectedPalindromeDecompositions( + input, 0, make_unique>().get(), &result); + return result; +} + +void DirectedPalindromeDecompositions(const string& input, int offset, + vector* partial_partition, + vector>* result) { + if (offset == size(input)) { + result->emplace_back(*partial_partition); + return; + } + + for (int i = offset + 1; i <= size(input); ++i) { + if (string prefix = input.substr(offset, i - offset); + IsPalindrome(prefix)) { + partial_partition->emplace_back(prefix); + DirectedPalindromeDecompositions(input, i, partial_partition, result); + partial_partition->pop_back(); + } + } +} + +bool IsPalindrome(const string& prefix) { + for (int i = 0, j = size(prefix) - 1; i < j; ++i, --j) { + if (prefix[i] != prefix[j]) { + return false; + } + } + return true; +} + +bool Comp(vector> expected, vector> result) { + std::sort(begin(expected), end(expected)); + std::sort(begin(result), end(result)); + return expected == result; +}; + +// clang-format off + + +int main(int argc, char* argv[]) { + std::vector args {argv + 1, argv + argc}; + std::vector param_names {"input"}; + return GenericTestMain(args, "enumerate_palindromic_decompositions.tsv", &PalindromeDecompositions, &Comp, param_names); +} +// clang-format on diff --git a/epi_judge_cpp_solutions/enumerate_trees.cc b/epi_judge_cpp_solutions/enumerate_trees.cc new file mode 100644 index 000000000..5e2b84230 --- /dev/null +++ b/epi_judge_cpp_solutions/enumerate_trees.cc @@ -0,0 +1,81 @@ +#include +#include +#include +#include + +#include "binary_tree_node.h" +#include "test_framework/generic_test.h" +#include "test_framework/timed_executor.h" + +using std::make_unique; +using std::vector; + +unique_ptr> Clone(const unique_ptr>&); + +vector>> GenerateAllBinaryTrees(int num_nodes) { + vector>> result; + if (num_nodes == 0) { // Empty tree, add as an nullptr. + result.emplace_back(nullptr); + } + + for (int num_left_tree_nodes = 0; num_left_tree_nodes < num_nodes; + ++num_left_tree_nodes) { + int num_right_tree_nodes = num_nodes - 1 - num_left_tree_nodes; + auto left_subtrees = GenerateAllBinaryTrees(num_left_tree_nodes); + auto right_subtrees = GenerateAllBinaryTrees(num_right_tree_nodes); + // Generates all combinations of left_subtrees and right_subtrees. + for (auto& left : left_subtrees) { + for (auto& right : right_subtrees) { + result.emplace_back(make_unique>( + BinaryTreeNode{0, Clone(left), Clone(right)})); + } + } + } + return result; +} + +unique_ptr> Clone( + const unique_ptr>& tree) { + return tree ? make_unique>(BinaryTreeNode{ + 0, Clone(tree->left), Clone(tree->right)}) + : nullptr; +} + +vector SerializeStructure(const unique_ptr>& tree) { + vector result; + + std::stack*> stack; + stack.push(tree.get()); + while (!stack.empty()) { + auto p = stack.top(); + stack.pop(); + result.push_back(p != nullptr); + if (p) { + stack.push(p->left.get()); + stack.push(p->right.get()); + } + } + return result; +} + +vector> GenerateAllBinaryTreesWrapper(TimedExecutor& executor, + int num_nodes) { + auto result = executor.Run([&] { return GenerateAllBinaryTrees(num_nodes); }); + + vector> serialized; + for (auto& x : result) { + serialized.push_back(SerializeStructure(x)); + } + std::sort(begin(serialized), end(serialized)); + return serialized; +} + +// clang-format off + + +int main(int argc, char* argv[]) { + std::vector args {argv + 1, argv + argc}; + std::vector param_names {"executor", "num_nodes"}; + return GenericTestMain(args, "enumerate_trees.tsv", &GenerateAllBinaryTreesWrapper, DefaultComparator{}, param_names); +} +// clang-format on diff --git a/epi_judge_cpp_solutions/evaluate_rpn.cc b/epi_judge_cpp_solutions/evaluate_rpn.cc new file mode 100644 index 000000000..3fa6d29f4 --- /dev/null +++ b/epi_judge_cpp_solutions/evaluate_rpn.cc @@ -0,0 +1,44 @@ +#include +#include +#include +#include +#include +#include "test_framework/generic_test.h" + +using std::function; +using std::stack; +using std::string; +using std::stringstream; +using std::unordered_map; + +int Evaluate(const string& expression) { + stack intermediate_results; + stringstream ss(expression); + string token; + const char kDelimiter = ','; + const unordered_map> kOperators = { + {"+", [](int x, int y) -> int { return x + y; }}, + {"-", [](int x, int y) -> int { return x - y; }}, + {"*", [](int x, int y) -> int { return x * y; }}, + {"/", [](int x, int y) -> int { return x / y; }}}; + + while (getline(ss, token, kDelimiter)) { + if (kOperators.count(token)) { + const int y = intermediate_results.top(); + intermediate_results.pop(); + const int x = intermediate_results.top(); + intermediate_results.pop(); + intermediate_results.emplace(kOperators.at(token)(x, y)); + } else { // token is a number. + intermediate_results.emplace(stoi(token)); + } + } + return intermediate_results.top(); +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"expression"}; + return GenericTestMain(args, "evaluate_rpn.tsv", &Evaluate, + DefaultComparator{}, param_names); +} diff --git a/epi_judge_cpp_solutions/even_odd_array.cc b/epi_judge_cpp_solutions/even_odd_array.cc new file mode 100644 index 000000000..acff5e2aa --- /dev/null +++ b/epi_judge_cpp_solutions/even_odd_array.cc @@ -0,0 +1,52 @@ +#include +#include +#include +#include + +#include "test_framework/generic_test.h" +#include "test_framework/test_failure.h" +#include "test_framework/timed_executor.h" + +using std::swap; +using std::vector; + +void EvenOdd(vector* A_ptr) { + vector& A = *A_ptr; + int next_even = 0, next_odd = size(A) - 1; + while (next_even < next_odd) { + if (A[next_even] % 2 == 0) { + ++next_even; + } else { + swap(A[next_even], A[next_odd--]); + } + } +} + +void EvenOddWrapper(TimedExecutor& executor, vector A) { + std::multiset before(begin(A), end(A)); + + executor.Run([&] { EvenOdd(&A); }); + + bool in_odd = false; + for (int a : A) { + if (a % 2 == 0) { + if (in_odd) { + throw TestFailure("Even elements appear in odd part"); + } + } else { + in_odd = true; + } + } + + std::multiset after(begin(A), end(A)); + if (before != after) { + throw TestFailure("Elements mismatch"); + } +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"executor", "A"}; + return GenericTestMain(args, "even_odd_array.tsv", &EvenOddWrapper, + DefaultComparator{}, param_names); +} diff --git a/epi_judge_cpp_solutions/even_odd_list_merge.cc b/epi_judge_cpp_solutions/even_odd_list_merge.cc new file mode 100644 index 000000000..e6c0f2a33 --- /dev/null +++ b/epi_judge_cpp_solutions/even_odd_list_merge.cc @@ -0,0 +1,32 @@ +#include + +#include "list_node.h" +#include "test_framework/generic_test.h" + +using std::array; + +shared_ptr> EvenOddMerge(const shared_ptr>& L) { + if (L == nullptr) { + return L; + } + + auto even_dummy_head = make_shared>(ListNode{0, nullptr}), + odd_dummy_head = make_shared>(ListNode{0, nullptr}); + array>, 2> tails = {even_dummy_head, odd_dummy_head}; + int turn = 0; + for (auto iter = L; iter; iter = iter->next) { + tails[turn]->next = iter; + tails[turn] = tails[turn]->next; + turn ^= 1; // Alternate between even and odd. + } + tails[1]->next = nullptr; + tails[0]->next = odd_dummy_head->next; + return even_dummy_head->next; +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"L"}; + return GenericTestMain(args, "even_odd_list_merge.tsv", &EvenOddMerge, + DefaultComparator{}, param_names); +} diff --git a/epi_judge_cpp_solutions/find_salary_threshold.cc b/epi_judge_cpp_solutions/find_salary_threshold.cc new file mode 100644 index 000000000..6fc8f1990 --- /dev/null +++ b/epi_judge_cpp_solutions/find_salary_threshold.cc @@ -0,0 +1,27 @@ +#include +#include +#include "test_framework/generic_test.h" + +using std::vector; + +double FindSalaryCap(int target_payroll, vector current_salaries) { + sort(begin(current_salaries), end(current_salaries)); + double unadjusted_salary_sum = 0.0; + for (int i = 0; i < size(current_salaries); ++i) { + const int adjusted_people = size(current_salaries) - i; + const double adjusted_salary_sum = current_salaries[i] * adjusted_people; + if (unadjusted_salary_sum + adjusted_salary_sum >= target_payroll) { + return (target_payroll - unadjusted_salary_sum) / adjusted_people; + } + unadjusted_salary_sum += current_salaries[i]; + } + // No solution, since target_payroll > existing payroll. + return -1.0; +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"target_payroll", "current_salaries"}; + return GenericTestMain(args, "find_salary_threshold.tsv", &FindSalaryCap, + DefaultComparator{}, param_names); +} diff --git a/epi_judge_cpp_solutions/first_missing_positive_entry.cc b/epi_judge_cpp_solutions/first_missing_positive_entry.cc new file mode 100644 index 000000000..caeaf2448 --- /dev/null +++ b/epi_judge_cpp_solutions/first_missing_positive_entry.cc @@ -0,0 +1,37 @@ +#include +#include +#include "test_framework/generic_test.h" + +using std::swap; +using std::vector; + +// A is passed by value argument, since we change it. +int FindFirstMissingPositive(vector A) { + // Record which values are present by writing A[i] to index A[i] - 1 if A[i] + // is between 1 and size(A), inclusive. We save the value at index A[i] - 1 + // by swapping it with the entry at i. If A[i] is negative or greater than + // n, we just advance i. + for (int i = 0; i < size(A); ++i) { + while (0 < A[i] && A[i] <= size(A) && A[i] != A[A[i] - 1]) { + swap(A[i], A[A[i] - 1]); + } + } + + // Second pass through A to search for the first index i such that + // A[i] != i+1, indicating that i + 1 is absent. If all numbers between 1 + // and size(A) are present, the smallest missing positive is size(A) + 1. + for (int i = 0; i < size(A); ++i) { + if (A[i] != i + 1) { + return i + 1; + } + } + return size(A) + 1; +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"A"}; + return GenericTestMain(args, "first_missing_positive_entry.tsv", + &FindFirstMissingPositive, DefaultComparator{}, + param_names); +} diff --git a/epi_judge_cpp_solutions/gcd.cc b/epi_judge_cpp_solutions/gcd.cc new file mode 100644 index 000000000..cb211bfdc --- /dev/null +++ b/epi_judge_cpp_solutions/gcd.cc @@ -0,0 +1,22 @@ +#include "test_framework/generic_test.h" +long long Gcd(long long x, long long y) { + if (x > y) { + return Gcd(y, x); + } else if (x == 0) { + return y; + } else if (!(x & 1) && !(y & 1)) { // x and y are even. + return Gcd(x >> 1, y >> 1) << 1; + } else if (!(x & 1) && y & 1) { // x is even, and y is odd. + return Gcd(x >> 1, y); + } else if (x & 1 && !(y & 1)) { // x is odd, and y is even. + return Gcd(x, y >> 1); + } + return Gcd(x, y - x); // Both x and y are odd. +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"x", "y"}; + return GenericTestMain(args, "gcd.tsv", &Gcd, DefaultComparator{}, + param_names); +} diff --git a/epi_judge_cpp_solutions/graph_clone.cc b/epi_judge_cpp_solutions/graph_clone.cc new file mode 100644 index 000000000..003b23937 --- /dev/null +++ b/epi_judge_cpp_solutions/graph_clone.cc @@ -0,0 +1,122 @@ +#include +#include +#include +#include +#include +#include + +#include "test_framework/generic_test.h" +#include "test_framework/test_failure.h" +#include "test_framework/test_utils_serialization_traits.h" + +using std::deque; +using std::queue; +using std::unordered_map; +using std::unordered_set; +using std::vector; + +struct GraphVertex { + int label; + vector edges; +}; + +GraphVertex* CloneGraph(GraphVertex* graph) { + if (!graph) { + return nullptr; + } + + unordered_map vertex_map; + queue q(deque(1, graph)); + vertex_map.emplace(graph, new GraphVertex({graph->label})); + while (!empty(q)) { + auto v = q.front(); + q.pop(); + for (GraphVertex* e : v->edges) { + // Try to copy vertex e. + if (!vertex_map.count(e)) { + vertex_map.emplace(e, new GraphVertex({e->label})); + q.emplace(e); + } + // Copy edge. + vertex_map[v]->edges.emplace_back(vertex_map[e]); + } + } + return vertex_map[graph]; +} + +vector CopyLabels(const vector& edges) { + vector labels; + transform(begin(edges), end(edges), back_inserter(labels), + [](const auto& e) { return e->label; }); + return labels; +} + +void CheckGraph(GraphVertex* node, const vector& graph) { + if (!node || node == &graph[0]) { + throw TestFailure("Graph was not copied"); + } + + unordered_set vertex_set; + queue q; + q.emplace(node); + vertex_set.emplace(node); + while (!q.empty()) { + auto vertex = q.front(); + q.pop(); + if (vertex->label >= graph.size()) { + throw TestFailure("Invalid vertex label"); + } + vector label1 = CopyLabels(vertex->edges), + label2 = CopyLabels(graph[vertex->label].edges); + sort(begin(label1), end(label1)); + sort(begin(label2), end(label2)); + if (label1 != label2) { + throw TestFailure("Edges mismatch"); + } + for (GraphVertex* e : vertex->edges) { + if (!vertex_set.count(e)) { + vertex_set.emplace(e); + q.emplace(e); + } + } + } + for (auto& v : vertex_set) { + delete v; + } +} + +struct Edge { + int from; + int to; +}; + +template <> +struct SerializationTraits : UserSerTraits {}; + +void CloneGraphTest(int k, const vector& edges) { + vector graph; + if (k <= 0) { + throw std::runtime_error("Invalid k value"); + } + graph.reserve(k); + + for (int i = 0; i < k; i++) { + graph.push_back(GraphVertex{i}); + } + + for (const Edge& e : edges) { + if (e.from < 0 || e.from >= k || e.to < 0 || e.to >= k) { + throw std::runtime_error("Invalid vertex index"); + } + graph[e.from].edges.push_back(&graph[e.to]); + } + GraphVertex* result = CloneGraph(&graph[0]); + CheckGraph(result, graph); +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"k", "edges"}; + return GenericTestMain(args, "graph_clone.tsv", &CloneGraphTest, + DefaultComparator{}, param_names); +} diff --git a/epi_judge_cpp_solutions/gray_code.cc b/epi_judge_cpp_solutions/gray_code.cc new file mode 100644 index 000000000..bddedb692 --- /dev/null +++ b/epi_judge_cpp_solutions/gray_code.cc @@ -0,0 +1,68 @@ +#include +#include +#include + +#include "test_framework/generic_test.h" +#include "test_framework/test_failure.h" +#include "test_framework/timed_executor.h" + +using std::vector; + +vector GrayCode(int num_bits) { + if (num_bits == 0) { + return {0}; + } + + // These implicitly begin with 0 at bit-index (num_bits - 1). + vector gray_code_num_bits_minus_1 = GrayCode(num_bits - 1); + + // Now, add a 1 at bit-index (num_bits - 1) to all entries in + // grayCodeNumBitsMinus1. + int leading_bit_one = 1 << (num_bits - 1); + // Process in reverse order to achieve reflection of + // gray_code_num_bits_minus_1. + for (int i = size(gray_code_num_bits_minus_1) - 1; i >= 0; --i) { + gray_code_num_bits_minus_1.emplace_back(leading_bit_one | + gray_code_num_bits_minus_1[i]); + } + return gray_code_num_bits_minus_1; +} + +bool DiffersByOneBit(int x, int y) { + int bit_difference = x ^ y; + return bit_difference && !(bit_difference & (bit_difference - 1)); +} + +void GrayCodeWrapper(TimedExecutor& executor, int num_bits) { + vector result = executor.Run([&] { return GrayCode(num_bits); }); + + int expected_size = (1 << num_bits); + if (result.size() != expected_size) { + throw TestFailure("Length mismatch: expected " + + std::to_string(expected_size) + ", got " + + std::to_string(result.size())); + } + for (size_t i = 1; i < result.size(); i++) + if (!DiffersByOneBit(result[i - 1], result[i])) { + if (result[i - 1] == result[i]) { + throw TestFailure("Two adjacent entries are equal"); + } else { + throw TestFailure("Two adjacent entries differ by more than 1 bit"); + } + } + + std::sort(begin(result), end(result)); + auto uniq = std::unique(begin(result), end(result)); + if (uniq != end(result)) { + throw TestFailure("Not all entries are distinct: found " + + std::to_string(std::distance(uniq, end(result))) + + " duplicates"); + } +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"executor", "num_bits"}; + return GenericTestMain(args, "gray_code.tsv", &GrayCodeWrapper, + DefaultComparator{}, param_names); +} diff --git a/epi_judge_cpp_solutions/group_equal_entries.cc b/epi_judge_cpp_solutions/group_equal_entries.cc new file mode 100644 index 000000000..cd2c15799 --- /dev/null +++ b/epi_judge_cpp_solutions/group_equal_entries.cc @@ -0,0 +1,92 @@ +#include +#include +#include +#include +#include +#include +#include + +#include "test_framework/generic_test.h" +#include "test_framework/test_failure.h" +#include "test_framework/test_utils_serialization_traits.h" +#include "test_framework/timed_executor.h" + +using std::function; +using std::max; +using std::string; +using std::swap; +using std::unordered_map; +using std::vector; + +struct Person { + int age; + string name; +}; + +void GroupByAge(vector* people) { + unordered_map age_to_count; + for (const Person& p : *people) { + ++age_to_count[p.age]; + } + unordered_map age_to_offset; + int offset = 0; + for (const auto & [ age, count ] : age_to_count) { + age_to_offset[age] = offset; + offset += count; + } + + while (!empty(age_to_offset)) { + auto from = begin(age_to_offset); + auto to = age_to_offset.find((*people)[from->second].age); + swap((*people)[from->second], (*people)[to->second]); + // Use age_to_count to see when we are finished with a particular age. + --age_to_count[to->first]; + if (age_to_count[to->first] > 0) { + ++to->second; + } else { + age_to_offset.erase(to); + } + } +} + +template <> +struct SerializationTraits : UserSerTraits {}; + +void GroupByAgeWrapper(TimedExecutor& executor, vector& people) { + if (people.empty()) { + return; + } + std::multiset> values( + begin(people), end(people), [](const Person& a, const Person& b) { + return a.age == b.age ? a.name < b.name : a.age < b.age; + }); + + executor.Run([&] { GroupByAge(&people); }); + + if (people.empty()) { + throw TestFailure("Empty result"); + } + std::set ages; + int last_age = people[0].age; + for (auto& x : people) { + if (ages.count(x.age) != 0) { + throw TestFailure("Entries are not grouped by age"); + } + if (x.age != last_age) { + ages.insert(last_age); + last_age = x.age; + } + auto it = values.find(x); + if (it == end(values)) { + throw TestFailure("Entry set changed"); + } + values.erase(it); + } +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"executor", "people"}; + return GenericTestMain(args, "group_equal_entries.tsv", &GroupByAgeWrapper, + DefaultComparator{}, param_names); +} diff --git a/epi_judge_cpp_solutions/h_index.cc b/epi_judge_cpp_solutions/h_index.cc new file mode 100644 index 000000000..cfa8cb9be --- /dev/null +++ b/epi_judge_cpp_solutions/h_index.cc @@ -0,0 +1,24 @@ +#include +#include +#include "test_framework/generic_test.h" + +using std::sort; +using std::vector; + +int HIndex(vector citations) { + sort(begin(citations), end(citations)); + const int n = citations.size(); + for (int i = 0; i < citations.size(); ++i) { + if (citations[i] >= n - i) { + return n - i; + } + } + return 0; +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"citations"}; + return GenericTestMain(args, "h_index.tsv", &HIndex, DefaultComparator{}, + param_names); +} diff --git a/epi_judge_cpp_solutions/hanoi.cc b/epi_judge_cpp_solutions/hanoi.cc new file mode 100644 index 000000000..b2d64ae74 --- /dev/null +++ b/epi_judge_cpp_solutions/hanoi.cc @@ -0,0 +1,82 @@ +#include +#include +#include +#include + +#include "test_framework/generic_test.h" +#include "test_framework/test_failure.h" +#include "test_framework/timed_executor.h" + +using std::array; +using std::stack; +using std::vector; + +void ComputeTowerHanoiSteps(int, array, 3>&, int, int, int, + vector>*); + +const int kNumPegs = 3; + +vector> ComputeTowerHanoi(int num_rings) { + array, kNumPegs> pegs; + // Initialize pegs. + for (int i = num_rings; i >= 1; --i) { + pegs[0].push(i); + } + + vector> result; + ComputeTowerHanoiSteps(num_rings, pegs, 0, 1, 2, &result); + return result; +} + +void ComputeTowerHanoiSteps(int num_rings_to_move, + array, kNumPegs>& pegs, int from_peg, + int to_peg, int use_peg, + vector>* result_ptr) { + if (num_rings_to_move > 0) { + ComputeTowerHanoiSteps(num_rings_to_move - 1, pegs, from_peg, use_peg, + to_peg, result_ptr); + pegs[to_peg].push(pegs[from_peg].top()); + pegs[from_peg].pop(); + result_ptr->emplace_back(vector{from_peg, to_peg}); + ComputeTowerHanoiSteps(num_rings_to_move - 1, pegs, use_peg, to_peg, + from_peg, result_ptr); + } +} + +void ComputeTowerHanoiWrapper(TimedExecutor& executor, int num_rings) { + array, kNumPegs> pegs; + for (int i = num_rings; i >= 1; --i) { + pegs[0].push(i); + } + + vector> result = + executor.Run([&] { return ComputeTowerHanoi(num_rings); }); + + for (const vector& operation : result) { + int from_peg = operation[0], to_peg = operation[1]; + if (!pegs[to_peg].empty() && pegs[from_peg].top() >= pegs[to_peg].top()) { + throw TestFailure("Illegal move from " + + std::to_string(pegs[from_peg].top()) + " to " + + std::to_string(pegs[to_peg].top())); + } + pegs[to_peg].push(pegs[from_peg].top()); + pegs[from_peg].pop(); + } + array, kNumPegs> expected_pegs1, expected_pegs2; + for (int i = num_rings; i >= 1; --i) { + expected_pegs1[1].push(i); + } + for (int i = num_rings; i >= 1; --i) { + expected_pegs2[2].push(i); + } + if (pegs != expected_pegs1 && pegs != expected_pegs2) { + throw TestFailure("Pegs doesn't place in the right configuration"); + } +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"executor", "num_rings"}; + return GenericTestMain(args, "hanoi.tsv", &ComputeTowerHanoiWrapper, + DefaultComparator{}, param_names); +} diff --git a/epi_judge_cpp_solutions/huffman_coding.cc b/epi_judge_cpp_solutions/huffman_coding.cc new file mode 100644 index 000000000..945a04fe0 --- /dev/null +++ b/epi_judge_cpp_solutions/huffman_coding.cc @@ -0,0 +1,115 @@ +#include +#include +#include +#include +#include +#include + +#include "test_framework/generic_test.h" +#include "test_framework/test_utils_serialization_traits.h" + +using std::make_unique; +using std::priority_queue; +using std::shared_ptr; +using std::string; +using std::unique_ptr; +using std::unordered_map; +using std::vector; + +// namespace is used in order to escape BinaryTreeNode symbol +namespace huffman { + +struct BinaryTree; + +void AssignHuffmanCode(const shared_ptr&, const unique_ptr&, + unordered_map*); + +struct CharWithFrequency { + char c; + double freq; +}; + +struct BinaryTree { + double aggregate_freq; + CharWithFrequency* s; + shared_ptr left, right; +}; + +struct FrequencyComparator { + bool operator()(const shared_ptr& lhs, + const shared_ptr& rhs) const { + return lhs->aggregate_freq > rhs->aggregate_freq; + } +}; + +double HuffmanEncoding(vector* symbols) { + // Initially assigns each symbol into candidates. + priority_queue, vector>, + FrequencyComparator> + candidates; + for (CharWithFrequency& s : *symbols) { + candidates.emplace(new BinaryTree{s.freq, &s, nullptr, nullptr}); + } + + // Keeps combining two nodes until there is one node left. + while (size(candidates) > 1) { + shared_ptr left = candidates.top(); + candidates.pop(); + shared_ptr right = candidates.top(); + candidates.pop(); + candidates.emplace(new BinaryTree{ + left->aggregate_freq + right->aggregate_freq, nullptr, left, right}); + } + + unordered_map huffman_encoding; + // Traverses the binary tree, assigning codes to nodes. + AssignHuffmanCode(candidates.top(), make_unique(), &huffman_encoding); + double avg = 0.0; + for (const CharWithFrequency& s : *symbols) { + avg += size(huffman_encoding[s.c]) * s.freq / 100.0; + } + return avg; +} + +void AssignHuffmanCode(const shared_ptr& tree, + const unique_ptr& code, + unordered_map* huffman_encoding) { + if (tree) { + if (tree->s) { + // This node is a leaf. + (*huffman_encoding)[tree->s->c] = *code; + } else { // Non-leaf node. + code->push_back('0'); + AssignHuffmanCode(tree->left, code, huffman_encoding); + code->back() = '1'; + AssignHuffmanCode(tree->right, code, huffman_encoding); + code->pop_back(); + } + } +} +} // namespace huffman + +template <> +struct SerializationTraits + : UserSerTraits { + static huffman::CharWithFrequency FromTuple( + const std::tuple& values) { + if (std::get<0>(values).size() != 1) { + throw std::runtime_error( + "CharWithFrequency parser: string length is not 1"); + } + return huffman::CharWithFrequency{std::get<0>(values)[0], + std::get<1>(values)}; + } +}; + +double HuffmanEncodingWrapper(vector symbols) { + return huffman::HuffmanEncoding(&symbols); +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"symbols"}; + return GenericTestMain(args, "huffman_coding.tsv", &HuffmanEncodingWrapper, + DefaultComparator{}, param_names); +} diff --git a/epi_judge_cpp_solutions/insert_in_list.cc b/epi_judge_cpp_solutions/insert_in_list.cc new file mode 100644 index 000000000..8bc171dc9 --- /dev/null +++ b/epi_judge_cpp_solutions/insert_in_list.cc @@ -0,0 +1,38 @@ +#include + +#include "list_node.h" +#include "test_framework/generic_test.h" +#include "test_framework/timed_executor.h" + +using std::make_shared; +using std::shared_ptr; + +// Insert new_node after node. +void InsertAfter(const shared_ptr>& node, + const shared_ptr>& new_node) { + new_node->next = node->next; + node->next = new_node; +} + +shared_ptr> InsertListWrapper(TimedExecutor& executor, + const shared_ptr>& l, + int node_idx, int new_node_data) { + auto node = l; + while (node_idx > 1) { + node = node->next; + --node_idx; + } + auto new_node = make_shared>(new_node_data, nullptr); + + executor.Run([&] { InsertAfter(node, new_node); }); + + return l; +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"executor", "l", "node_idx", + "new_node_data"}; + return GenericTestMain(args, "insert_in_list.tsv", &InsertListWrapper, + DefaultComparator{}, param_names); +} diff --git a/epi_judge_cpp_solutions/insert_operators_in_string.cc b/epi_judge_cpp_solutions/insert_operators_in_string.cc new file mode 100644 index 000000000..e2093a0d9 --- /dev/null +++ b/epi_judge_cpp_solutions/insert_operators_in_string.cc @@ -0,0 +1,95 @@ +#include +#include +#include +#include +#include "test_framework/generic_test.h" + +using std::accumulate; +using std::make_unique; +using std::stack; +using std::vector; + +bool DirectedExpressionSynthesis(const vector&, int, int, int, + vector*, vector*); +int Evaluate(const vector&, const vector&); + +bool ExpressionSynthesis(const vector& digits, int target) { + return DirectedExpressionSynthesis(digits, target, 0, 0, + make_unique>().get(), + make_unique>().get()); +} + +bool DirectedExpressionSynthesis(const vector& digits, int target, + int current_term, int offset, + vector* operands, + vector* operators) { + current_term = current_term * 10 + digits[offset]; + if (offset == size(digits) - 1) { + operands->emplace_back(current_term); + if (Evaluate(*operands, *operators) == target) { // Found a match. + return true; + } + operands->pop_back(); + return false; + } + + // No operator. + if (DirectedExpressionSynthesis(digits, target, current_term, offset + 1, + operands, operators)) { + return true; + } + // Tries multiplication operator '*'. + operands->emplace_back(current_term), operators->emplace_back('*'); + if (DirectedExpressionSynthesis(digits, target, 0, offset + 1, operands, + operators)) { + return true; + } + operands->pop_back(), operators->pop_back(); + // Tries addition operator '+'. + operands->emplace_back(current_term); + // First check feasibility of plus operator. + if (target - Evaluate(*operands, *operators) <= + accumulate(begin(digits) + offset + 1, end(digits), 0, + [](int val, int d) { return val * 10 + d; })) { + operators->emplace_back('+'); + if (DirectedExpressionSynthesis(digits, target, 0, offset + 1, operands, + operators)) { + return true; + } + operators->pop_back(); + } + operands->pop_back(); + return false; +} + +int Evaluate(const vector& operands, const vector& operators) { + stack intermediate_operands; + int operand_idx = 0; + intermediate_operands.push(operands[operand_idx++]); + // Evaluates '*' first. + for (char oper : operators) { + if (oper == '*') { + int product = intermediate_operands.top() * operands[operand_idx++]; + intermediate_operands.pop(); + intermediate_operands.push(product); + } else { // oper == '+'. + intermediate_operands.push(operands[operand_idx++]); + } + } + + // Evaluates '+' second. + int sum = 0; + while (!empty(intermediate_operands)) { + sum += intermediate_operands.top(); + intermediate_operands.pop(); + } + return sum; +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"digits", "target"}; + return GenericTestMain(args, "insert_operators_in_string.tsv", + &ExpressionSynthesis, DefaultComparator{}, + param_names); +} diff --git a/epi_judge_cpp_solutions/int_as_array_increment.cc b/epi_judge_cpp_solutions/int_as_array_increment.cc new file mode 100644 index 000000000..d71ddca07 --- /dev/null +++ b/epi_judge_cpp_solutions/int_as_array_increment.cc @@ -0,0 +1,26 @@ +#include +#include "test_framework/generic_test.h" + +using std::vector; + +vector PlusOne(vector A) { + ++A.back(); + for (int i = size(A) - 1; i > 0 && A[i] == 10; --i) { + A[i] = 0, ++A[i - 1]; + } + if (A[0] == 10) { + // There is a carry-out, so we need one more digit to store the result. + // A slick way to do this is to append a 0 at the end of the array, + // and update the first entry to 1. + A[0] = 1; + A.emplace_back(0); + } + return A; +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"A"}; + return GenericTestMain(args, "int_as_array_increment.tsv", &PlusOne, + DefaultComparator{}, param_names); +} diff --git a/epi_judge_cpp_solutions/int_as_array_multiply.cc b/epi_judge_cpp_solutions/int_as_array_multiply.cc new file mode 100644 index 000000000..9a928365e --- /dev/null +++ b/epi_judge_cpp_solutions/int_as_array_multiply.cc @@ -0,0 +1,38 @@ +#include +#include +#include +#include "test_framework/generic_test.h" + +using std::abs; +using std::vector; + +vector Multiply(vector num1, vector num2) { + const int sign = num1.front() < 0 ^ num2.front() < 0 ? -1 : 1; + num1.front() = abs(num1.front()), num2.front() = abs(num2.front()); + + vector result(size(num1) + size(num2), 0); + for (int i = size(num1) - 1; i >= 0; --i) { + for (int j = size(num2) - 1; j >= 0; --j) { + result[i + j + 1] += num1[i] * num2[j]; + result[i + j] += result[i + j + 1] / 10; + result[i + j + 1] %= 10; + } + } + + // Remove the leading zeroes. + result = { + find_if_not(begin(result), end(result), [](int a) { return a == 0; }), + end(result)}; + if (empty(result)) { + return {0}; + } + result.front() *= sign; + return result; +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"num1", "num2"}; + return GenericTestMain(args, "int_as_array_multiply.tsv", &Multiply, + DefaultComparator{}, param_names); +} diff --git a/epi_judge_cpp_solutions/int_as_list_add.cc b/epi_judge_cpp_solutions/int_as_list_add.cc new file mode 100644 index 000000000..7019bf970 --- /dev/null +++ b/epi_judge_cpp_solutions/int_as_list_add.cc @@ -0,0 +1,25 @@ +#include "list_node.h" +#include "test_framework/generic_test.h" + +shared_ptr> AddTwoNumbers(shared_ptr> L1, + shared_ptr> L2) { + shared_ptr> dummy_head(new ListNode); + auto place_iter = dummy_head; + int carry = 0; + while (L1 || L2 || carry) { + int val = carry + (L1 ? L1->data : 0) + (L2 ? L2->data : 0); + L1 = L1 ? L1->next : nullptr; + L2 = L2 ? L2->next : nullptr; + place_iter->next = + make_shared>(ListNode{val % 10, nullptr}); + carry = val / 10, place_iter = place_iter->next; + } + return dummy_head->next; +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"L1", "L2"}; + return GenericTestMain(args, "int_as_list_add.tsv", &AddTwoNumbers, + DefaultComparator{}, param_names); +} diff --git a/epi_judge_cpp_solutions/int_square_root.cc b/epi_judge_cpp_solutions/int_square_root.cc new file mode 100644 index 000000000..2d0325a1b --- /dev/null +++ b/epi_judge_cpp_solutions/int_square_root.cc @@ -0,0 +1,22 @@ +#include "test_framework/generic_test.h" +int SquareRoot(int k) { + int left = 0, right = k; + // Candidate interval [left, right] where everything before left has + // square <= k, and everything after right has square > k. + while (left <= right) { + long long mid = left + ((right - left) / 2); + if (long long mid_squared = mid * mid; mid_squared <= k) { + left = mid + 1; + } else { + right = mid - 1; + } + } + return left - 1; +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"k"}; + return GenericTestMain(args, "int_square_root.tsv", &SquareRoot, + DefaultComparator{}, param_names); +} diff --git a/epi_judge_cpp_solutions/intersect_sorted_arrays.cc b/epi_judge_cpp_solutions/intersect_sorted_arrays.cc new file mode 100644 index 000000000..5832bdcfa --- /dev/null +++ b/epi_judge_cpp_solutions/intersect_sorted_arrays.cc @@ -0,0 +1,24 @@ +#include +#include +#include "test_framework/generic_test.h" + +using std::vector; + +vector IntersectTwoSortedArrays(const vector& A, + const vector& B) { + vector insersection_A_B; + for (int i = 0; i < size(A); ++i) { + if ((!i || A[i] != A[i - 1]) && find(begin(B), end(B), A[i]) != end(B)) { + insersection_A_B.emplace_back(A[i]); + } + } + return insersection_A_B; +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"A", "B"}; + return GenericTestMain(args, "intersect_sorted_arrays.tsv", + &IntersectTwoSortedArrays, DefaultComparator{}, + param_names); +} diff --git a/epi_judge_cpp_solutions/interval_add.cc b/epi_judge_cpp_solutions/interval_add.cc new file mode 100644 index 000000000..7170cff8e --- /dev/null +++ b/epi_judge_cpp_solutions/interval_add.cc @@ -0,0 +1,60 @@ +#include +#include + +#include "test_framework/fmt_print.h" +#include "test_framework/generic_test.h" +#include "test_framework/test_utils_serialization_traits.h" + +using std::max; +using std::min; +using std::vector; + +struct Interval { + int left, right; +}; + +vector AddInterval(const vector& disjoint_intervals, + Interval new_interval) { + size_t i = 0; + vector result; + + // Processes intervals in disjoint_intervals which come before new_interval. + while (i < size(disjoint_intervals) && + new_interval.left > disjoint_intervals[i].right) { + result.emplace_back(disjoint_intervals[i++]); + } + + // Processes intervals in disjoint_intervals which overlap with + // new_interval. + while (i < size(disjoint_intervals) && + new_interval.right >= disjoint_intervals[i].left) { + // If [a, b] and [c, d] overlap, their union is [min(a, c),max(b, d)]. + new_interval = {min(new_interval.left, disjoint_intervals[i].left), + max(new_interval.right, disjoint_intervals[i].right)}; + ++i; + } + result.emplace_back(new_interval); + + // Processes intervals in disjoint_intervals which come after new_interval. + result.insert(end(result), begin(disjoint_intervals) + i, + end(disjoint_intervals)); + return result; +} + +template <> +struct SerializationTraits : UserSerTraits {}; + +bool operator==(const Interval& a, const Interval& b) { + return a.left == b.left && a.right == b.right; +} + +std::ostream& operator<<(std::ostream& out, const Interval& i) { + return PrintTo(out, std::make_tuple(i.left, i.right)); +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"disjoint_intervals", "new_interval"}; + return GenericTestMain(args, "interval_add.tsv", &AddInterval, + DefaultComparator{}, param_names); +} diff --git a/epi_judge_cpp_solutions/intervals_union.cc b/epi_judge_cpp_solutions/intervals_union.cc new file mode 100644 index 000000000..fcb3f74a3 --- /dev/null +++ b/epi_judge_cpp_solutions/intervals_union.cc @@ -0,0 +1,110 @@ +#include +#include +#include + +#include "test_framework/generic_test.h" +#include "test_framework/test_utils_serialization_traits.h" +#include "test_framework/timed_executor.h" + +using std::vector; + +struct Interval { + struct Endpoint { + bool is_closed; + int val; + }; + + Endpoint left, right; +}; + +vector UnionOfIntervals(vector intervals) { + // Empty input. + if (empty(intervals)) { + return {}; + } + + // Sort intervals according to left endpoints of intervals. + sort(begin(intervals), end(intervals), + [](const Interval& a, const Interval& b) { + if (a.left.val != b.left.val) { + return a.left.val < b.left.val; + } + // Left endpoints are equal, so now see if one is closed and the + // other open - closed intervals should appear first. + return a.left.is_closed && !b.left.is_closed; + }); + vector result; + for (Interval i : intervals) { + if (!empty(result) && + (i.left.val < result.back().right.val || + (i.left.val == result.back().right.val && + (i.left.is_closed || result.back().right.is_closed)))) { + if (i.right.val > result.back().right.val || + (i.right.val == result.back().right.val && i.right.is_closed)) { + result.back().right = i.right; + } + } else { + result.emplace_back(i); + } + } + return result; +} + +struct FlatInterval { + int left_val; + bool left_is_closed; + int right_val; + bool right_is_closed; + + FlatInterval(int left_val, bool left_is_closed, int right_val, + bool right_is_closed) + : left_val(left_val), + left_is_closed(left_is_closed), + right_val(right_val), + right_is_closed(right_is_closed) {} + + explicit FlatInterval(Interval in) + : left_val(in.left.val), + left_is_closed(in.left.is_closed), + right_val(in.right.val), + right_is_closed(in.right.is_closed) {} + + operator Interval() const { + return {{left_is_closed, left_val}, {right_is_closed, right_val}}; + } + + bool operator==(const FlatInterval& rhs) const { + return std::tie(left_val, left_is_closed, right_val, right_is_closed) == + std::tie(rhs.left_val, rhs.left_is_closed, rhs.right_val, + rhs.right_is_closed); + } +}; + +template <> +struct SerializationTraits + : UserSerTraits {}; + +std::ostream& operator<<(std::ostream& out, const FlatInterval& i) { + return out << (i.left_is_closed ? '<' : '(') << i.left_val << ", " + << i.right_val << (i.right_is_closed ? '>' : ')'); +} + +std::vector UnionOfIntervalsWrapper( + TimedExecutor& executor, const std::vector& intervals) { + std::vector casted; + for (const FlatInterval& i : intervals) { + casted.push_back(static_cast(i)); + } + + std::vector result = + executor.Run([&] { return UnionOfIntervals(casted); }); + + return {begin(result), end(result)}; +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"executor", "intervals"}; + return GenericTestMain(args, "intervals_union.tsv", &UnionOfIntervalsWrapper, + DefaultComparator{}, param_names); +} diff --git a/epi_judge_cpp_solutions/is_anonymous_letter_constructible.cc b/epi_judge_cpp_solutions/is_anonymous_letter_constructible.cc new file mode 100644 index 000000000..80f9369f4 --- /dev/null +++ b/epi_judge_cpp_solutions/is_anonymous_letter_constructible.cc @@ -0,0 +1,44 @@ +#include +#include +#include "test_framework/generic_test.h" + +using std::string; +using std::unordered_map; + +bool IsLetterConstructibleFromMagazine(const string& letter_text, + const string& magazine_text) { + unordered_map char_frequency_for_letter; + // Compute the frequencies for all chars in letter_text. + for (char c : letter_text) { + ++char_frequency_for_letter[c]; + } + + // Check if the characters in magazine_text can cover characters + // in char_frequency_for_letter. + for (char c : magazine_text) { + if (auto it = char_frequency_for_letter.find(c); + it != cend(char_frequency_for_letter)) { + --it->second; + if (it->second == 0) { + char_frequency_for_letter.erase(it); + if (empty(char_frequency_for_letter)) { + // All characters for letter_text are matched. + break; + } + } + } + } + // Empty char_frequency_for_letter means every char in letter_text can be + // covered by a character in magazine_text. + return empty(char_frequency_for_letter); +} + +// clang-format off + + +int main(int argc, char* argv[]) { + std::vector args {argv + 1, argv + argc}; + std::vector param_names {"letter_text", "magazine_text"}; + return GenericTestMain(args, "is_anonymous_letter_constructible.tsv", &IsLetterConstructibleFromMagazine, DefaultComparator{}, param_names); +} +// clang-format on diff --git a/epi_judge_cpp_solutions/is_array_dominated.cc b/epi_judge_cpp_solutions/is_array_dominated.cc new file mode 100644 index 000000000..a402b432a --- /dev/null +++ b/epi_judge_cpp_solutions/is_array_dominated.cc @@ -0,0 +1,69 @@ +#include +#include +#include + +#include "test_framework/generic_test.h" +#include "test_framework/test_failure.h" +#include "test_framework/timed_executor.h" + +using std::vector; + +class Team { + public: + explicit Team(const vector& height) { + transform(begin(height), end(height), back_inserter(players_), + [](int h) { return Player{h}; }); + } + + // Checks if team0 can be placed in front of team1. + static bool ValidPlacementExists(const Team& team0, const Team& team1) { + vector team0_sorted(team0.SortPlayersByHeight()); + vector team1_sorted(team1.SortPlayersByHeight()); + for (int i = 0; i < size(team0_sorted) && i < size(team1_sorted); ++i) { + if (!(team0_sorted[i] < team1_sorted[i])) { + // team0_sorted[i] cannot be placed behind team1_sorted[i]. + return false; + } + } + return true; + } + + private: + struct Player { + bool operator<(const Player& that) const { return height < that.height; } + + int height; + }; + + vector SortPlayersByHeight() const { + vector sorted_players(players_); + sort(begin(sorted_players), end(sorted_players)); + return sorted_players; + } + + vector players_; +}; + +void ValidPlacementExistsWrapper(TimedExecutor& executor, + const vector& team0, + const vector& team1, bool expected_01, + bool expected_10) { + Team t0(team0), t1(team1); + + bool result_01 = + executor.Run([&] { return Team::ValidPlacementExists(t0, t1); }); + bool result_10 = + executor.Run([&] { return Team::ValidPlacementExists(t1, t0); }); + if (result_01 != expected_01 || result_10 != expected_10) { + throw TestFailure(""); + } +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"executor", "team0", "team1", + "expected_01", "expected_10"}; + return GenericTestMain(args, "is_array_dominated.tsv", + &ValidPlacementExistsWrapper, DefaultComparator{}, + param_names); +} diff --git a/epi_judge_cpp_solutions/is_circuit_wirable.cc b/epi_judge_cpp_solutions/is_circuit_wirable.cc new file mode 100644 index 000000000..ce5c1e5b0 --- /dev/null +++ b/epi_judge_cpp_solutions/is_circuit_wirable.cc @@ -0,0 +1,82 @@ +#include +#include +#include +#include + +#include "test_framework/generic_test.h" +#include "test_framework/test_utils_serialization_traits.h" +#include "test_framework/timed_executor.h" + +using std::all_of; +using std::queue; +using std::vector; + +struct GraphVertex; +bool Bfs(GraphVertex* s); + +struct GraphVertex { + int d = -1; + vector edges; +}; + +bool IsAnyPlacementFeasible(vector* graph) { + return all_of(begin(*graph), end(*graph), + [](GraphVertex& v) { return v.d != -1 || Bfs(&v); }); +} + +bool Bfs(GraphVertex* s) { + s->d = 0; + queue q; + q.emplace(s); + + while (!empty(q)) { + for (GraphVertex*& t : q.front()->edges) { + if (t->d == -1) { // Unvisited vertex. + t->d = q.front()->d + 1; + q.emplace(t); + } else if (t->d == q.front()->d) { + return false; + } + } + q.pop(); + } + return true; +} + +struct Edge { + int from; + int to; +}; + +template <> +struct SerializationTraits : UserSerTraits {}; + +bool IsAnyPlacementFeasibleWrapper(TimedExecutor& executor, int k, + const vector& edges) { + vector graph; + if (k <= 0) { + throw std::runtime_error("Invalid k value"); + } + graph.reserve(k); + + for (int i = 0; i < k; i++) { + graph.push_back(GraphVertex{}); + } + + for (auto& e : edges) { + if (e.from < 0 || e.from >= k || e.to < 0 || e.to >= k) { + throw std::runtime_error("Invalid vertex index"); + } + graph[e.from].edges.push_back(&graph[e.to]); + } + + return executor.Run([&] { return IsAnyPlacementFeasible(&graph); }); +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"executor", "k", "edges"}; + return GenericTestMain(args, "is_circuit_wirable.tsv", + &IsAnyPlacementFeasibleWrapper, DefaultComparator{}, + param_names); +} diff --git a/epi_judge_cpp_solutions/is_list_cyclic.cc b/epi_judge_cpp_solutions/is_list_cyclic.cc new file mode 100644 index 000000000..d0667be5e --- /dev/null +++ b/epi_judge_cpp_solutions/is_list_cyclic.cc @@ -0,0 +1,101 @@ +#include + +#include "list_node.h" +#include "test_framework/generic_test.h" +#include "test_framework/test_failure.h" +#include "test_framework/timed_executor.h" + +using std::shared_ptr; + +shared_ptr> HasCycle(const shared_ptr>& head) { + shared_ptr> fast = head, slow = head; + + while (fast && fast->next) { + slow = slow->next, fast = fast->next->next; + if (slow == fast) { + // There is a cycle, so now let's calculate the cycle length. + int cycle_len = 0; + do { + ++cycle_len; + fast = fast->next; + } while (slow != fast); + + // Finds the start of the cycle. + auto cycle_len_advanced_iter = head; + while (cycle_len--) { + cycle_len_advanced_iter = cycle_len_advanced_iter->next; + } + + auto iter = head; + // Both iterators advance in tandem. + while (iter != cycle_len_advanced_iter) { + iter = iter->next; + cycle_len_advanced_iter = cycle_len_advanced_iter->next; + } + return iter; // iter is the start of cycle. + } + } + return nullptr; // No cycle. +} + +void HasCycleWrapper(TimedExecutor& executor, + const shared_ptr>& head, int cycle_idx) { + int cycle_length = 0; + if (cycle_idx != -1) { + if (!head) { + throw std::runtime_error("Can't cycle empty list"); + } + shared_ptr> cycle_start, cursor = head; + while (cursor->next) { + if (cursor->data == cycle_idx) { + cycle_start = cursor; + } + cursor = cursor->next; + cycle_length += !!cycle_start; + } + if (cursor->data == cycle_idx) { + cycle_start = cursor; + } + if (!cycle_start) { + throw std::runtime_error("Can't find a cycle start"); + } + cursor->next = cycle_start; + cycle_length++; + } + shared_ptr> result = + executor.Run([&] { return HasCycle(head); }); + + if (cycle_idx == -1) { + if (result != nullptr) { + throw TestFailure("Found a non-existing cycle"); + } + } else { + if (result == nullptr) { + throw TestFailure("Existing cycle was not found"); + } + + auto cursor = result; + do { + cursor = cursor->next; + cycle_length--; + if (!cursor || cycle_length < 0) { + throw TestFailure( + "Returned node does not belong to the cycle or is not the " + "closest node to the head"); + } + } while (cursor != result); + + if (cycle_length != 0) { + throw TestFailure( + "Returned node does not belong to the cycle or is not the closest " + "node to the head"); + } + } +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"executor", "head", "cycle_idx"}; + return GenericTestMain(args, "is_list_cyclic.tsv", &HasCycleWrapper, + DefaultComparator{}, param_names); +} diff --git a/epi_judge_cpp_solutions/is_list_palindromic.cc b/epi_judge_cpp_solutions/is_list_palindromic.cc new file mode 100644 index 000000000..2df90851a --- /dev/null +++ b/epi_judge_cpp_solutions/is_list_palindromic.cc @@ -0,0 +1,30 @@ +#include "list_node.h" +#include "reverse_linked_list_iterative.h" +#include "test_framework/generic_test.h" + +bool IsLinkedListAPalindrome(shared_ptr> L) { + // Finds the second half of L. + shared_ptr> slow = L, fast = L; + while (fast && fast->next) { + fast = fast->next->next, slow = slow->next; + } + + // Compares the first half and the reversed second half lists. + auto first_half_iter = L, second_half_iter = ReverseLinkedList(slow); + while (second_half_iter && first_half_iter) { + if (second_half_iter->data != first_half_iter->data) { + return false; + } + second_half_iter = second_half_iter->next; + first_half_iter = first_half_iter->next; + } + return true; +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"L"}; + return GenericTestMain(args, "is_list_palindromic.tsv", + &IsLinkedListAPalindrome, DefaultComparator{}, + param_names); +} diff --git a/epi_judge_cpp_solutions/is_number_palindromic.cc b/epi_judge_cpp_solutions/is_number_palindromic.cc new file mode 100644 index 000000000..cfc2e59c4 --- /dev/null +++ b/epi_judge_cpp_solutions/is_number_palindromic.cc @@ -0,0 +1,27 @@ +#include +#include "test_framework/generic_test.h" + +bool IsPalindromeNumber(int x) { + if (x <= 0) { + return x == 0; + } + + const int num_digits = static_cast(floor(log10(x))) + 1; + int msd_mask = static_cast(pow(10, num_digits - 1)); + for (int i = 0; i < (num_digits / 2); ++i) { + if (x / msd_mask != x % 10) { + return false; + } + x %= msd_mask; // Remove the most significant digit of x. + x /= 10; // Remove the least significant digit of x. + msd_mask /= 100; + } + return true; +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"x"}; + return GenericTestMain(args, "is_number_palindromic.tsv", &IsPalindromeNumber, + DefaultComparator{}, param_names); +} diff --git a/epi_judge_cpp_solutions/is_string_decomposable_into_words.cc b/epi_judge_cpp_solutions/is_string_decomposable_into_words.cc new file mode 100644 index 000000000..7fd3d08b7 --- /dev/null +++ b/epi_judge_cpp_solutions/is_string_decomposable_into_words.cc @@ -0,0 +1,87 @@ +#include +#include +#include +#include +#include + +#include "test_framework/generic_test.h" +#include "test_framework/test_failure.h" + +using std::string; +using std::unordered_set; +using std::vector; + +vector DecomposeIntoDictionaryWords( + const string& domain, const unordered_set& dictionary) { + // When the algorithm finishes, last_length[i] != -1 indicates + // domain.substr(0, i + 1) has a valid decomposition, and the length of the + // last string in the decomposition is last_length[i]. + vector last_length(size(domain), -1); + for (int i = 0; i < size(domain); ++i) { + // If domain.substr(0, i + 1) is a dictionary word, set last_length[i] to + // the length of that word. + if (dictionary.count(domain.substr(0, i + 1))) { + last_length[i] = i + 1; + } + + // If last_length[i] = -1 look for j < i such that domain.substr(0, j + 1) + // has a valid decomposition and domain.substring(j + 1, i + 1) is a + // dictionary word. If so, record the length of that word in + // last_length[i]. + if (last_length[i] == -1) { + for (int j = 0; j < i; ++j) { + if (last_length[j] != -1 && + dictionary.count(domain.substr(j + 1, i - j))) { + last_length[i] = i - j; + break; + } + } + } + } + + vector decompositions; + if (last_length.back() != -1) { + // domain can be assembled by dictionary words. + int idx = size(domain) - 1; + while (idx >= 0) { + decompositions.emplace_back( + domain.substr(idx + 1 - last_length[idx], last_length[idx])); + idx -= last_length[idx]; + } + reverse(begin(decompositions), end(decompositions)); + } + return decompositions; +} + +void DecomposeIntoDictionaryWordsWrapper( + TimedExecutor& executor, const string& domain, + const unordered_set& dictionary, bool decomposable) { + vector result = executor.Run( + [&] { return DecomposeIntoDictionaryWords(domain, dictionary); }); + if (!decomposable) { + if (!result.empty()) { + throw TestFailure("domain is not decomposable"); + } + return; + } + + if (std::any_of(std::begin(result), std::end(result), + [&](const std::string& s) { return !dictionary.count(s); })) { + throw TestFailure("Result uses words not in dictionary"); + } + + if (std::accumulate(std::begin(result), std::end(result), string()) != + domain) { + throw TestFailure("Result is not composed into domain"); + } +} + +// clang-format off + + +int main(int argc, char* argv[]) { + std::vector args {argv + 1, argv + argc}; + std::vector param_names {"executor", "domain", "dictionary", "decomposable"}; + return GenericTestMain(args, "is_string_decomposable_into_words.tsv", &DecomposeIntoDictionaryWordsWrapper, DefaultComparator{}, param_names); +} +// clang-format on diff --git a/epi_judge_cpp_solutions/is_string_in_matrix.cc b/epi_judge_cpp_solutions/is_string_in_matrix.cc new file mode 100644 index 000000000..12df465c8 --- /dev/null +++ b/epi_judge_cpp_solutions/is_string_in_matrix.cc @@ -0,0 +1,82 @@ +#include +#include +#include +#include +#include +#include "test_framework/generic_test.h" + +using std::get; +using std::hash; +using std::make_tuple; +using std::make_unique; +using std::tuple; +using std::unordered_set; +using std::vector; + +struct HashTuple; + +bool IsPatternSuffixContainedStartingAtXY( + const vector>&, int, int, const vector&, int, + unordered_set, HashTuple>*); + +struct HashTuple { + size_t operator()(const tuple& t) const { + return hash()(get<0>(t) ^ get<1>(t) * 1021 ^ get<2>(t) * 1048573); + } +}; + +bool IsPatternContainedInGrid(const vector>& grid, + const vector& pattern) { + for (int i = 0; i < size(grid); ++i) { + for (int j = 0; j < size(grid[i]); ++j) { + if (IsPatternSuffixContainedStartingAtXY( + grid, i, j, pattern, 0, + make_unique, HashTuple>>() + .get())) { + return true; + } + } + } + return false; +} + +// Each entry in previous_attempts is a point in the grid and suffix of +// pattern (identified by its offset). Presence in previous_attempts indicates +// the suffix is not contained in the grid starting from that point. +bool IsPatternSuffixContainedStartingAtXY( + const vector>& grid, int x, int y, const vector& pattern, + int offset, + unordered_set, HashTuple>* previous_attempts) { + if (size(pattern) == offset) { + // Nothing left to complete. + return true; + } + // Check if (x, y) lies outside the grid. + if (x < 0 || x >= size(grid) || y < 0 || y >= size(grid[x]) || + previous_attempts->find(make_tuple(x, y, offset)) != + cend(*previous_attempts) || + grid[x][y] != pattern[offset]) { + return false; + } + + if (IsPatternSuffixContainedStartingAtXY(grid, x - 1, y, pattern, offset + 1, + previous_attempts) || + IsPatternSuffixContainedStartingAtXY(grid, x + 1, y, pattern, offset + 1, + previous_attempts) || + IsPatternSuffixContainedStartingAtXY(grid, x, y - 1, pattern, offset + 1, + previous_attempts) || + IsPatternSuffixContainedStartingAtXY(grid, x, y + 1, pattern, offset + 1, + previous_attempts)) { + return true; + } + previous_attempts->emplace(x, y, offset); + return false; +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"grid", "pattern"}; + return GenericTestMain(args, "is_string_in_matrix.tsv", + &IsPatternContainedInGrid, DefaultComparator{}, + param_names); +} diff --git a/epi_judge_cpp_solutions/is_string_palindromic_punctuation.cc b/epi_judge_cpp_solutions/is_string_palindromic_punctuation.cc new file mode 100644 index 000000000..4af203581 --- /dev/null +++ b/epi_judge_cpp_solutions/is_string_palindromic_punctuation.cc @@ -0,0 +1,30 @@ +#include +#include +#include "test_framework/generic_test.h" + +using std::string; + +bool IsPalindrome(const string& s) { + // i moves forward, and j moves backward. + int i = 0, j = size(s) - 1; + while (i < j) { + // i and j both skip non-alphanumeric characters. + while (!isalnum(s[i]) && i < j) { + ++i; + } + while (!isalnum(s[j]) && i < j) { + --j; + } + if (tolower(s[i++]) != tolower(s[j--])) { + return false; + } + } + return true; +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"s"}; + return GenericTestMain(args, "is_string_palindromic_punctuation.tsv", + &IsPalindrome, DefaultComparator{}, param_names); +} diff --git a/epi_judge_cpp_solutions/is_string_permutable_to_palindrome.cc b/epi_judge_cpp_solutions/is_string_permutable_to_palindrome.cc new file mode 100644 index 000000000..d939b76e4 --- /dev/null +++ b/epi_judge_cpp_solutions/is_string_permutable_to_palindrome.cc @@ -0,0 +1,29 @@ +#include +#include +#include "test_framework/generic_test.h" + +using std::string; +using std::unordered_set; + +bool CanFormPalindrome(const string& s) { + unordered_set chars_with_odd_frequency; + for (char c : s) { + if (chars_with_odd_frequency.count(c)) { + // c now has appeared an even number of times. + chars_with_odd_frequency.erase(c); + } else { + // c now has appeared an odd number of times. + chars_with_odd_frequency.insert(c); + } + } + // A string can be permuted to form a palindrome if and only if the number + // of chars whose frequencies is odd is at most 1. + return size(chars_with_odd_frequency) <= 1; +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"s"}; + return GenericTestMain(args, "is_string_permutable_to_palindrome.tsv", + &CanFormPalindrome, DefaultComparator{}, param_names); +} diff --git a/epi_judge_cpp_solutions/is_tree_a_bst.cc b/epi_judge_cpp_solutions/is_tree_a_bst.cc new file mode 100644 index 000000000..561985a3a --- /dev/null +++ b/epi_judge_cpp_solutions/is_tree_a_bst.cc @@ -0,0 +1,52 @@ +#include +#include + +#include "binary_tree_node.h" +#include "test_framework/generic_test.h" + +using std::numeric_limits; +using std::unique_ptr; + +bool AreKeysInRange(const unique_ptr>&, int, int); + +bool IsBinaryTreeBST(const unique_ptr>& tree) { + return AreKeysInRange(tree, numeric_limits::min(), + numeric_limits::max()); +} + +bool AreKeysInRange(const unique_ptr>& tree, int low_range, + int high_range) { + if (tree == nullptr) { + return true; + } else if (tree->data < low_range || tree->data > high_range) { + return false; + } + + return AreKeysInRange(tree->left, low_range, tree->data) && + AreKeysInRange(tree->right, tree->data, high_range); +} + +bool InorderTraversal(const unique_ptr>& tree, + BinaryTreeNode** prev) { + if (!tree) { + return true; + } else if (!InorderTraversal(tree->left, prev)) { + return false; + } else if (*prev && (*prev)->data > tree->data) { + return false; + } + *prev = tree.get(); + return InorderTraversal(tree->right, prev); +} + +bool IsBinaryTreeBSTAlternative(const unique_ptr>& tree) { + BinaryTreeNode* prev = nullptr; + return InorderTraversal(tree, &prev); +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"tree"}; + return GenericTestMain(args, "is_tree_a_bst.tsv", &IsBinaryTreeBST, + DefaultComparator{}, param_names); +} diff --git a/epi_judge_cpp_solutions/is_tree_balanced.cc b/epi_judge_cpp_solutions/is_tree_balanced.cc new file mode 100644 index 000000000..245546ebd --- /dev/null +++ b/epi_judge_cpp_solutions/is_tree_balanced.cc @@ -0,0 +1,49 @@ +#include +#include + +#include "binary_tree_node.h" +#include "test_framework/generic_test.h" + +using std::abs; +using std::max; + +struct BalancedStatusWithHeight; +BalancedStatusWithHeight CheckBalanced(const unique_ptr>&); + +struct BalancedStatusWithHeight { + bool balanced; + int height; +}; + +bool IsBalanced(const unique_ptr>& tree) { + return CheckBalanced(tree).balanced; +} + +// First value of the return value indicates if tree is balanced, and if +// balanced the second value of the return value is the height of tree. +BalancedStatusWithHeight CheckBalanced( + const unique_ptr>& tree) { + if (tree == nullptr) { + return {true, -1}; // Base case. + } + + auto left_result = CheckBalanced(tree->left); + if (!left_result.balanced) { + return {false, 0}; // Left subtree is not balanced. + } + auto right_result = CheckBalanced(tree->right); + if (!right_result.balanced) { + return {false, 0}; // Right subtree is not balanced. + } + + bool is_balanced = abs(left_result.height - right_result.height) <= 1; + int height = max(left_result.height, right_result.height) + 1; + return {is_balanced, height}; +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"tree"}; + return GenericTestMain(args, "is_tree_balanced.tsv", &IsBalanced, + DefaultComparator{}, param_names); +} diff --git a/epi_judge_cpp_solutions/is_tree_symmetric.cc b/epi_judge_cpp_solutions/is_tree_symmetric.cc new file mode 100644 index 000000000..f98714691 --- /dev/null +++ b/epi_judge_cpp_solutions/is_tree_symmetric.cc @@ -0,0 +1,29 @@ +#include "binary_tree_node.h" +#include "test_framework/generic_test.h" + +bool CheckSymmetric(const unique_ptr>&, + const unique_ptr>&); + +bool IsSymmetric(const unique_ptr>& tree) { + return tree == nullptr || CheckSymmetric(tree->left, tree->right); +} + +bool CheckSymmetric(const unique_ptr>& subtree_0, + const unique_ptr>& subtree_1) { + if (subtree_0 == nullptr && subtree_1 == nullptr) { + return true; + } else if (subtree_0 != nullptr && subtree_1 != nullptr) { + return subtree_0->data == subtree_1->data && + CheckSymmetric(subtree_0->left, subtree_1->right) && + CheckSymmetric(subtree_0->right, subtree_1->left); + } + // One subtree is empty, and the other is not. + return false; +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"tree"}; + return GenericTestMain(args, "is_tree_symmetric.tsv", &IsSymmetric, + DefaultComparator{}, param_names); +} diff --git a/epi_judge_cpp_solutions/is_valid_parenthesization.cc b/epi_judge_cpp_solutions/is_valid_parenthesization.cc new file mode 100644 index 000000000..c0a2ef93b --- /dev/null +++ b/epi_judge_cpp_solutions/is_valid_parenthesization.cc @@ -0,0 +1,34 @@ +#include +#include +#include +#include +#include "test_framework/generic_test.h" + +using std::stack; +using std::string; +using std::unordered_map; + +bool IsWellFormed(const string& s) { + stack left_chars; + const unordered_map kLookup = { + {'(', ')'}, {'{', '}'}, {'[', ']'}}; + for (int i = 0; i < size(s); ++i) { + if (kLookup.count(s[i])) { + left_chars.emplace(s[i]); + } else { + if (empty(left_chars) || kLookup.at(left_chars.top()) != s[i]) { + // Unmatched right char or mismatched chars. + return false; + } + left_chars.pop(); + } + } + return empty(left_chars); +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"s"}; + return GenericTestMain(args, "is_valid_parenthesization.tsv", &IsWellFormed, + DefaultComparator{}, param_names); +} diff --git a/epi_judge_cpp_solutions/is_valid_sudoku.cc b/epi_judge_cpp_solutions/is_valid_sudoku.cc new file mode 100644 index 000000000..00677d3aa --- /dev/null +++ b/epi_judge_cpp_solutions/is_valid_sudoku.cc @@ -0,0 +1,66 @@ +#include +#include +#include +#include "test_framework/generic_test.h" + +using std::deque; +using std::vector; + +bool HasDuplicate(const vector>&, int, int, int, int); + +// Check if a partially filled matrix has any conflicts. +bool IsValidSudoku(const vector>& partial_assignment) { + // Check row constraints. + for (int i = 0; i < size(partial_assignment); ++i) { + if (HasDuplicate(partial_assignment, i, i + 1, 0, + size(partial_assignment))) { + return false; + } + } + + // Check column constraints. + for (int j = 0; j < size(partial_assignment); ++j) { + if (HasDuplicate(partial_assignment, 0, size(partial_assignment), j, + j + 1)) { + return false; + } + } + + // Check region constraints. + int region_size = sqrt(size(partial_assignment)); + for (int I = 0; I < region_size; ++I) { + for (int J = 0; J < region_size; ++J) { + if (HasDuplicate(partial_assignment, region_size * I, + region_size * (I + 1), region_size * J, + region_size * (J + 1))) { + return false; + } + } + } + return true; +} + +// Return true if subarray partial_assignment[start_row, end_row - +// 1][start_col, end_col - 1] contains any duplicates in {1, 2, ..., +// size(partial_assignment)}; otherwise return false. +bool HasDuplicate(const vector>& partial_assignment, int start_row, + int end_row, int start_col, int end_col) { + deque is_present(size(partial_assignment) + 1, false); + for (int i = start_row; i < end_row; ++i) { + for (int j = start_col; j < end_col; ++j) { + if (partial_assignment[i][j] != 0 && + is_present[partial_assignment[i][j]]) { + return true; + } + is_present[partial_assignment[i][j]] = true; + } + } + return false; +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"partial_assignment"}; + return GenericTestMain(args, "is_valid_sudoku.tsv", &IsValidSudoku, + DefaultComparator{}, param_names); +} diff --git a/epi_judge_cpp_solutions/k_closest_stars.cc b/epi_judge_cpp_solutions/k_closest_stars.cc new file mode 100644 index 000000000..1d0719ee6 --- /dev/null +++ b/epi_judge_cpp_solutions/k_closest_stars.cc @@ -0,0 +1,82 @@ +#include +#include +#include +#include +#include + +#include "test_framework/generic_test.h" +#include "test_framework/test_utils.h" +#include "test_framework/test_utils_serialization_traits.h" + +using std::function; +using std::priority_queue; +using std::vector; + +struct Star { + bool operator<(const Star& that) const { + return Distance() < that.Distance(); + } + + double Distance() const { return sqrt(x * x + y * y + z * z); } + + double x, y, z; +}; + +vector FindClosestKStars(vector::const_iterator stars_begin, + const vector::const_iterator& stars_end, + int k) { + // max_heap to store the closest k stars seen so far. + priority_queue max_heap; + + while (stars_begin != stars_end) { + // Add each star to the max-heap. If the max-heap size exceeds k, + // remove the maximum element from the max-heap. + max_heap.emplace(*stars_begin++); + if (size(max_heap) == k + 1) { + max_heap.pop(); + } + } + + // Iteratively extract from the max-heap, which yields the stars + // sorted according from furthest to closest. + vector closest_stars; + while (!empty(max_heap)) { + closest_stars.emplace_back(max_heap.top()); + max_heap.pop(); + } + return {rbegin(closest_stars), rend(closest_stars)}; +} + +template <> +struct SerializationTraits : UserSerTraits { +}; + +std::ostream& operator<<(std::ostream& out, const Star& s) { + return out << s.Distance(); +} + +bool Comp(const vector& expected, vector output) { + if (output.size() != expected.size()) { + return false; + } + + std::sort(begin(output), end(output)); + + for (int i = 0; i < output.size(); ++i) { + if (!DefaultComparator()(output[i].Distance(), expected[i])) { + return false; + } + } + return true; +} + +vector FindClosestKStarsWrapper(const vector& stars, int k) { + return FindClosestKStars(cbegin(stars), cend(stars), k); +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"stars", "k"}; + return GenericTestMain(args, "k_closest_stars.tsv", &FindClosestKStarsWrapper, + &Comp, param_names); +} diff --git a/epi_judge_cpp_solutions/k_largest_in_heap.cc b/epi_judge_cpp_solutions/k_largest_in_heap.cc new file mode 100644 index 000000000..ff15db5ff --- /dev/null +++ b/epi_judge_cpp_solutions/k_largest_in_heap.cc @@ -0,0 +1,51 @@ +#include +#include +#include +#include "test_framework/generic_test.h" + +using std::function; +using std::priority_queue; +using std::vector; + +vector KLargestInBinaryHeap(const vector& A, int k) { + if (k <= 0) { + return {}; + } + + struct HeapEntry { + int index, value; + }; + priority_queue, + function> + candidate_max_heap([](const HeapEntry& a, const HeapEntry& b) { + return a.value < b.value; + }); + // The largest element in A is at index 0. + candidate_max_heap.emplace(HeapEntry{0, A[0]}); + vector result; + for (int i = 0; i < k; ++i) { + int candidate_idx = candidate_max_heap.top().index; + result.emplace_back(candidate_max_heap.top().value); + candidate_max_heap.pop(); + + if (int left_child_idx = 2 * candidate_idx + 1; left_child_idx < size(A)) { + candidate_max_heap.emplace(HeapEntry{left_child_idx, A[left_child_idx]}); + } + if (int right_child_idx = 2 * candidate_idx + 2; + right_child_idx < size(A)) { + candidate_max_heap.emplace( + HeapEntry{right_child_idx, A[right_child_idx]}); + } + } + return result; +} + +// clang-format off + + +int main(int argc, char* argv[]) { + std::vector args {argv + 1, argv + argc}; + std::vector param_names {"A", "k"}; + return GenericTestMain(args, "k_largest_in_heap.tsv", &KLargestInBinaryHeap, &UnorderedComparator>, param_names); +} +// clang-format on diff --git a/epi_judge_cpp_solutions/k_largest_values_in_bst.cc b/epi_judge_cpp_solutions/k_largest_values_in_bst.cc new file mode 100644 index 000000000..356b0b469 --- /dev/null +++ b/epi_judge_cpp_solutions/k_largest_values_in_bst.cc @@ -0,0 +1,39 @@ +#include +#include + +#include "bst_node.h" +#include "test_framework/generic_test.h" + +using std::unique_ptr; +using std::vector; + +void FindKLargestInBSTHelper(const unique_ptr>&, int, + vector*); + +vector FindKLargestInBST(const unique_ptr>& tree, int k) { + vector k_largest_elements; + FindKLargestInBSTHelper(tree, k, &k_largest_elements); + return k_largest_elements; +} + +void FindKLargestInBSTHelper(const unique_ptr>& tree, int k, + vector* k_largest_elements) { + // Perform reverse inorder traversal. + if (tree && size(*k_largest_elements) < k) { + FindKLargestInBSTHelper(tree->right, k, k_largest_elements); + if (size(*k_largest_elements) < k) { + k_largest_elements->emplace_back(tree->data); + FindKLargestInBSTHelper(tree->left, k, k_largest_elements); + } + } +} + +// clang-format off + + +int main(int argc, char* argv[]) { + std::vector args {argv + 1, argv + argc}; + std::vector param_names {"tree", "k"}; + return GenericTestMain(args, "k_largest_values_in_bst.tsv", &FindKLargestInBST, &UnorderedComparator>, param_names); +} +// clang-format on diff --git a/epi_judge_cpp_solutions/knapsack.cc b/epi_judge_cpp_solutions/knapsack.cc new file mode 100644 index 000000000..3bc595dcc --- /dev/null +++ b/epi_judge_cpp_solutions/knapsack.cc @@ -0,0 +1,65 @@ +#include +#include +#include +#include + +#include "test_framework/generic_test.h" +#include "test_framework/test_utils_serialization_traits.h" + +using std::make_unique; +using std::max; +using std::min; +using std::vector; + +struct Item; +int OptimumSubjectToItemAndCapacity(const vector&, int, int, + vector>*); + +struct Item { + int weight, value; +}; + +int OptimumSubjectToCapacity(const vector& items, int capacity) { + return OptimumSubjectToItemAndCapacity( + items, size(items) - 1, capacity, + make_unique>>(size(items), + vector(capacity + 1, -1)) + .get()); +} + +// Returns the optimum value when we choose from items[0, k] and have a +// capacity of available_capacity. +int OptimumSubjectToItemAndCapacity(const vector& items, int k, + int available_capacity, + vector>* V_ptr) { + if (k < 0) { + // No items can be chosen. + return 0; + } + + // V[i][j] holds the optimum value when we choose from items[0, i] and have + // a capacity of j. + vector>& V = *V_ptr; + if (V[k][available_capacity] == -1) { + int without_curr_item = OptimumSubjectToItemAndCapacity( + items, k - 1, available_capacity, V_ptr); + int with_curr_item = + available_capacity < items[k].weight + ? 0 + : items[k].value + OptimumSubjectToItemAndCapacity( + items, k - 1, + available_capacity - items[k].weight, V_ptr); + V[k][available_capacity] = max(without_curr_item, with_curr_item); + } + return V[k][available_capacity]; +} + +template <> +struct SerializationTraits : UserSerTraits {}; + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"items", "capacity"}; + return GenericTestMain(args, "knapsack.tsv", &OptimumSubjectToCapacity, + DefaultComparator{}, param_names); +} diff --git a/epi_judge_cpp_solutions/kth_largest_element_in_two_sorted_arrays.cc b/epi_judge_cpp_solutions/kth_largest_element_in_two_sorted_arrays.cc new file mode 100644 index 000000000..fb42b758a --- /dev/null +++ b/epi_judge_cpp_solutions/kth_largest_element_in_two_sorted_arrays.cc @@ -0,0 +1,48 @@ +#include +#include +#include +#include "test_framework/generic_test.h" + +using std::max; +using std::min; +using std::numeric_limits; +using std::vector; + +int FindKthInTwoSortedArrays(const vector& A, const vector& B, + int k) { + // Lower bound of elements we will choose in A. + int b = max(0, static_cast(k - size(B))); + // Upper bound of elements we will choose in A. + int t = min(static_cast(size(A)), k); + + while (b < t) { + int x = b + ((t - b) / 2); + int A_x_1 = x <= 0 ? numeric_limits::min() : A[x - 1]; + int A_x = x >= size(A) ? numeric_limits::max() : A[x]; + int B_k_x_1 = k - x <= 0 ? numeric_limits::min() : B[k - x - 1]; + int B_k_x = k - x >= size(B) ? numeric_limits::max() : B[k - x]; + + if (A_x < B_k_x_1) { + b = x + 1; + } else if (A_x_1 > B_k_x) { + t = x - 1; + } else { + // B[k - x - 1] <= A[x] && A[x - 1] < B[k - x]. + return max(A_x_1, B_k_x_1); + } + } + + int A_b_1 = b <= 0 ? numeric_limits::min() : A[b - 1]; + int B_k_b_1 = k - b - 1 < 0 ? numeric_limits::min() : B[k - b - 1]; + return max(A_b_1, B_k_b_1); +} + +// clang-format off + + +int main(int argc, char* argv[]) { + std::vector args {argv + 1, argv + argc}; + std::vector param_names {"A", "B", "k"}; + return GenericTestMain(args, "kth_largest_element_in_two_sorted_arrays.tsv", &FindKthInTwoSortedArrays, DefaultComparator{}, param_names); +} +// clang-format on diff --git a/epi_judge_cpp_solutions/kth_largest_in_array.cc b/epi_judge_cpp_solutions/kth_largest_in_array.cc new file mode 100644 index 000000000..6f00c68e6 --- /dev/null +++ b/epi_judge_cpp_solutions/kth_largest_in_array.cc @@ -0,0 +1,92 @@ +#include +#include +#include +#include +#include +#include "test_framework/generic_test.h" + +using std::default_random_engine; +using std::greater; +using std::length_error; +using std::less; +using std::random_device; +using std::swap; +using std::uniform_int_distribution; +using std::vector; + +template +int FindKth(int, Compare, vector*); +template +int PartitionAroundPivot(int, int, int, Compare, vector*); + +// The numbering starts from one, i.e., if A = [3, 1, -1, 2] then +// FindKthLargest(1, A) returns 3, FindKthLargest(2, A) returns 2, +// FindKthLargest(3, A) returns 1, and FindKthLargest(4, A) returns -1. +int FindKthLargest(int k, vector* A_ptr) { + return FindKth(k, greater(), A_ptr); +} + +// The numbering starts from one, i.e., if A = [3, 1, -1, 2] then +// FindKthSmallest(1, A) returns -1, FindKthSmallest(2, A) returns 1, +// FindKthSmallest(3, A) returns 2, and FindKthSmallest(4, A) returns 3. +int FindKthSmallest(int k, vector* A_ptr) { + return FindKth(k, less(), A_ptr); +} +template +int FindKth(int k, Compare comp, vector* A_ptr) { + vector& A = *A_ptr; + int left = 0, right = size(A) - 1; + default_random_engine gen((random_device())()); + while (left <= right) { + // Generates a random integer in [left, right]. + int pivot_idx = uniform_int_distribution{left, right}(gen); + + if (int new_pivot_idx = + PartitionAroundPivot(left, right, pivot_idx, comp, &A); + new_pivot_idx == k - 1) { + return A[new_pivot_idx]; + } else if (new_pivot_idx > k - 1) { + right = new_pivot_idx - 1; + } else { // new_pivot_idx < k - 1. + left = new_pivot_idx + 1; + } + } + throw length_error("no k-th node in array A"); +} + +// Partition A[left, right] around pivot_idx, returns the new index of the +// pivot, new_pivot_idx, after partition. After partitioning, A[left, +// new_pivot_idx - 1] contains elements that are "greater than" the pivot, and +// A[new_pivot_idx + 1, right] contains elements that are "less than" the +// pivot. +// +// Note: "greater than" and "less than" are defined by the Compare object. +// +// Returns the new index of the pivot element after partition. +template +int PartitionAroundPivot(int left, int right, int pivot_idx, Compare comp, + vector* A_ptr) { + vector& A = *A_ptr; + int pivot_value = A[pivot_idx]; + int new_pivot_idx = left; + swap(A[pivot_idx], A[right]); + for (int i = left; i < right; ++i) { + if (comp(A[i], pivot_value)) { + swap(A[i], A[new_pivot_idx++]); + } + } + swap(A[right], A[new_pivot_idx]); + return new_pivot_idx; +} + +int FindKthLargestWrapper(int k, vector& A) { + return FindKthLargest(k, &A); +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"k", "A"}; + return GenericTestMain(args, "kth_largest_in_array.tsv", + &FindKthLargestWrapper, DefaultComparator{}, + param_names); +} diff --git a/epi_judge_cpp_solutions/kth_node_in_tree.cc b/epi_judge_cpp_solutions/kth_node_in_tree.cc new file mode 100644 index 000000000..a75dce266 --- /dev/null +++ b/epi_judge_cpp_solutions/kth_node_in_tree.cc @@ -0,0 +1,119 @@ +#include +#include +#include +#include + +#include "test_framework/binary_tree_utils.h" +#include "test_framework/generic_test.h" +#include "test_framework/test_failure.h" +#include "test_framework/test_utils_serialization_traits.h" + +using std::unique_ptr; + +template +struct BinaryTreeNode { + T data; + unique_ptr> left, right; + int size; +}; + +const BinaryTreeNode* FindKthNodeBinaryTree( + const unique_ptr>& tree, int k) { + const auto* iter = tree.get(); + while (iter != nullptr) { + int left_size = iter->left ? iter->left->size : 0; + if (left_size + 1 < k) { // k-th node must be in right subtree of iter. + k -= (left_size + 1); + iter = iter->right.get(); + } else if (left_size == k - 1) { // k-th is iter itself. + return iter; + } else { // k-th node must be in left subtree of iter. + iter = iter->left.get(); + } + } + // If k is between 1 and the tree size, this line is unreachable. + return nullptr; +} + +template +struct SerializationTraits>> { + using key_traits = SerializationTraits; + using node_type = BinaryTreeNode; + using serialization_type = unique_ptr; + + static const char* Name() { + static std::string s = + std::string("binary_tree(") + key_traits::Name() + ")"; + return s.c_str(); + } + + static serialization_type Parse(const std::string& str) { + auto v = SerializationTraits>::Parse(str); + return buildTreeFromVector(v); + } + + static serialization_type JsonParse(std::istream& in) { + auto v = SerializationTraits>::JsonParse(in); + return buildTreeFromVector(v); + } + + static serialization_type buildTreeFromVector( + const std::vector& data) { + if (data.empty()) throw std::runtime_error("Tree parser: missing data"); + + std::vector nodes; + + for (auto& x : data) { + nodes.emplace_back(x == "null" ? nullptr + : new node_type{key_traits::Parse(x), + nullptr, nullptr, 0}); + } + std::vector candidate_children(rbegin(nodes), rend(nodes)); + auto root = serialization_type(candidate_children.back()); + candidate_children.pop_back(); + + for (const auto& node : nodes) { + if (node) { + if (!candidate_children.empty()) { + node->left = serialization_type(candidate_children.back()); + candidate_children.pop_back(); + } else + node->left = nullptr; + if (!candidate_children.empty()) { + node->right = serialization_type(candidate_children.back()); + candidate_children.pop_back(); + } else + node->right = nullptr; + } + } + initSize(root); + return root; + } + + static int initSize(const serialization_type& node) { + if (!node) return 0; + node->size = 1 + initSize(node->left) + initSize(node->right); + return node->size; + } + + static bool Equal(const serialization_type& a, const serialization_type& b) { + return EqualBinaryTrees(a, b); + } +}; + +int FindKthNodeBinaryTreeWrapper(const unique_ptr>& tree, + int k) { + auto result = FindKthNodeBinaryTree(tree, k); + if (!result) { + throw TestFailure("Result can't be nullptr"); + } + return result->data; +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"tree", "k"}; + return GenericTestMain(args, "kth_node_in_tree.tsv", + &FindKthNodeBinaryTreeWrapper, DefaultComparator{}, + param_names); +} diff --git a/epi_judge_cpp_solutions/largest_rectangle_under_skyline.cc b/epi_judge_cpp_solutions/largest_rectangle_under_skyline.cc new file mode 100644 index 000000000..c30c0bd07 --- /dev/null +++ b/epi_judge_cpp_solutions/largest_rectangle_under_skyline.cc @@ -0,0 +1,45 @@ +#include +#include +#include +#include "test_framework/generic_test.h" + +using std::max; +using std::stack; +using std::vector; + +bool IsNewPillarOrReachEnd(const vector&, int, int); + +int CalculateLargestRectangle(const vector& heights) { + stack pillar_indices; + int max_rectangle_area = 0; + // By iterating to size(heights) instead of size(heights) - 1, we can + // uniformly handle the computation for rectangle area here. + for (int i = 0; i <= size(heights); ++i) { + while (!empty(pillar_indices) && + IsNewPillarOrReachEnd(heights, i, pillar_indices.top())) { + int height = heights[pillar_indices.top()]; + pillar_indices.pop(); + int width = empty(pillar_indices) ? i : i - pillar_indices.top() - 1; + max_rectangle_area = max(max_rectangle_area, height * width); + } + pillar_indices.emplace(i); + } + return max_rectangle_area; +} + +bool IsNewPillarOrReachEnd(const vector& heights, int curr_idx, + int last_pillar_idx) { + return curr_idx < size(heights) + ? heights[curr_idx] <= heights[last_pillar_idx] + : true; +} + +// clang-format off + + +int main(int argc, char* argv[]) { + std::vector args {argv + 1, argv + argc}; + std::vector param_names {"heights"}; + return GenericTestMain(args, "largest_rectangle_under_skyline.tsv", &CalculateLargestRectangle, DefaultComparator{}, param_names); +} +// clang-format on diff --git a/epi_judge_cpp_solutions/left_right_justify_text.cc b/epi_judge_cpp_solutions/left_right_justify_text.cc new file mode 100644 index 000000000..efec55b42 --- /dev/null +++ b/epi_judge_cpp_solutions/left_right_justify_text.cc @@ -0,0 +1,49 @@ +#include +#include +#include +#include +#include +#include "test_framework/generic_test.h" + +using std::accumulate; +using std::max; +using std::string; +using std::vector; + +string Join(const vector&, const string&); + +vector JustifyText(const vector& words, int L) { + int curr_line_length = 0; + vector result, curr_line; + for (const string& word : words) { + if (curr_line_length + size(word) + size(curr_line) > L) { + for (int i = 0; i < L - curr_line_length; ++i) { + curr_line[i % max(static_cast(size(curr_line)) - 1, 1)] += ' '; + } + result.emplace_back(Join(curr_line, "")); + curr_line.clear(); + curr_line_length = 0; + } + curr_line.emplace_back(word); + curr_line_length += size(word); + } + // Handles the last line. Last line is to be left-aligned. + result.emplace_back( + Join(curr_line, " ") + .append(L - curr_line_length - (size(curr_line) - 1), ' ')); + return result; +} + +string Join(const vector& words, const string& delimiter) { + return accumulate(next(begin(words)), end(words), words.front(), + [delimiter](const string& result, const string& word) { + return result + delimiter + word; + }); +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"words", "L"}; + return GenericTestMain(args, "left_right_justify_text.tsv", &JustifyText, + DefaultComparator{}, param_names); +} diff --git a/epi_judge_cpp_solutions/levenshtein_distance.cc b/epi_judge_cpp_solutions/levenshtein_distance.cc new file mode 100644 index 000000000..0839fd445 --- /dev/null +++ b/epi_judge_cpp_solutions/levenshtein_distance.cc @@ -0,0 +1,59 @@ +#include +#include +#include +#include +#include "test_framework/generic_test.h" + +using std::make_unique; +using std::min; +using std::string; +using std::vector; + +int ComputeDistanceBetweenPrefixes(const string&, int, const string&, int, + vector>*); + +int LevenshteinDistance(const string& A, const string& B) { + vector> distance_between_prefixes(size(A), + vector(size(B), -1)); + return ComputeDistanceBetweenPrefixes( + A, size(A) - 1, B, size(B) - 1, + make_unique>>(size(A), vector(size(B), -1)) + .get()); +} + +int ComputeDistanceBetweenPrefixes( + const string& A, int A_idx, const string& B, int B_idx, + vector>* distance_between_prefixes_ptr) { + vector>& distance_between_prefixes = + *distance_between_prefixes_ptr; + if (A_idx < 0) { + // A is empty so add all of B's characters. + return B_idx + 1; + } else if (B_idx < 0) { + // B is empty so delete all of A's characters. + return A_idx + 1; + } + if (distance_between_prefixes[A_idx][B_idx] == -1) { + if (A[A_idx] == B[B_idx]) { + distance_between_prefixes[A_idx][B_idx] = ComputeDistanceBetweenPrefixes( + A, A_idx - 1, B, B_idx - 1, distance_between_prefixes_ptr); + } else { + int substitute_last = ComputeDistanceBetweenPrefixes( + A, A_idx - 1, B, B_idx - 1, distance_between_prefixes_ptr); + int add_last = ComputeDistanceBetweenPrefixes( + A, A_idx - 1, B, B_idx, distance_between_prefixes_ptr); + int delete_last = ComputeDistanceBetweenPrefixes( + A, A_idx, B, B_idx - 1, distance_between_prefixes_ptr); + distance_between_prefixes[A_idx][B_idx] = + 1 + min({substitute_last, add_last, delete_last}); + } + } + return distance_between_prefixes[A_idx][B_idx]; +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"A", "B"}; + return GenericTestMain(args, "levenshtein_distance.tsv", &LevenshteinDistance, + DefaultComparator{}, param_names); +} diff --git a/epi_judge_cpp_solutions/line_through_most_points.cc b/epi_judge_cpp_solutions/line_through_most_points.cc new file mode 100644 index 000000000..439a97a58 --- /dev/null +++ b/epi_judge_cpp_solutions/line_through_most_points.cc @@ -0,0 +1,78 @@ +#include +#include +#include +#include +#include + +#include "test_framework/generic_test.h" +#include "test_framework/test_utils_serialization_traits.h" + +using std::hash; +using std::max; +using std::max_element; +using std::pair; +using std::unordered_map; +using std::vector; + +struct Point { + int x, y; +}; + +// Hash function for a pair. +struct HashPair { + size_t operator()(const pair& p) const { + return static_cast(31) * p.first + p.second; + } +}; + +int FindLineWithMostPoints(const vector& points) { + int result = 0; + for (int i = 0; i < size(points); ++i) { + unordered_map, int, HashPair> slope_table; + int overlap_points = 1; + for (int j = i + 1; j < size(points); ++j) { + if (points[i].x == points[j].x && points[i].y == points[j].y) { + ++overlap_points; + } else { + if (int x_diff = points[i].x - points[j].x, + y_diff = points[i].y - points[j].y; + x_diff == 0) { + // A vertical line with slope 1/0. + slope_table[{x_diff, 1}] += 1; + } else { + int gcd = std::gcd(x_diff, y_diff); + x_diff /= gcd, y_diff /= gcd; + if (x_diff < 0) { + x_diff = -x_diff, y_diff = -y_diff; + } + slope_table[{x_diff, y_diff}] += 1; + } + } + } + result = + max(result, overlap_points + + (empty(slope_table) + ? 0 + : max_element(begin(slope_table), end(slope_table), + [](const auto& a, const auto& b) { + return a.second < b.second; + }) + ->second)); + } + return result; +} + +template <> +struct SerializationTraits : UserSerTraits {}; + +bool operator==(const Point& lhs, const Point& rhs) { + return std::tie(lhs.x, lhs.y) == std::tie(rhs.x, rhs.y); +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"points"}; + return GenericTestMain(args, "line_through_most_points.tsv", + &FindLineWithMostPoints, DefaultComparator{}, + param_names); +} diff --git a/epi_judge_cpp_solutions/list_cyclic_right_shift.cc b/epi_judge_cpp_solutions/list_cyclic_right_shift.cc new file mode 100644 index 000000000..4f824fa39 --- /dev/null +++ b/epi_judge_cpp_solutions/list_cyclic_right_shift.cc @@ -0,0 +1,42 @@ +#include + +#include "list_node.h" +#include "test_framework/generic_test.h" + +using std::shared_ptr; + +shared_ptr> CyclicallyRightShiftList(shared_ptr> L, + int k) { + if (L == nullptr) { + return L; + } + + // Computes the length of L and the tail. + auto tail = L; + int n = 1; + while (tail->next) { + ++n, tail = tail->next; + } + k %= n; + if (k == 0) { + return L; + } + + tail->next = L; // Makes a cycle by connecting the tail to the head. + int steps_to_new_head = n - k; + auto new_tail = tail; + while (steps_to_new_head--) { + new_tail = new_tail->next; + } + auto new_head = new_tail->next; + new_tail->next = nullptr; + return new_head; +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"L", "k"}; + return GenericTestMain(args, "list_cyclic_right_shift.tsv", + &CyclicallyRightShiftList, DefaultComparator{}, + param_names); +} diff --git a/epi_judge_cpp_solutions/list_node.h b/epi_judge_cpp_solutions/list_node.h new file mode 100644 index 000000000..87ae76419 --- /dev/null +++ b/epi_judge_cpp_solutions/list_node.h @@ -0,0 +1,113 @@ +#include +#include +#include "test_framework/test_utils_serialization_traits.h" +#pragma once + +using std::make_shared; +using std::shared_ptr; + +template +struct ListNode { + T data; + + // We need to use a shared pointer since multiple nodes may point to a + // single node. For example, in the following list, two nodes, 1 and 4, + // point to node 2. + // 0->1->2->3->4 + // ^ | + // |_____| + shared_ptr> next; + ListNode(T data = {}, shared_ptr> next = nullptr) + : data(data), next(next) {} + + ~ListNode() { + // Extra-long lists cause stack overflow with default destructor + // implementation + while (next && next.unique()) { + auto next_next = next->next; + next->next.reset(); + next = next_next; + } + } + + bool operator==(const ListNode& that) const { + const ListNode* a = this; + const ListNode* b = &that; + while (a && b) { + if (a->data != b->data) { + return false; + } + a = a->next.get(); + b = b->next.get(); + } + return a == nullptr && b == nullptr; + } +}; + +template +bool EqualList(shared_ptr> a, shared_ptr> b) { + return (!a && !b) || (a && b && *a == *b); +} + +template +std::shared_ptr> ConvertArrayToLinkedList(const std::vector& v) { + std::shared_ptr> head; + for (auto it = rbegin(v); it != rend(v); ++it) { + head = std::make_shared>(*it, head); + } + return head; +} + +template +struct SerializationTraits>> { + using serialization_type = + shared_ptr::serialization_type>>; + + static const char* Name() { + static std::string cached = + std::string("linked_list(") + SerializationTraits::Name() + ")"; + return cached.c_str(); + } + + static serialization_type Parse(const std::string& str) { + auto v = SerializationTraits>::Parse(str); + return ConvertArrayToLinkedList(v); + } + + static serialization_type JsonParse(std::istream& in) { + auto v = SerializationTraits>::JsonParse(in); + return ConvertArrayToLinkedList(v); + } + + static bool Equal(const serialization_type& a, const serialization_type& b) { + return EqualList(a, b); + } + + static void Print(std::ostream& out, serialization_type list) { + std::set visited; + bool first = true; + + while (list) { + if (first) { + first = false; + } else { + out << " -> "; + } + + if (visited.count(list)) { + // Cycled linked list + if (list->next != list) { + PrintTo(out, list->data); + out << " -> ... -> "; + } + PrintTo(out, list->data); + out << " -> ..."; + break; + } else { + PrintTo(out, list->data); + visited.insert(list); + } + list = list->next; + } + } +}; diff --git a/epi_judge_cpp_solutions/longest_contained_interval.cc b/epi_judge_cpp_solutions/longest_contained_interval.cc new file mode 100644 index 000000000..e29b3106f --- /dev/null +++ b/epi_judge_cpp_solutions/longest_contained_interval.cc @@ -0,0 +1,45 @@ +#include +#include +#include +#include +#include "test_framework/generic_test.h" + +using std::max; +using std::unordered_set; +using std::vector; + +int LongestContainedRange(const vector& A) { + // unprocessed_entries records the existence of each entry in A. + unordered_set unprocessed_entries(begin(A), end(A)); + + int max_interval_size = 0; + while (!empty(unprocessed_entries)) { + int a = *begin(unprocessed_entries); + unprocessed_entries.erase(a); + + // Finds the lower bound of the largest range containing a. + int lower_bound = a - 1; + while (unprocessed_entries.count(lower_bound)) { + unprocessed_entries.erase(lower_bound); + --lower_bound; + } + + // Finds the upper bound of the largest range containing a. + int upper_bound = a + 1; + while (unprocessed_entries.count(upper_bound)) { + unprocessed_entries.erase(upper_bound); + ++upper_bound; + } + + max_interval_size = max(max_interval_size, upper_bound - lower_bound - 1); + } + return max_interval_size; +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"A"}; + return GenericTestMain(args, "longest_contained_interval.tsv", + &LongestContainedRange, DefaultComparator{}, + param_names); +} diff --git a/epi_judge_cpp_solutions/longest_increasing_subarray.cc b/epi_judge_cpp_solutions/longest_increasing_subarray.cc new file mode 100644 index 000000000..dbbee8320 --- /dev/null +++ b/epi_judge_cpp_solutions/longest_increasing_subarray.cc @@ -0,0 +1,50 @@ +#include +#include "test_framework/generic_test.h" + +using std::vector; + +struct Subarray { + int start = 0, end = 0; +}; + +Subarray FindLongestIncreasingSubarray(const vector& A) { + int max_length = 1; + Subarray result; + int i = 0; + while (i < size(A) - max_length) { + // Backward check and skip if A[j - 1] >= A[j]. + bool is_skippable = false; + for (int j = i + max_length; j > i; --j) { + if (A[j - 1] >= A[j]) { + i = j; + is_skippable = true; + break; + } + } + + // Forward check if it is not skippable. + if (!is_skippable) { + i += max_length; + while (i < size(A) && A[i - 1] < A[i]) { + ++i, ++max_length; + } + result = {i - max_length, i - 1}; + } + } + return result; +} + +int FindLongestIncreasingSubarrayWrapper(const vector& A) { + Subarray result = FindLongestIncreasingSubarray(A); + return result.end - result.start + 1; +} + +// clang-format off + + +int main(int argc, char* argv[]) { + std::vector args {argv + 1, argv + argc}; + std::vector param_names {"A"}; + return GenericTestMain(args, "longest_increasing_subarray.tsv", &FindLongestIncreasingSubarrayWrapper, DefaultComparator{}, param_names); +} +// clang-format on diff --git a/epi_judge_cpp_solutions/longest_nondecreasing_subsequence.cc b/epi_judge_cpp_solutions/longest_nondecreasing_subsequence.cc new file mode 100644 index 000000000..652e009b4 --- /dev/null +++ b/epi_judge_cpp_solutions/longest_nondecreasing_subsequence.cc @@ -0,0 +1,31 @@ +#include +#include +#include "test_framework/generic_test.h" + +using std::max; +using std::max_element; +using std::vector; + +int LongestNondecreasingSubsequenceLength(const vector& A) { + // max_length[i] holds the length of the longest nondecreasing subsequence + // of A[0, i]. + vector max_length(size(A), 1); + for (int i = 1; i < size(A); ++i) { + for (int j = 0; j < i; ++j) { + if (A[i] >= A[j]) { + max_length[i] = max(max_length[i], max_length[j] + 1); + } + } + } + return *max_element(begin(max_length), end(max_length)); +} + +// clang-format off + + +int main(int argc, char* argv[]) { + std::vector args {argv + 1, argv + argc}; + std::vector param_names {"A"}; + return GenericTestMain(args, "longest_nondecreasing_subsequence.tsv", &LongestNondecreasingSubsequenceLength, DefaultComparator{}, param_names); +} +// clang-format on diff --git a/epi_judge_cpp_solutions/longest_subarray_with_distinct_values.cc b/epi_judge_cpp_solutions/longest_subarray_with_distinct_values.cc new file mode 100644 index 000000000..2a66b51cb --- /dev/null +++ b/epi_judge_cpp_solutions/longest_subarray_with_distinct_values.cc @@ -0,0 +1,38 @@ +#include +#include +#include +#include "test_framework/generic_test.h" + +using std::max; +using std::unordered_map; +using std::vector; + +int LongestSubarrayWithDistinctEntries(const vector& A) { + // Records the most recent occurrences of each entry. + unordered_map most_recent_occurrence; + size_t longest_dup_free_subarray_start_idx = 0, result = 0; + for (size_t i = 0; i < size(A); ++i) { + const auto & [ inserted_entry, inserted_happen ] = + most_recent_occurrence.emplace(A[i], i); + // Defer updating dup_idx until we see a duplicate. + if (!inserted_happen) { + // A[i] appeared before. Did it appear in the longest current subarray? + if (inserted_entry->second >= longest_dup_free_subarray_start_idx) { + result = max(result, i - longest_dup_free_subarray_start_idx); + longest_dup_free_subarray_start_idx = inserted_entry->second + 1; + } + inserted_entry->second = i; + } + } + return max(result, size(A) - longest_dup_free_subarray_start_idx); +} + +// clang-format off + + +int main(int argc, char* argv[]) { + std::vector args {argv + 1, argv + argc}; + std::vector param_names {"A"}; + return GenericTestMain(args, "longest_subarray_with_distinct_values.tsv", &LongestSubarrayWithDistinctEntries, DefaultComparator{}, param_names); +} +// clang-format on diff --git a/epi_judge_cpp_solutions/longest_subarray_with_sum_constraint.cc b/epi_judge_cpp_solutions/longest_subarray_with_sum_constraint.cc new file mode 100644 index 000000000..83fcc99ee --- /dev/null +++ b/epi_judge_cpp_solutions/longest_subarray_with_sum_constraint.cc @@ -0,0 +1,51 @@ +#include +#include +#include +#include "test_framework/generic_test.h" + +using std::min; +using std::vector; + +int FindLongestSubarrayLessEqualK(const vector& A, int k) { + // Builds the prefix sum according to A. + vector prefix_sum; + partial_sum(cbegin(A), cend(A), back_inserter(prefix_sum)); + + // Early returns if the sum of A is smaller than or equal to k. + if (prefix_sum.back() <= k) { + return size(A); + } + + // Builds min_prefix_sum. + vector min_prefix_sum(size(A)); + min_prefix_sum.back() = prefix_sum.back(); + for (int i = size(min_prefix_sum) - 2; i >= 0; --i) { + min_prefix_sum[i] = min(prefix_sum[i], min_prefix_sum[i + 1]); + } + + int a = 0, b = 0, max_length = 0; + while (a < size(A) && b < size(A)) { + if (int min_curr_sum = + a > 0 ? min_prefix_sum[b] - prefix_sum[a - 1] : min_prefix_sum[b]; + min_curr_sum <= k) { + int curr_length = b - a + 1; + if (curr_length > max_length) { + max_length = curr_length; + } + ++b; + } else { // min_curr_sum > k. + ++a; + } + } + return max_length; +} + +// clang-format off + + +int main(int argc, char* argv[]) { + std::vector args {argv + 1, argv + argc}; + std::vector param_names {"A", "k"}; + return GenericTestMain(args, "longest_subarray_with_sum_constraint.tsv", &FindLongestSubarrayLessEqualK, DefaultComparator{}, param_names); +} +// clang-format on diff --git a/epi_judge_cpp_solutions/longest_substring_with_matching_parentheses.cc b/epi_judge_cpp_solutions/longest_substring_with_matching_parentheses.cc new file mode 100644 index 000000000..cd8d00a5f --- /dev/null +++ b/epi_judge_cpp_solutions/longest_substring_with_matching_parentheses.cc @@ -0,0 +1,64 @@ +#include +#include +#include +#include +#include "test_framework/generic_test.h" + +using std::max; +using std::stack; +using std::string; +using std::vector; + +int LongestMatchingParentheses(const string& s) { + int max_length = 0, end = -1; + stack left_parentheses_indices; + for (int i = 0; i < size(s); ++i) { + if (s[i] == '(') { + left_parentheses_indices.emplace(i); + } else if (empty(left_parentheses_indices)) { + end = i; + } else { + left_parentheses_indices.pop(); + int start = empty(left_parentheses_indices) + ? end + : left_parentheses_indices.top(); + max_length = max(max_length, i - start); + } + } + return max_length; +} + +template +int ParseFromSide(char paren, IterType begin, IterType end) { + int max_length = 0, num_parens_so_far = 0, length = 0; + for (IterType i = begin; i < end; ++i) { + if (*i == paren) { + ++num_parens_so_far, ++length; + } else { // *i != paren + if (num_parens_so_far <= 0) { + num_parens_so_far = length = 0; + } else { + --num_parens_so_far, ++length; + if (num_parens_so_far == 0) { + max_length = max(max_length, length); + } + } + } + } + return max_length; +} + +int LongestMatchingParenthesesConstantSpace(const string& s) { + return max(ParseFromSide('(', begin(s), end(s)), + ParseFromSide(')', rbegin(s), rend(s))); +} + +// clang-format off + + +int main(int argc, char* argv[]) { + std::vector args {argv + 1, argv + argc}; + std::vector param_names {"s"}; + return GenericTestMain(args, "longest_substring_with_matching_parentheses.tsv", &LongestMatchingParentheses, DefaultComparator{}, param_names); +} +// clang-format on diff --git a/epi_judge_cpp_solutions/look_and_say.cc b/epi_judge_cpp_solutions/look_and_say.cc new file mode 100644 index 000000000..468681be9 --- /dev/null +++ b/epi_judge_cpp_solutions/look_and_say.cc @@ -0,0 +1,34 @@ +#include +#include "test_framework/generic_test.h" + +using std::string; +using std::to_string; + +string NextNumber(const string& s); + +string LookAndSay(int n) { + string s = "1"; + for (int i = 1; i < n; ++i) { + s = NextNumber(s); + } + return s; +} + +string NextNumber(const string& s) { + string result; + for (int i = 0; i < size(s); ++i) { + int count = 1; + while (i + 1 < size(s) && s[i] == s[i + 1]) { + ++i, ++count; + } + result += to_string(count) + s[i]; + } + return result; +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"n"}; + return GenericTestMain(args, "look_and_say.tsv", &LookAndSay, + DefaultComparator{}, param_names); +} diff --git a/epi_judge_cpp_solutions/lowest_common_ancestor.cc b/epi_judge_cpp_solutions/lowest_common_ancestor.cc new file mode 100644 index 000000000..841358739 --- /dev/null +++ b/epi_judge_cpp_solutions/lowest_common_ancestor.cc @@ -0,0 +1,72 @@ +#include + +#include "binary_tree_node.h" +#include "test_framework/binary_tree_utils.h" +#include "test_framework/generic_test.h" +#include "test_framework/test_failure.h" +#include "test_framework/timed_executor.h" + +using std::unique_ptr; + +struct Status; +Status LCAHelper(const unique_ptr>&, + const unique_ptr>&, + const unique_ptr>&); +struct Status { + int num_target_nodes; + BinaryTreeNode* ancestor; +}; + +BinaryTreeNode* LCA(const unique_ptr>& tree, + const unique_ptr>& node0, + const unique_ptr>& node1) { + return LCAHelper(tree, node0, node1).ancestor; +} + +// Returns an object consisting of an int and a node. The int field is +// 0, 1, or 2 depending on how many of {node0, node1} are present in +// the tree. If both are present in the tree, when ancestor is +// assigned to a non-null value, it is the LCA. +Status LCAHelper(const unique_ptr>& tree, + const unique_ptr>& node0, + const unique_ptr>& node1) { + if (tree == nullptr) { + return {0, nullptr}; + } + + auto left_result = LCAHelper(tree->left, node0, node1); + if (left_result.num_target_nodes == 2) { + // Found both nodes in the left subtree. + return left_result; + } + auto right_result = LCAHelper(tree->right, node0, node1); + if (right_result.num_target_nodes == 2) { + // Found both nodes in the right subtree. + return right_result; + } + int num_target_nodes = left_result.num_target_nodes + + right_result.num_target_nodes + (tree == node0) + + (tree == node1); + return {num_target_nodes, num_target_nodes == 2 ? tree.get() : nullptr}; +} + +int LcaWrapper(TimedExecutor& executor, + const unique_ptr>& tree, int key0, + int key1) { + const unique_ptr>& node0 = MustFindNode(tree, key0); + const unique_ptr>& node1 = MustFindNode(tree, key1); + + auto result = executor.Run([&] { return LCA(tree, node0, node1); }); + + if (!result) { + throw TestFailure("Result can not be nullptr"); + } + return result->data; +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"executor", "tree", "key0", "key1"}; + return GenericTestMain(args, "lowest_common_ancestor.tsv", &LcaWrapper, + DefaultComparator{}, param_names); +} diff --git a/epi_judge_cpp_solutions/lowest_common_ancestor_close_ancestor.cc b/epi_judge_cpp_solutions/lowest_common_ancestor_close_ancestor.cc new file mode 100644 index 000000000..764c0ab29 --- /dev/null +++ b/epi_judge_cpp_solutions/lowest_common_ancestor_close_ancestor.cc @@ -0,0 +1,56 @@ +#include +#include +#include + +#include "binary_tree_with_parent_prototype.h" +#include "test_framework/binary_tree_utils.h" +#include "test_framework/generic_test.h" +#include "test_framework/test_failure.h" +#include "test_framework/timed_executor.h" + +using std::invalid_argument; +using std::unique_ptr; +using std::unordered_set; + +BinaryTreeNode* LCA(const unique_ptr>& node0, + const unique_ptr>& node1) { + BinaryTreeNode*iter0 = node0.get(), *iter1 = node1.get(); + unordered_set*> nodes_on_path_to_root; + while (iter0 || iter1) { + // Ascend tree in tandem for these two nodes. + if (iter0) { + if (nodes_on_path_to_root.emplace(iter0).second == false) { + return iter0; + } + iter0 = iter0->parent; + } + if (iter1) { + if (nodes_on_path_to_root.emplace(iter1).second == false) { + return iter1; + } + iter1 = iter1->parent; + } + } + throw invalid_argument("node0 and node1 are not in the same tree"); +} + +int LcaWrapper(TimedExecutor& executor, + const unique_ptr>& tree, int key0, + int key1) { + const unique_ptr>& node0 = MustFindNode(tree, key0); + const unique_ptr>& node1 = MustFindNode(tree, key1); + + auto result = executor.Run([&] { return LCA(node0, node1); }); + + if (!result) { + throw TestFailure("Result can not be nullptr"); + } + return result->data; +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"executor", "tree", "key0", "key1"}; + return GenericTestMain(args, "lowest_common_ancestor.tsv", &LcaWrapper, + DefaultComparator{}, param_names); +} diff --git a/epi_judge_cpp_solutions/lowest_common_ancestor_in_bst.cc b/epi_judge_cpp_solutions/lowest_common_ancestor_in_bst.cc new file mode 100644 index 000000000..a7e4b8e80 --- /dev/null +++ b/epi_judge_cpp_solutions/lowest_common_ancestor_in_bst.cc @@ -0,0 +1,48 @@ +#include + +#include "bst_node.h" +#include "test_framework/binary_tree_utils.h" +#include "test_framework/generic_test.h" +#include "test_framework/test_failure.h" +#include "test_framework/timed_executor.h" + +using std::unique_ptr; + +// Input nodes are nonempty and the key at s is less than or equal to that at +// b. +BstNode* FindLCA(const unique_ptr>& tree, + const unique_ptr>& s, + const unique_ptr>& b) { + auto* p = tree.get(); + while (p->data < s->data || p->data > b->data) { + // Keep searching since p is outside of [s, b]. + while (p->data < s->data) { + p = p->right.get(); // LCA must be in p's right child. + } + while (p->data > b->data) { + p = p->left.get(); // LCA must be in p's left child. + } + } + // Now, s->data <= p->data && p->data <= b->data. + return p; +} + +int LcaWrapper(TimedExecutor& executor, + const std::unique_ptr>& tree, int key0, int key1) { + const unique_ptr>& node0 = MustFindNode(tree, key0); + const unique_ptr>& node1 = MustFindNode(tree, key1); + + auto result = executor.Run([&] { return FindLCA(tree, node0, node1); }); + + if (!result) { + throw TestFailure("Result can not be nullptr"); + } + return result->data; +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"executor", "tree", "key0", "key1"}; + return GenericTestMain(args, "lowest_common_ancestor_in_bst.tsv", &LcaWrapper, + DefaultComparator{}, param_names); +} diff --git a/epi_judge_cpp_solutions/lowest_common_ancestor_with_parent.cc b/epi_judge_cpp_solutions/lowest_common_ancestor_with_parent.cc new file mode 100644 index 000000000..03dffaef9 --- /dev/null +++ b/epi_judge_cpp_solutions/lowest_common_ancestor_with_parent.cc @@ -0,0 +1,62 @@ +#include +#include + +#include "binary_tree_with_parent_prototype.h" +#include "test_framework/binary_tree_utils.h" +#include "test_framework/generic_test.h" +#include "test_framework/test_failure.h" +#include "test_framework/timed_executor.h" + +using std::swap; + +int GetDepth(const BinaryTreeNode*); + +BinaryTreeNode* LCA(const unique_ptr>& node0, + const unique_ptr>& node1) { + BinaryTreeNode*iter0 = node0.get(), *iter1 = node1.get(); + int depth0 = GetDepth(iter0), depth1 = GetDepth(iter1); + // Makes iter0 as the deeper node in order to simplify the code. + if (depth1 > depth0) { + swap(iter0, iter1); + } + // Ascends from the deeper node. + int depth_diff = abs(depth0 - depth1); + while (depth_diff--) { + iter0 = iter0->parent; + } + + // Now ascends both nodes until we reach the LCA. + while (iter0 != iter1) { + iter0 = iter0->parent, iter1 = iter1->parent; + } + return iter0; +} + +int GetDepth(const BinaryTreeNode* node) { + int depth = 0; + while (node->parent) { + ++depth, node = node->parent; + } + return depth; +} + +int LcaWrapper(TimedExecutor& executor, + const unique_ptr>& tree, int key0, + int key1) { + const unique_ptr>& node0 = MustFindNode(tree, key0); + const unique_ptr>& node1 = MustFindNode(tree, key1); + + auto result = executor.Run([&] { return LCA(node0, node1); }); + + if (!result) { + throw TestFailure("Result can not be nullptr"); + } + return result->data; +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"executor", "tree", "key0", "key1"}; + return GenericTestMain(args, "lowest_common_ancestor.tsv", &LcaWrapper, + DefaultComparator{}, param_names); +} diff --git a/epi_judge_cpp_solutions/lru_cache.cc b/epi_judge_cpp_solutions/lru_cache.cc new file mode 100644 index 000000000..84cb36199 --- /dev/null +++ b/epi_judge_cpp_solutions/lru_cache.cc @@ -0,0 +1,115 @@ +#include +#include +#include +#include +#include + +#include "test_framework/generic_test.h" +#include "test_framework/test_failure.h" +#include "test_framework/test_utils_serialization_traits.h" + +using std::list; +using std::pair; +using std::unordered_map; + +class LruCache { + public: + LruCache(size_t capacity) {} + explicit LruCache(int capacity) : capacity_(capacity) {} + + int Lookup(int isbn) { + if (auto it = isbn_price_table_.find(isbn); it == end(isbn_price_table_)) { + return -1; + } else { + int price = it->second.second; + // Since key has just been accessed, move it to the front. + MoveToFront(isbn, it); + return price; + } + } + + void Insert(int isbn, int price) { + // We add the value for key only if key is not present - we don't update + // existing values. + if (auto it = isbn_price_table_.find(isbn); it != end(isbn_price_table_)) { + // Specification says we should make isbn the most recently used. + MoveToFront(isbn, it); + } else { + if (size(isbn_price_table_) == capacity_) { + // Removes the least recently used ISBN to get space. + isbn_price_table_.erase(lru_queue_.back()); + lru_queue_.pop_back(); + } + lru_queue_.emplace_front(isbn); + isbn_price_table_[isbn] = {begin(lru_queue_), price}; + } + } + + bool Erase(int isbn) { + if (auto it = isbn_price_table_.find(isbn); it == end(isbn_price_table_)) { + return false; + } else { + lru_queue_.erase(it->second.first); + isbn_price_table_.erase(it); + return true; + } + } + + private: + typedef unordered_map::iterator, int>> Table; + + // Forces this key-value pair to move to the front. + void MoveToFront(int isbn, const Table::iterator& it) { + lru_queue_.erase(it->second.first); + lru_queue_.emplace_front(isbn); + it->second.first = begin(lru_queue_); + } + + int capacity_; + Table isbn_price_table_; + list lru_queue_; +}; + +struct Op { + std::string code; + int arg1; + int arg2; +}; + +template <> +struct SerializationTraits : UserSerTraits {}; + +void RunTest(const std::vector& commands) { + if (commands.empty() || commands[0].code != "LruCache") { + throw std::runtime_error("Expected LruCache as first command"); + } + LruCache cache(commands[0].arg1); + + for (int i = 1; i < commands.size(); i++) { + auto& cmd = commands[i]; + if (cmd.code == "lookup") { + int result = cache.Lookup(cmd.arg1); + if (result != cmd.arg2) { + throw TestFailure("Lookup: expected " + std::to_string(cmd.arg2) + + ", got " + std::to_string(result)); + } + } else if (cmd.code == "insert") { + cache.Insert(cmd.arg1, cmd.arg2); + } else if (cmd.code == "erase") { + bool result = cache.Erase(cmd.arg1); + if (result != cmd.arg2) { + throw TestFailure("Erase: expected " + std::to_string(cmd.arg2) + + ", got " + std::to_string(result)); + } + } else { + throw std::runtime_error("Unexpected command " + cmd.code); + } + } +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"commands"}; + return GenericTestMain(args, "lru_cache.tsv", &RunTest, DefaultComparator{}, + param_names); +} diff --git a/epi_judge_cpp_solutions/majority_element.cc b/epi_judge_cpp_solutions/majority_element.cc new file mode 100644 index 000000000..135fc0c81 --- /dev/null +++ b/epi_judge_cpp_solutions/majority_element.cc @@ -0,0 +1,35 @@ +#include +#include +#include "test_framework/generic_test.h" + +using std::string; +using std::vector; + +string MajoritySearch(vector::const_iterator stream_begin, + const vector::const_iterator stream_end) { + string candidate; + int candidate_count = 0; + while (stream_begin != stream_end) { + string it = *stream_begin++; + if (candidate_count == 0) { + candidate = it; + candidate_count = 1; + } else if (candidate == it) { + ++candidate_count; + } else { + --candidate_count; + } + } + return candidate; +} + +string MajoritySearchWrapper(const vector& stream) { + return MajoritySearch(cbegin(stream), cend(stream)); +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"stream"}; + return GenericTestMain(args, "majority_element.tsv", &MajoritySearchWrapper, + DefaultComparator{}, param_names); +} diff --git a/epi_judge_cpp_solutions/matrix_connected_regions.cc b/epi_judge_cpp_solutions/matrix_connected_regions.cc new file mode 100644 index 000000000..230698088 --- /dev/null +++ b/epi_judge_cpp_solutions/matrix_connected_regions.cc @@ -0,0 +1,70 @@ +#include +#include +#include +#include +#include + +#include "test_framework/generic_test.h" +#include "test_framework/timed_executor.h" + +using std::deque; +using std::initializer_list; +using std::make_pair; +using std::pair; +using std::queue; +using std::vector; + +void FlipColor(int x, int y, vector>* image_ptr) { + vector>& image = *image_ptr; + const bool color = image[x][y]; + + queue> q; + image[x][y] = !color; // Flips. + q.emplace(x, y); + while (!empty(q)) { + const auto[x, y] = q.front(); + q.pop(); + for (const auto & [ next_x, next_y ] : initializer_list>{ + {x, y + 1}, {x, y - 1}, {x + 1, y}, {x - 1, y}}) { + if (next_x >= 0 && next_x < size(image) && next_y >= 0 && + next_y < size(image[next_x]) && image[next_x][next_y] == color) { + // Flips the color. + image[next_x][next_y] = !color; + q.emplace(next_x, next_y); + } + } + } +} + +vector> FlipColorWrapper(TimedExecutor& executor, int x, int y, + vector> image) { + vector> b; + b.reserve(image.size()); + for (const vector& row : image) { + deque tmp; + tmp.resize(row.size()); + for (int i = 0; i < row.size(); ++i) { + tmp[i] = static_cast(row[i]); + } + b.push_back(tmp); + } + + executor.Run([&] { FlipColor(x, y, &b); }); + + image.resize(b.size()); + + for (int i = 0; i < image.size(); ++i) { + image[i].resize(b.size()); + for (int j = 0; j < image[i].size(); ++j) { + image[i][j] = b[i][j]; + } + } + return image; +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"executor", "x", "y", "image"}; + return GenericTestMain(args, "painting.tsv", &FlipColorWrapper, + DefaultComparator{}, param_names); +} diff --git a/epi_judge_cpp_solutions/matrix_enclosed_regions.cc b/epi_judge_cpp_solutions/matrix_enclosed_regions.cc new file mode 100644 index 000000000..87e3a1bff --- /dev/null +++ b/epi_judge_cpp_solutions/matrix_enclosed_regions.cc @@ -0,0 +1,92 @@ +#include +#include +#include +#include +#include +#include + +#include "test_framework/generic_test.h" +#include "test_framework/timed_executor.h" + +using std::deque; +using std::pair; +using std::queue; +using std::string; +using std::vector; + +void MarkBoundaryRegion(int, int, vector>*); + +void FillSurroundedRegions(vector>* board_ptr) { + vector>& board = *board_ptr; + // Identifies the regions that are reachable via white path starting from + // the first or last columns. + for (int i = 0; i < size(board); ++i) { + MarkBoundaryRegion(i, 0, board_ptr); + MarkBoundaryRegion(i, size(board[i]) - 1, board_ptr); + } + // Identifies the regions that are reachable via white path starting from + // the first or last rows. + for (int j = 0; j < size(board.front()); ++j) { + MarkBoundaryRegion(0, j, board_ptr); + MarkBoundaryRegion(size(board) - 1, j, board_ptr); + } + + // Marks the surrounded white regions as black. + for (vector& row : board) { + for (char& c : row) { + c = c != 'T' ? 'B' : 'W'; + } + } +} + +void MarkBoundaryRegion(int i, int j, vector>* board_ptr) { + queue> q(deque>(1, {i, j})); + vector>& board = *board_ptr; + // Uses BFS to traverse this region. + while (!empty(q)) { + const auto[x, y] = q.front(); + q.pop(); + if (x >= 0 && x < size(board) && y >= 0 && y < size(board[x]) && + board[x][y] == 'W') { + board[x][y] = 'T'; + q.emplace(x - 1, y); + q.emplace(x + 1, y); + q.emplace(x, y + 1); + q.emplace(x, y - 1); + } + } +} + +vector> FillSurroundedRegionsWrapper( + TimedExecutor& executor, vector> board) { + vector> char_vector; + char_vector.resize(board.size()); + for (int i = 0; i < board.size(); i++) { + for (const string& s : board[i]) { + if (s.size() != 1) { + throw std::runtime_error("String size is not 1"); + } + char_vector[i].push_back(s[0]); + } + } + + executor.Run([&] { FillSurroundedRegions(&char_vector); }); + + board.clear(); + board.resize(char_vector.size(), {}); + for (int i = 0; i < board.size(); i++) { + for (char c : char_vector[i]) { + board[i].emplace_back(1, c); + } + } + + return board; +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"executor", "board"}; + return GenericTestMain(args, "matrix_enclosed_regions.tsv", + &FillSurroundedRegionsWrapper, DefaultComparator{}, + param_names); +} diff --git a/epi_judge_cpp_solutions/matrix_rotation.cc b/epi_judge_cpp_solutions/matrix_rotation.cc new file mode 100644 index 000000000..d0d39d0c2 --- /dev/null +++ b/epi_judge_cpp_solutions/matrix_rotation.cc @@ -0,0 +1,35 @@ +#include +#include +#include "test_framework/generic_test.h" + +using std::vector; + +void RotateMatrix(vector>* square_matrix_ptr) { + vector>& square_matrix = *square_matrix_ptr; + const int matrix_size = size(square_matrix) - 1; + for (int i = 0; i < (size(square_matrix) / 2); ++i) { + for (int j = i; j < matrix_size - i; ++j) { + // Perform a 4-way exchange. + int temp1 = square_matrix[matrix_size - j][i]; + int temp2 = square_matrix[matrix_size - i][matrix_size - j]; + int temp3 = square_matrix[j][matrix_size - i]; + int temp4 = square_matrix[i][j]; + square_matrix[i][j] = temp1; + square_matrix[matrix_size - j][i] = temp2; + square_matrix[matrix_size - i][matrix_size - j] = temp3; + square_matrix[j][matrix_size - i] = temp4; + } + } +} + +vector> RotateMatrixWrapper(vector> square_matrix) { + RotateMatrix(&square_matrix); + return square_matrix; +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"square_matrix"}; + return GenericTestMain(args, "matrix_rotation.tsv", &RotateMatrixWrapper, + DefaultComparator{}, param_names); +} diff --git a/epi_judge_cpp_solutions/max_of_sliding_window.cc b/epi_judge_cpp_solutions/max_of_sliding_window.cc new file mode 100644 index 000000000..ab64a661c --- /dev/null +++ b/epi_judge_cpp_solutions/max_of_sliding_window.cc @@ -0,0 +1,58 @@ +#include +#include + +#define main _main +#include "queue_with_max_using_deque.cc" +#undef main +#include "test_framework/generic_test.h" +#include "test_framework/test_utils_serialization_traits.h" + +using std::queue; +using std::vector; + +struct TrafficElement { + // Following operators are needed for QueueWithMax with maximum. + bool operator<(const TrafficElement& that) const { + return volume < that.volume || (volume == that.volume && time < that.time); + } + + bool operator==(const TrafficElement& that) const { + return time == that.time && volume == that.volume; + } + + bool operator<=(const TrafficElement& that) const { return !(that < *this); } + + int time; + double volume; +}; + +vector CalculateTrafficVolumes(const vector& A, + int w) { + QueueWithMax sliding_window; + vector maximum_volumes; + for (const TrafficElement& traffic_info : A) { + sliding_window.Enqueue(traffic_info); + while (traffic_info.time - sliding_window.Head().time > w) { + sliding_window.Dequeue(); + } + maximum_volumes.emplace_back( + TrafficElement{traffic_info.time, sliding_window.Max().volume}); + } + return maximum_volumes; +} + +template <> +struct SerializationTraits + : UserSerTraits {}; + +std::ostream& operator<<(std::ostream& out, const TrafficElement& te) { + return out << '[' << te.time << ", " << te.volume << ']'; +}; + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"A", "w"}; + return GenericTestMain(args, "max_of_sliding_window.tsv", + &CalculateTrafficVolumes, DefaultComparator{}, + param_names); +} diff --git a/epi_judge_cpp_solutions/max_product_all_but_one.cc b/epi_judge_cpp_solutions/max_product_all_but_one.cc new file mode 100644 index 000000000..42b2999fa --- /dev/null +++ b/epi_judge_cpp_solutions/max_product_all_but_one.cc @@ -0,0 +1,35 @@ +#include +#include +#include +#include +#include +#include +#include "test_framework/generic_test.h" + +using std::max; +using std::multiplies; +using std::numeric_limits; +using std::vector; + +int FindBiggestNMinusOneProduct(const vector& A) { + // Builds suffix products. + vector suffix_products(size(A)); + partial_sum(crbegin(A), crend(A), rbegin(suffix_products), multiplies()); + + // Finds the biggest product of (n - 1) numbers. + int prefix_product = 1, max_product = numeric_limits::min(); + for (int i = 0; i < size(A); ++i) { + int suffix_product = i + 1 < size(A) ? suffix_products[i + 1] : 1; + max_product = max(max_product, prefix_product * suffix_product); + prefix_product *= A[i]; + } + return max_product; +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"A"}; + return GenericTestMain(args, "max_product_all_but_one.tsv", + &FindBiggestNMinusOneProduct, DefaultComparator{}, + param_names); +} diff --git a/epi_judge_cpp_solutions/max_safe_height.cc b/epi_judge_cpp_solutions/max_safe_height.cc new file mode 100644 index 000000000..1d91231da --- /dev/null +++ b/epi_judge_cpp_solutions/max_safe_height.cc @@ -0,0 +1,35 @@ +#include +#include +#include "test_framework/generic_test.h" + +using std::make_unique; +using std::vector; + +int GetHeightHelper(int, int, vector>*); + +int GetHeight(int cases, int drops) { + return GetHeightHelper( + cases, drops, + make_unique>>(cases + 1, vector(drops + 1, -1)) + .get()); +} + +int GetHeightHelper(int cases, int drops, vector>* F) { + if (cases == 0 || drops == 0) { + return 0; + } else if (cases == 1) { + return drops; + } + if ((*F)[cases][drops] == -1) { + (*F)[cases][drops] = GetHeightHelper(cases, drops - 1, F) + + GetHeightHelper(cases - 1, drops - 1, F) + 1; + } + return (*F)[cases][drops]; +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"cases", "drops"}; + return GenericTestMain(args, "max_safe_height.tsv", &GetHeight, + DefaultComparator{}, param_names); +} diff --git a/epi_judge_cpp_solutions/max_square_submatrix.cc b/epi_judge_cpp_solutions/max_square_submatrix.cc new file mode 100644 index 000000000..10d09f149 --- /dev/null +++ b/epi_judge_cpp_solutions/max_square_submatrix.cc @@ -0,0 +1,67 @@ +#include +#include +#include +#include "test_framework/generic_test.h" + +using std::deque; +using std::max; +using std::min; +using std::vector; + +int MaxSquareSubmatrix(const vector>& A) { + struct MaxHW { + int h, w; + }; + // DP table stores (h, w) for each (i, j). + vector> table(size(A), vector(size(A.front()))); + + for (int i = size(A) - 1; i >= 0; --i) { + for (int j = size(A[i]) - 1; j >= 0; --j) { + // Finds the largest h such that (i, j) to (i + h - 1, j) are feasible. + // Finds the largest w such that (i, j) to (i, j + w - 1) are feasible. + table[i][j] = A[i][j] + ? MaxHW{i + 1 < size(A) ? table[i + 1][j].h + 1 : 1, + j + 1 < size(A[i]) ? table[i][j + 1].w + 1 : 1} + : MaxHW{0, 0}; + } + } + + // A table stores the length of the largest square for each (i, j). + vector> s(size(A), vector(size(A.front()), 0)); + int max_square_area = 0; + for (int i = size(A) - 1; i >= 0; --i) { + for (int j = size(A[i]) - 1; j >= 0; --j) { + int side = min(table[i][j].h, table[i][j].w); + if (A[i][j]) { + // Gets the length of largest square with bottom-left corner (i, j). + if (i + 1 < size(A) && j + 1 < size(A[i + 1])) { + side = min(s[i + 1][j + 1] + 1, side); + } + s[i][j] = side; + max_square_area = max(max_square_area, side * side); + } + } + } + return max_square_area; +} + +int MaxSquareSubmatrixSpaceEfficient(const vector>& A) { + vector pre(size(A.front()), 0); + int max_side = 0; + for (const deque& row : A) { + vector curr(begin(row), end(row)); + for (int j = 1; j < size(curr); ++j) { + curr[j] *= (min({pre[j - 1], pre[j], curr[j - 1]}) + 1); + } + max_side = max(max_side, *max_element(begin(curr), end(curr))); + pre = move(curr); + } + return max_side * max_side; +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"A"}; + return GenericTestMain(args, "max_square_submatrix.tsv", &MaxSquareSubmatrix, + DefaultComparator{}, param_names); +} diff --git a/epi_judge_cpp_solutions/max_submatrix.cc b/epi_judge_cpp_solutions/max_submatrix.cc new file mode 100644 index 000000000..10bb28794 --- /dev/null +++ b/epi_judge_cpp_solutions/max_submatrix.cc @@ -0,0 +1,53 @@ +#include +#include +#include +#include +#include "test_framework/generic_test.h" + +using std::deque; +using std::max; +using std::min; +using std::numeric_limits; +using std::vector; + +int MaxRectangleSubmatrix(const vector>& A) { + struct MaxHW { + int h, w; + }; + // DP table stores (h, w) for each (i, j). + vector> table(size(A), vector(size(A.front()))); + + for (int i = size(A) - 1; i >= 0; --i) { + for (int j = size(A[i]) - 1; j >= 0; --j) { + // Find the largest h such that (i, j) to (i + h - 1, j) are feasible. + // Find the largest w such that (i, j) to (i, j + w - 1) are feasible. + table[i][j] = A[i][j] + ? MaxHW{i + 1 < size(A) ? table[i + 1][j].h + 1 : 1, + j + 1 < size(A[i]) ? table[i][j + 1].w + 1 : 1} + : MaxHW{0, 0}; + } + } + + int max_rectangle_area = 0; + for (int i = 0; i < size(A); ++i) { + for (int j = 0; j < size(A[i]); ++j) { + // Process (i, j) if it is feasible and is possible to update + // max_rectangle_area. + if (A[i][j] && table[i][j].w * table[i][j].h > max_rectangle_area) { + int min_width = numeric_limits::max(); + for (int a = 0; a < table[i][j].h; ++a) { + min_width = min(min_width, table[i + a][j].w); + max_rectangle_area = max(max_rectangle_area, min_width * (a + 1)); + } + } + } + } + return max_rectangle_area; +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"A"}; + return GenericTestMain(args, "max_submatrix.tsv", &MaxRectangleSubmatrix, + DefaultComparator{}, param_names); +} diff --git a/epi_judge_cpp_solutions/max_teams_in_photograph.cc b/epi_judge_cpp_solutions/max_teams_in_photograph.cc new file mode 100644 index 000000000..79d816d90 --- /dev/null +++ b/epi_judge_cpp_solutions/max_teams_in_photograph.cc @@ -0,0 +1,76 @@ +#include +#include +#include +#include +#include + +#include "test_framework/generic_test.h" +#include "test_framework/test_utils_serialization_traits.h" +#include "test_framework/timed_executor.h" + +using std::make_unique; +using std::max; +using std::vector; + +struct GraphVertex; +int Dfs(GraphVertex* curr); + +struct GraphVertex { + vector edges; + // Set max_distance = 0 to indicate unvisited vertex. + int max_distance = 0; +}; + +int FindLargestNumberTeams(vector* graph) { + int max_level = 0; + for (GraphVertex& g : *graph) { + if (g.max_distance == 0) { + max_level = max(max_level, Dfs(&g)); + } + } + return max_level; +} + +int Dfs(GraphVertex* curr) { + curr->max_distance = 1; + for (GraphVertex* vertex : curr->edges) { + curr->max_distance = + max(curr->max_distance, + (vertex->max_distance ? vertex->max_distance : Dfs(vertex)) + 1); + } + return curr->max_distance; +} + +struct Edge { + int from; + int to; +}; + +template <> +struct SerializationTraits : UserSerTraits {}; + +int FindLargestNumberTeamsWrapper(TimedExecutor& executor, int k, + const vector& edges) { + if (k <= 0) { + throw std::runtime_error("Invalid k value"); + } + + vector graph(k, GraphVertex{}); + + for (const Edge& e : edges) { + if (e.from < 0 || e.from >= k || e.to < 0 || e.to >= k) { + throw std::runtime_error("Invalid vertex index"); + } + graph[e.from].edges.push_back(&graph[e.to]); + } + + return executor.Run([&] { return FindLargestNumberTeams(&graph); }); +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"executor", "k", "edges"}; + return GenericTestMain(args, "max_teams_in_photograph.tsv", + &FindLargestNumberTeamsWrapper, DefaultComparator{}, + param_names); +} diff --git a/epi_judge_cpp_solutions/max_trapped_water.cc b/epi_judge_cpp_solutions/max_trapped_water.cc new file mode 100644 index 000000000..5588f6e15 --- /dev/null +++ b/epi_judge_cpp_solutions/max_trapped_water.cc @@ -0,0 +1,28 @@ +#include +#include +#include "test_framework/generic_test.h" + +using std::max; +using std::min; +using std::vector; + +int GetMaxTrappedWater(const vector& heights) { + int i = 0, j = size(heights) - 1, max_water = 0; + while (i < j) { + int width = j - i; + max_water = max(max_water, width * min(heights[i], heights[j])); + if (heights[i] > heights[j]) { + --j; + } else { // heights[i] <= heights[j]. + ++i; + } + } + return max_water; +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"heights"}; + return GenericTestMain(args, "max_trapped_water.tsv", &GetMaxTrappedWater, + DefaultComparator{}, param_names); +} diff --git a/epi_judge_cpp_solutions/max_water_trappable.cc b/epi_judge_cpp_solutions/max_water_trappable.cc new file mode 100644 index 000000000..2a4d92149 --- /dev/null +++ b/epi_judge_cpp_solutions/max_water_trappable.cc @@ -0,0 +1,43 @@ +#include +#include +#include +#include +#include "test_framework/generic_test.h" + +using std::distance; +using std::numeric_limits; +using std::vector; + +template +int TrappingWaterTillEnd(Iter, Iter); + +int CalculateTrappingWater(const vector& heights) { + // Finds the index with maximum height. + int max_h = + distance(begin(heights), max_element(begin(heights), end(heights))); + return TrappingWaterTillEnd(begin(heights), begin(heights) + max_h) + + TrappingWaterTillEnd(rbegin(heights), + rbegin(heights) + size(heights) - 1 - max_h); +} + +// Assume end is maximum height. +template +int TrappingWaterTillEnd(Iter begin, Iter end) { + int sum = 0, highest_level_seen = numeric_limits::min(); + for (Iter iter = begin; iter != end; ++iter) { + if (*iter >= highest_level_seen) { + highest_level_seen = *iter; + } else { + sum += highest_level_seen - *iter; + } + } + return sum; +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"heights"}; + return GenericTestMain(args, "max_water_trappable.tsv", + &CalculateTrappingWater, DefaultComparator{}, + param_names); +} diff --git a/epi_judge_cpp_solutions/maximum_subarray_in_circular_array.cc b/epi_judge_cpp_solutions/maximum_subarray_in_circular_array.cc new file mode 100644 index 000000000..9f0200738 --- /dev/null +++ b/epi_judge_cpp_solutions/maximum_subarray_in_circular_array.cc @@ -0,0 +1,63 @@ +#include +#include +#include "test_framework/generic_test.h" + +using std::max; +using std::vector; + +int FindMaxSubarray(const vector& A); +int FindCircularMaxSubarray(const vector& A); + +int MaxSubarraySumInCircular(const vector& A) { + return max(FindMaxSubarray(A), FindCircularMaxSubarray(A)); +} + +// Calculates the non-circular solution. +int FindMaxSubarray(const vector& A) { + int maximum_till = 0, maximum = 0; + for (int a : A) { + maximum_till = max(a, a + maximum_till); + maximum = max(maximum, maximum_till); + } + return maximum; +} + +vector ComputeRunningMaximum(const vector& A) { + vector running_maximum; + int sum = A.front(); + running_maximum.emplace_back(sum); + for (int i = 1; i < size(A); ++i) { + sum += A[i]; + running_maximum.emplace_back(max(running_maximum.back(), sum)); + } + return running_maximum; +} + +// Calculates the solution which is circular. +int FindCircularMaxSubarray(const vector& A) { + // Maximum subarray sum starts at index 0 and ends at or before index i. + vector maximum_begin = ComputeRunningMaximum(A); + + // Maximum subarray sum starts at index i + 1 and ends at the last element. + vector maximum_end = ComputeRunningMaximum({crbegin(A), crend(A)}); + maximum_end.pop_back(); + reverse(begin(maximum_end), end(maximum_end)); + maximum_end.emplace_back(0); + + // Calculates the maximum subarray which is circular. + int circular_max = 0; + for (int i = 0; i < size(A); ++i) { + circular_max = max(circular_max, maximum_begin[i] + maximum_end[i]); + } + return circular_max; +} + +// clang-format off + + +int main(int argc, char* argv[]) { + std::vector args {argv + 1, argv + argc}; + std::vector param_names {"A"}; + return GenericTestMain(args, "maximum_subarray_in_circular_array.tsv", &MaxSubarraySumInCircular, DefaultComparator{}, param_names); +} +// clang-format on diff --git a/epi_judge_cpp_solutions/minimum_distance_3_sorted_arrays.cc b/epi_judge_cpp_solutions/minimum_distance_3_sorted_arrays.cc new file mode 100644 index 000000000..e22e5098b --- /dev/null +++ b/epi_judge_cpp_solutions/minimum_distance_3_sorted_arrays.cc @@ -0,0 +1,52 @@ +#include +#include +#include +#include +#include +#include "test_framework/generic_test.h" + +using std::min; +using std::multimap; +using std::next; +using std::numeric_limits; +using std::vector; + +int FindClosestElementsInSortedArrays( + const vector>& sorted_arrays) { + int min_distance_so_far = numeric_limits::max(); + + struct IterTail { + vector::const_iterator iter, tail; + }; + // Stores two iterators in each entry. One for traversing, and the other to + // check we reach the end. + multimap iter_and_tail; + for (const vector& sorted_array : sorted_arrays) { + iter_and_tail.emplace(sorted_array.front(), + IterTail{cbegin(sorted_array), cend(sorted_array)}); + } + + while (true) { + int min_value = cbegin(iter_and_tail)->first, + max_value = crbegin(iter_and_tail)->first; + min_distance_so_far = min(max_value - min_value, min_distance_so_far); + const auto next_min = next(cbegin(iter_and_tail)->second.iter), + next_end = cbegin(iter_and_tail)->second.tail; + // Return if some array has no remaining elements. + if (next_min == next_end) { + return min_distance_so_far; + } + iter_and_tail.emplace(*next_min, IterTail{next_min, next_end}); + iter_and_tail.erase(cbegin(iter_and_tail)); + } +} + +// clang-format off + + +int main(int argc, char* argv[]) { + std::vector args {argv + 1, argv + argc}; + std::vector param_names {"sorted_arrays"}; + return GenericTestMain(args, "minimum_distance_3_sorted_arrays.tsv", &FindClosestElementsInSortedArrays, DefaultComparator{}, param_names); +} +// clang-format on diff --git a/epi_judge_cpp_solutions/minimum_points_covering_intervals.cc b/epi_judge_cpp_solutions/minimum_points_covering_intervals.cc new file mode 100644 index 000000000..220344db3 --- /dev/null +++ b/epi_judge_cpp_solutions/minimum_points_covering_intervals.cc @@ -0,0 +1,42 @@ +#include +#include +#include +#include + +#include "test_framework/generic_test.h" +#include "test_framework/test_utils_serialization_traits.h" + +using std::numeric_limits; +using std::vector; + +struct Interval; + +struct Interval { + int left, right; +}; + +int FindMinimumVisits(vector intervals) { + // Sort intervals based on the right endpoints. + sort(begin(intervals), end(intervals), + [](const Interval& a, const Interval& b) { return a.right < b.right; }); + int last_visit_time = numeric_limits::min(), num_visits = 0; + for (const Interval& interval : intervals) { + if (interval.left > last_visit_time) { + // The current right endpoint, last_visit_time, will not cover any more + // intervals. + last_visit_time = interval.right; + ++num_visits; + } + } + return num_visits; +} + +template <> +struct SerializationTraits : UserSerTraits {}; + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"intervals"}; + return GenericTestMain(args, "minimum_points_covering_intervals.tsv", + &FindMinimumVisits, DefaultComparator{}, param_names); +} diff --git a/epi_judge_cpp_solutions/minimum_waiting_time.cc b/epi_judge_cpp_solutions/minimum_waiting_time.cc new file mode 100644 index 000000000..3086be0b9 --- /dev/null +++ b/epi_judge_cpp_solutions/minimum_waiting_time.cc @@ -0,0 +1,26 @@ +#include +#include +#include +#include "test_framework/generic_test.h" + +using std::vector; + +int MinimumTotalWaitingTime(vector service_times) { + // Sort the service times in increasing order. + sort(begin(service_times), end(service_times)); + + int total_waiting_time = 0; + for (int i = 0; i < size(service_times); ++i) { + int num_remaining_queries = size(service_times) - (i + 1); + total_waiting_time += service_times[i] * num_remaining_queries; + } + return total_waiting_time; +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"service_times"}; + return GenericTestMain(args, "minimum_waiting_time.tsv", + &MinimumTotalWaitingTime, DefaultComparator{}, + param_names); +} diff --git a/epi_judge_cpp_solutions/minimum_weight_path_in_a_triangle.cc b/epi_judge_cpp_solutions/minimum_weight_path_in_a_triangle.cc new file mode 100644 index 000000000..a508937e6 --- /dev/null +++ b/epi_judge_cpp_solutions/minimum_weight_path_in_a_triangle.cc @@ -0,0 +1,36 @@ +#include +#include +#include "test_framework/generic_test.h" + +using std::min; +using std::vector; + +int MinimumPathWeight(const vector>& triangle) { + if (empty(triangle)) { + return 0; + } + + // As we iterate, prev_row stores the minimum path sum to each entry in + // triangle[i - 1]. + vector prev_row(triangle.front()); + for (int i = 1; i < size(triangle); ++i) { + // Stores the minimum path sum to each entry in triangle[i]. + vector curr_row(triangle[i]); + curr_row.front() += prev_row.front(); // For the first element. + for (int j = 1; j < size(curr_row) - 1; ++j) { + curr_row[j] += min(prev_row[j - 1], prev_row[j]); + } + curr_row.back() += prev_row.back(); // For the last element. + + // Uses swap to assign curr_row's content to prev_row in O(1) time. + prev_row.swap(curr_row); + } + return *min_element(cbegin(prev_row), cend(prev_row)); +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"triangle"}; + return GenericTestMain(args, "minimum_weight_path_in_a_triangle.tsv", + &MinimumPathWeight, DefaultComparator{}, param_names); +} diff --git a/epi_judge_cpp_solutions/n_queens.cc b/epi_judge_cpp_solutions/n_queens.cc new file mode 100644 index 000000000..f6423d575 --- /dev/null +++ b/epi_judge_cpp_solutions/n_queens.cc @@ -0,0 +1,60 @@ +#include +#include +#include +#include +#include +#include "test_framework/generic_test.h" + +using std::make_unique; +using std::vector; + +void SolveNQueens(int, int, vector*, vector>*); +bool IsValid(const vector&); + +vector> NQueens(int n) { + vector> result; + SolveNQueens(n, 0, make_unique>().get(), &result); + return result; +} + +void SolveNQueens(int n, int row, vector* col_placement, + vector>* result) { + if (row == n) { + // All queens are legally placed. + result->emplace_back(*col_placement); + } else { + for (int col = 0; col < n; ++col) { + col_placement->emplace_back(col); + if (IsValid(*col_placement)) { + SolveNQueens(n, row + 1, col_placement, result); + } + col_placement->pop_back(); + } + } +} + +// Test if a newly placed queen will conflict any earlier queens +// placed before. +bool IsValid(const vector& col_placement) { + int row_id = size(col_placement) - 1; + for (int i = 0; i < row_id; ++i) { + if (int diff = abs(col_placement[i] - col_placement[row_id]); + diff == 0 || diff == row_id - i) { + // A column or diagonal constraint is violated. + return false; + } + } + return true; +} + +bool Comp(vector>& a, vector>& b) { + std::sort(std::begin(a), std::end(a)); + std::sort(std::begin(b), std::end(b)); + return a == b; +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"n"}; + return GenericTestMain(args, "n_queens.tsv", &NQueens, &Comp, param_names); +} diff --git a/epi_judge_cpp_solutions/nearest_repeated_entries.cc b/epi_judge_cpp_solutions/nearest_repeated_entries.cc new file mode 100644 index 000000000..b19ae3cf8 --- /dev/null +++ b/epi_judge_cpp_solutions/nearest_repeated_entries.cc @@ -0,0 +1,37 @@ +#include +#include +#include +#include +#include +#include "test_framework/generic_test.h" + +using std::max; +using std::min; +using std::numeric_limits; +using std::string; +using std::unordered_map; +using std::vector; + +int FindNearestRepetition(const vector& paragraph) { + unordered_map word_to_latest_index; + int nearest_repeated_distance = numeric_limits::max(); + for (int i = 0; i < size(paragraph); ++i) { + if (auto latest_equal_word = word_to_latest_index.find(paragraph[i]); + latest_equal_word != end(word_to_latest_index)) { + nearest_repeated_distance = + min(nearest_repeated_distance, i - latest_equal_word->second); + } + word_to_latest_index[paragraph[i]] = i; + } + return nearest_repeated_distance != numeric_limits::max() + ? nearest_repeated_distance + : -1; +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"paragraph"}; + return GenericTestMain(args, "nearest_repeated_entries.tsv", + &FindNearestRepetition, DefaultComparator{}, + param_names); +} diff --git a/epi_judge_cpp_solutions/next_permutation.cc b/epi_judge_cpp_solutions/next_permutation.cc new file mode 100644 index 000000000..b53ab9cec --- /dev/null +++ b/epi_judge_cpp_solutions/next_permutation.cc @@ -0,0 +1,41 @@ +#include +#include +#include "test_framework/generic_test.h" + +using std::swap; +using std::vector; + +vector NextPermutation(vector perm) { + // Find the first entry from the right that is smaller than the entry + // immediately after it. + auto inversion_point = is_sorted_until(rbegin(perm), rend(perm)); + if (inversion_point == rend(perm)) { + // perm is sorted in decreasing order, so it's the last permutation. + return {}; + } + + // Swap the entry referenced by inversion_point with smallest entry + // appearing after inversion_point that is greater than the entry referenced + // by inversion_point: + // + // 1.) Find the smallest entry after inversion_point that's greater than the + // entry referenced by inversion_point. Since perm must be sorted in + // decreasing order after inversion_point, we can use a fast algorithm + // to find this entry. + auto least_upper_bound = + upper_bound(rbegin(perm), inversion_point, *inversion_point); + + // 2.) Perform the swap. + iter_swap(inversion_point, least_upper_bound); + + // Reverse the subarray that follows inversion_point. + reverse(rbegin(perm), inversion_point); + return perm; +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"perm"}; + return GenericTestMain(args, "next_permutation.tsv", &NextPermutation, + DefaultComparator{}, param_names); +} diff --git a/epi_judge_cpp_solutions/nonuniform_random_number.cc b/epi_judge_cpp_solutions/nonuniform_random_number.cc new file mode 100644 index 000000000..043e23f52 --- /dev/null +++ b/epi_judge_cpp_solutions/nonuniform_random_number.cc @@ -0,0 +1,90 @@ +#include +#include +#include +#include +#include +#include +#include + +#include "test_framework/generic_test.h" +#include "test_framework/random_sequence_checker.h" +#include "test_framework/timed_executor.h" + +using std::abs; +using std::bind; +using std::default_random_engine; +using std::distance; +using std::generate_canonical; +using std::numeric_limits; +using std::random_device; +using std::unordered_map; +using std::vector; + +int NonuniformRandomNumberGeneration(const vector& values, + const vector& probabilities) { + vector prefix_sums_of_probabilities; + // Creating the endpoints for the intervals corresponding to the + // probabilities. + partial_sum(cbegin(probabilities), cend(probabilities), + back_inserter(prefix_sums_of_probabilities)); + + default_random_engine seed((random_device())()); + const double uniform_0_1 = + generate_canonical::digits>(seed); + // Find the index of the interval that uniform_0_1 lies in, which is the + // return value of upper_bound() minus 1. + const int interval_idx = + distance(cbegin(prefix_sums_of_probabilities), + upper_bound(cbegin(prefix_sums_of_probabilities), + cend(prefix_sums_of_probabilities), uniform_0_1)); + return values[interval_idx]; +} + +bool NonuniformRandomNumberGenerationRunner( + TimedExecutor& executor, const vector& values, + const vector& probabilities) { + constexpr int kN = 1000000; + vector results; + + executor.Run([&] { + for (int i = 0; i < kN; ++i) { + results.emplace_back( + NonuniformRandomNumberGeneration(values, probabilities)); + } + }); + + unordered_map counts; + for (int result : results) { + ++counts[result]; + } + for (int i = 0; i < values.size(); ++i) { + const int v = values[i]; + const double p = probabilities[i]; + if (kN * p < 50 || kN * (1.0 - p) < 50) { + continue; + } + const double sigma = sqrt(kN * p * (1.0 - p)); + if (abs(counts[v] - (p * kN)) > 5 * sigma) { + return false; + } + } + return true; +} + +void NonuniformRandomNumberGenerationWrapper( + TimedExecutor& executor, const vector& values, + const vector& probabilities) { + RunFuncWithRetries(bind(NonuniformRandomNumberGenerationRunner, + std::ref(executor), std::cref(values), + std::cref(probabilities))); +} + +// clang-format off + + +int main(int argc, char* argv[]) { + std::vector args {argv + 1, argv + argc}; + std::vector param_names {"executor", "values", "probabilities"}; + return GenericTestMain(args, "nonuniform_random_number.tsv", &NonuniformRandomNumberGenerationWrapper, DefaultComparator{}, param_names); +} +// clang-format on diff --git a/epi_judge_cpp_solutions/number_of_score_combinations.cc b/epi_judge_cpp_solutions/number_of_score_combinations.cc new file mode 100644 index 000000000..847a0da81 --- /dev/null +++ b/epi_judge_cpp_solutions/number_of_score_combinations.cc @@ -0,0 +1,32 @@ +#include +#include "test_framework/generic_test.h" + +using std::vector; + +int NumCombinationsForFinalScore(int final_score, + const vector& individual_play_scores) { + vector> num_combinations_for_score( + size(individual_play_scores), vector(final_score + 1, 0)); + for (int i = 0; i < size(individual_play_scores); ++i) { + num_combinations_for_score[i][0] = 1; // One way to reach 0. + for (int j = 1; j <= final_score; ++j) { + int without_this_play = i >= 1 ? num_combinations_for_score[i - 1][j] : 0; + int with_this_play = + j >= individual_play_scores[i] + ? num_combinations_for_score[i][j - individual_play_scores[i]] + : 0; + num_combinations_for_score[i][j] = without_this_play + with_this_play; + } + } + return num_combinations_for_score.back().back(); +} + +// clang-format off + + +int main(int argc, char* argv[]) { + std::vector args {argv + 1, argv + argc}; + std::vector param_names {"final_score", "individual_play_scores"}; + return GenericTestMain(args, "number_of_score_combinations.tsv", &NumCombinationsForFinalScore, DefaultComparator{}, param_names); +} +// clang-format on diff --git a/epi_judge_cpp_solutions/number_of_traversals_matrix.cc b/epi_judge_cpp_solutions/number_of_traversals_matrix.cc new file mode 100644 index 000000000..38397989e --- /dev/null +++ b/epi_judge_cpp_solutions/number_of_traversals_matrix.cc @@ -0,0 +1,58 @@ +#include +#include +#include +#include "test_framework/generic_test.h" + +using std::make_unique; +using std::swap; +using std::vector; + +int ComputeNumberOfWaysToXY(int, int, vector>*); + +int NumberOfWays(int n, int m) { + return ComputeNumberOfWaysToXY( + n - 1, m - 1, + make_unique>>(n, vector(m, 0)).get()); +} + +int ComputeNumberOfWaysToXY(int x, int y, + vector>* number_of_ways_ptr) { + if (x == 0 && y == 0) { + return 1; + } + + vector>& number_of_ways = *number_of_ways_ptr; + if (number_of_ways[x][y] == 0) { + int ways_top = + x == 0 ? 0 : ComputeNumberOfWaysToXY(x - 1, y, number_of_ways_ptr); + int ways_left = + y == 0 ? 0 : ComputeNumberOfWaysToXY(x, y - 1, number_of_ways_ptr); + number_of_ways[x][y] = ways_top + ways_left; + } + return number_of_ways[x][y]; +} + +int ComputeNumberOfWaysSpaceEfficient(int n, int m) { + if (n < m) { + swap(n, m); + } + vector A(m, 1); + for (int i = 1; i < n; ++i) { + int prev_res = 0; + if (n < m) { + swap(n, m); + } + for (int j = 0; j < m; ++j) { + A[j] = A[j] + prev_res; + prev_res = A[j]; + } + } + return A[m - 1]; +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"n", "m"}; + return GenericTestMain(args, "number_of_traversals_matrix.tsv", &NumberOfWays, + DefaultComparator{}, param_names); +} diff --git a/epi_judge_cpp_solutions/number_of_traversals_staircase.cc b/epi_judge_cpp_solutions/number_of_traversals_staircase.cc new file mode 100644 index 000000000..8f66b556c --- /dev/null +++ b/epi_judge_cpp_solutions/number_of_traversals_staircase.cc @@ -0,0 +1,36 @@ +#include +#include +#include "test_framework/generic_test.h" + +using std::make_unique; +using std::vector; + +int ComputeNumberOfWaysToH(int, int, vector*); + +int NumberOfWaysToTop(int top, int maximum_step) { + return ComputeNumberOfWaysToH(top, maximum_step, + make_unique>(top + 1, 0).get()); +} + +int ComputeNumberOfWaysToH(int h, int maximum_step, + vector* number_of_ways_to_h_ptr) { + if (h <= 1) { + return 1; + } + + vector& number_of_ways_to_h = *number_of_ways_to_h_ptr; + if (number_of_ways_to_h[h] == 0) { + for (int i = 1; i <= maximum_step && h - i >= 0; ++i) { + number_of_ways_to_h[h] += + ComputeNumberOfWaysToH(h - i, maximum_step, number_of_ways_to_h_ptr); + } + } + return number_of_ways_to_h[h]; +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"top", "maximum_step"}; + return GenericTestMain(args, "number_of_traversals_staircase.tsv", + &NumberOfWaysToTop, DefaultComparator{}, param_names); +} diff --git a/epi_judge_cpp_solutions/offline_sampling.cc b/epi_judge_cpp_solutions/offline_sampling.cc new file mode 100644 index 000000000..c4d9f1013 --- /dev/null +++ b/epi_judge_cpp_solutions/offline_sampling.cc @@ -0,0 +1,66 @@ +#include +#include +#include +#include +#include + +#include "test_framework/generic_test.h" +#include "test_framework/random_sequence_checker.h" +#include "test_framework/timed_executor.h" + +using std::bind; +using std::default_random_engine; +using std::random_device; +using std::swap; +using std::uniform_int_distribution; +using std::vector; + +void RandomSampling(int k, vector* A_ptr) { + vector& A = *A_ptr; + default_random_engine seed((random_device())()); // Random num generator. + for (int i = 0; i < k; ++i) { + // Generate a random index in [i, size(A) - 1]. + swap(A[i], A[uniform_int_distribution{ + i, static_cast(A.size()) - 1}(seed)]); + } +} + +bool RandomSamplingRunner(TimedExecutor& executor, int k, vector A) { + vector> results; + + executor.Run([&] { + for (int i = 0; i < 100000; ++i) { + RandomSampling(k, &A); + results.emplace_back(begin(A), begin(A) + k); + } + }); + + int total_possible_outcomes = BinomialCoefficient(A.size(), k); + sort(begin(A), end(A)); + vector> combinations; + for (int i = 0; i < BinomialCoefficient(A.size(), k); ++i) { + combinations.emplace_back(ComputeCombinationIdx(A, A.size(), k, i)); + } + vector sequence; + for (vector result : results) { + sort(begin(result), end(result)); + sequence.emplace_back( + distance(begin(combinations), + find(begin(combinations), end(combinations), result))); + } + return CheckSequenceIsUniformlyRandom(sequence, total_possible_outcomes, + 0.01); +} + +void RandomSamplingWrapper(TimedExecutor& executor, int k, + const vector& A) { + RunFuncWithRetries( + bind(RandomSamplingRunner, std::ref(executor), k, std::cref(A))); +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"executor", "k", "A"}; + return GenericTestMain(args, "offline_sampling.tsv", &RandomSamplingWrapper, + DefaultComparator{}, param_names); +} diff --git a/epi_judge_cpp_solutions/online_median.cc b/epi_judge_cpp_solutions/online_median.cc new file mode 100644 index 000000000..c0aeabb18 --- /dev/null +++ b/epi_judge_cpp_solutions/online_median.cc @@ -0,0 +1,47 @@ +#include +#include +#include +#include "test_framework/generic_test.h" + +using std::greater; +using std::less; +using std::priority_queue; +using std::vector; + +vector OnlineMedian(vector::const_iterator sequence_begin, + const vector::const_iterator& sequence_end) { + // min_heap stores the larger half seen so far. + priority_queue, greater<>> min_heap; + // max_heap stores the smaller half seen so far. + priority_queue, less<>> max_heap; + vector result; + + while (sequence_begin != sequence_end) { + min_heap.emplace(*sequence_begin++); + max_heap.emplace(min_heap.top()); + min_heap.pop(); + // Ensure min_heap and max_heap have equal number of elements if + // an even number of elements is read; otherwise, min_heap must have + // one more element than max_heap. + if (size(max_heap) > size(min_heap)) { + min_heap.emplace(max_heap.top()); + max_heap.pop(); + } + + result.emplace_back(size(min_heap) == size(max_heap) + ? 0.5 * (min_heap.top() + max_heap.top()) + : min_heap.top()); + } + return result; +} + +vector OnlineMedianWrapper(const vector& sequence) { + return OnlineMedian(cbegin(sequence), cend(sequence)); +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"sequence"}; + return GenericTestMain(args, "online_median.tsv", &OnlineMedianWrapper, + DefaultComparator{}, param_names); +} diff --git a/epi_judge_cpp_solutions/online_sampling.cc b/epi_judge_cpp_solutions/online_sampling.cc new file mode 100644 index 000000000..82ed4b0cb --- /dev/null +++ b/epi_judge_cpp_solutions/online_sampling.cc @@ -0,0 +1,86 @@ +#include +#include +#include +#include +#include + +#include "test_framework/generic_test.h" +#include "test_framework/random_sequence_checker.h" +#include "test_framework/timed_executor.h" + +using std::bind; +using std::default_random_engine; +using std::random_device; +using std::sort; +using std::uniform_int_distribution; +using std::vector; + +// Assumption: there are at least k elements in the stream. +vector OnlineRandomSample(vector::const_iterator stream_begin, + const vector::const_iterator stream_end, + int k) { + vector running_sample; + // Storesult the first k elements. + for (int i = 0; i < k; ++i) { + running_sample.emplace_back(*stream_begin++); + } + + default_random_engine seed((random_device())()); // Random num generator. + // Have read the first k elements. + int num_seen_so_far = k; + while (stream_begin != stream_end) { + int x = *stream_begin++; + ++num_seen_so_far; + // Generate a random number in [0, num_seen_so_far - 1], and if this + // number is in [0, k - 1], we replace that element from the sample with + // x. + if (const int idx_to_replace = + uniform_int_distribution{0, num_seen_so_far - 1}(seed); + idx_to_replace < k) { + running_sample[idx_to_replace] = x; + } + } + return running_sample; +} + +bool OnlineRandomSamplingRunner(TimedExecutor& executor, vector stream, + int k) { + vector> results; + + executor.Run([&] { + std::generate_n( + back_inserter(results), 100000, + std::bind(OnlineRandomSample, cbegin(stream), cend(stream), k)); + }); + + int total_possible_outcomes = BinomialCoefficient(stream.size(), k); + sort(begin(stream), end(stream)); + vector> combinations; + for (int i = 0; i < BinomialCoefficient(stream.size(), k); ++i) { + combinations.emplace_back( + ComputeCombinationIdx(stream, stream.size(), k, i)); + } + vector sequence; + for (vector result : results) { + sort(begin(result), end(result)); + sequence.emplace_back( + distance(begin(combinations), + find(begin(combinations), end(combinations), result))); + } + return CheckSequenceIsUniformlyRandom(sequence, total_possible_outcomes, + 0.01); +} + +void OnlineRandomSampleWrapper(TimedExecutor& executor, + const vector& stream, int k) { + RunFuncWithRetries(bind(OnlineRandomSamplingRunner, std::ref(executor), + std::cref(stream), k)); +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"executor", "stream", "k"}; + return GenericTestMain(args, "online_sampling.tsv", + &OnlineRandomSampleWrapper, DefaultComparator{}, + param_names); +} diff --git a/epi_judge_cpp_solutions/parity.cc b/epi_judge_cpp_solutions/parity.cc new file mode 100644 index 000000000..dd341a961 --- /dev/null +++ b/epi_judge_cpp_solutions/parity.cc @@ -0,0 +1,16 @@ +#include "test_framework/generic_test.h" +short Parity(unsigned long long x) { + short result = 0; + while (x) { + result ^= (x & 1); + x >>= 1; + } + return result; +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"x"}; + return GenericTestMain(args, "parity.tsv", &Parity, DefaultComparator{}, + param_names); +} diff --git a/epi_judge_cpp_solutions/pascal_triangle.cc b/epi_judge_cpp_solutions/pascal_triangle.cc new file mode 100644 index 000000000..ad8d2e103 --- /dev/null +++ b/epi_judge_cpp_solutions/pascal_triangle.cc @@ -0,0 +1,30 @@ +#include +#include "test_framework/generic_test.h" + +using std::vector; + +vector> GeneratePascalTriangle(int num_rows) { + vector> pascal_triangle; + for (int i = 0; i < num_rows; ++i) { + vector curr_row; + for (int j = 0; j <= i; ++j) { + // Sets this entry to the sum of the two above adjacent entries if they + // exist. + curr_row.emplace_back(0 < j && j < i ? pascal_triangle.back()[j - 1] + + pascal_triangle.back()[j] + : 1); + } + pascal_triangle.emplace_back(curr_row); + } + return pascal_triangle; +} + +// clang-format off + + +int main(int argc, char* argv[]) { + std::vector args {argv + 1, argv + argc}; + std::vector param_names {"num_rows"}; + return GenericTestMain(args, "pascal_triangle.tsv", &GeneratePascalTriangle, DefaultComparator{}, param_names); +} +// clang-format on diff --git a/epi_judge_cpp_solutions/path_sum.cc b/epi_judge_cpp_solutions/path_sum.cc new file mode 100644 index 000000000..f3c67a895 --- /dev/null +++ b/epi_judge_cpp_solutions/path_sum.cc @@ -0,0 +1,25 @@ +#include + +#include "binary_tree_node.h" +#include "test_framework/generic_test.h" + +using std::unique_ptr; + +bool HasPathSum(const unique_ptr>& tree, + int remaining_weight) { + if (tree == nullptr) { + return false; + } else if (tree->left == nullptr && tree->right == nullptr) { // Leaf. + return remaining_weight == tree->data; + } + // Non-leaf. + return HasPathSum(tree->left, remaining_weight - tree->data) || + HasPathSum(tree->right, remaining_weight - tree->data); +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"tree", "remaining_weight"}; + return GenericTestMain(args, "path_sum.tsv", &HasPathSum, DefaultComparator{}, + param_names); +} diff --git a/epi_judge_cpp_solutions/permutations.cc b/epi_judge_cpp_solutions/permutations.cc new file mode 100644 index 000000000..49f437322 --- /dev/null +++ b/epi_judge_cpp_solutions/permutations.cc @@ -0,0 +1,26 @@ +#include +#include +#include +#include "test_framework/generic_test.h" + +using std::vector; + +vector> Permutations(vector A) { + vector> result; + // Generate the first permutation in dictionary order. + sort(begin(A), end(A)); + do { + result.emplace_back(A); + } while (next_permutation(begin(A), end(A))); + return result; +} + +// clang-format off + + +int main(int argc, char* argv[]) { + std::vector args {argv + 1, argv + argc}; + std::vector param_names {"A"}; + return GenericTestMain(args, "permutations.tsv", &Permutations, &UnorderedComparator>>, param_names); +} +// clang-format on diff --git a/epi_judge_cpp_solutions/phone_number_mnemonic.cc b/epi_judge_cpp_solutions/phone_number_mnemonic.cc new file mode 100644 index 000000000..daad8f21e --- /dev/null +++ b/epi_judge_cpp_solutions/phone_number_mnemonic.cc @@ -0,0 +1,51 @@ +#include +#include +#include +#include +#include "test_framework/generic_test.h" + +using std::array; +using std::make_unique; +using std::string; +using std::vector; + +void PhoneMnemonicHelper(const string&, int, string*, vector*); + +vector PhoneMnemonic(const string& phone_number) { + vector mnemonics; + PhoneMnemonicHelper(phone_number, 0, + make_unique(size(phone_number), 0).get(), + &mnemonics); + return mnemonics; +} + +const int kNumTelDigits = 10; + +// The mapping from digit to corresponding characters. +const array kMapping = { + {"0", "1", "ABC", "DEF", "GHI", "JKL", "MNO", "PQRS", "TUV", "WXYZ"}}; + +void PhoneMnemonicHelper(const string& phone_number, int digit, + string* partial_mnemonic, vector* mnemonics) { + if (digit == size(phone_number)) { + // All digits are processed, so add partial_mnemonic to mnemonics. + // (We add a copy since subsequent calls modify partial_mnemonic.) + mnemonics->emplace_back(*partial_mnemonic); + } else { + // Try all possible characters for this digit. + for (char c : kMapping[phone_number[digit] - '0']) { + (*partial_mnemonic)[digit] = c; + PhoneMnemonicHelper(phone_number, digit + 1, partial_mnemonic, mnemonics); + } + } +} + +// clang-format off + + +int main(int argc, char* argv[]) { + std::vector args {argv + 1, argv + argc}; + std::vector param_names {"phone_number"}; + return GenericTestMain(args, "phone_number_mnemonic.tsv", &PhoneMnemonic, &UnorderedComparator>, param_names); +} +// clang-format on diff --git a/epi_judge_cpp_solutions/picking_up_coins.cc b/epi_judge_cpp_solutions/picking_up_coins.cc new file mode 100644 index 000000000..efb899ac1 --- /dev/null +++ b/epi_judge_cpp_solutions/picking_up_coins.cc @@ -0,0 +1,92 @@ +#include +#include +#include +#include +#include +#include "test_framework/generic_test.h" + +using std::make_unique; +using std::max; +using std::min; +using std::partial_sum; +using std::vector; + +int ComputeMaximumRevenueForRange(const vector&, int, int, + vector>*); + +int MaximumRevenue(const vector& coins) { + vector> maximum_revenue_for_range(size(coins), + vector(size(coins), 0)); + return ComputeMaximumRevenueForRange( + coins, 0, size(coins) - 1, + make_unique>>(size(coins), vector(size(coins), 0)) + .get()); +} + +int ComputeMaximumRevenueForRange( + const vector& coins, int a, int b, + vector>* maximum_revenue_for_range_ptr) { + if (a > b) { + // No coins left. + return 0; + } + + vector>& maximum_revenue_for_range = + *maximum_revenue_for_range_ptr; + if (maximum_revenue_for_range[a][b] == 0) { + int max_revenue_a = + coins[a] + min(ComputeMaximumRevenueForRange( + coins, a + 2, b, maximum_revenue_for_range_ptr), + ComputeMaximumRevenueForRange( + coins, a + 1, b - 1, maximum_revenue_for_range_ptr)); + int max_revenue_b = + coins[b] + min(ComputeMaximumRevenueForRange( + coins, a + 1, b - 1, maximum_revenue_for_range_ptr), + ComputeMaximumRevenueForRange( + coins, a, b - 2, maximum_revenue_for_range_ptr)); + maximum_revenue_for_range[a][b] = max(max_revenue_a, max_revenue_b); + } + return maximum_revenue_for_range[a][b]; +} + +int MaximumRevenueAlternativeHelper( + const vector& coins, int a, int b, const vector& prefix_sum, + vector>* maximum_revenue_for_range_ptr) { + if (a > b) { + return 0; + } else if (a == b) { + return coins[a]; + } + + vector>& maximum_revenue_for_range = + *maximum_revenue_for_range_ptr; + if (maximum_revenue_for_range[a][b] == -1) { + maximum_revenue_for_range[a][b] = + max(coins[a] + prefix_sum[b] - (a + 1 > 0 ? prefix_sum[a] : 0) - + MaximumRevenueAlternativeHelper(coins, a + 1, b, prefix_sum, + maximum_revenue_for_range_ptr), + coins[b] + prefix_sum[b - 1] - (a > 0 ? prefix_sum[a - 1] : 0) - + MaximumRevenueAlternativeHelper(coins, a, b - 1, prefix_sum, + maximum_revenue_for_range_ptr)); + } + return maximum_revenue_for_range[a][b]; +} + +int MaximumRevenueAlternative(const vector& coins) { + vector prefix_sum; + partial_sum(begin(coins), end(coins), back_inserter(prefix_sum)); + vector> maximum_revenue_for_range(size(coins), + vector(size(coins), -1)); + return MaximumRevenueAlternativeHelper( + coins, 0, size(coins) - 1, prefix_sum, + make_unique>>(size(coins), + vector(size(coins), -1)) + .get()); +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"coins"}; + return GenericTestMain(args, "picking_up_coins.tsv", &MaximumRevenue, + DefaultComparator{}, param_names); +} diff --git a/epi_judge_cpp_solutions/pivot_list.cc b/epi_judge_cpp_solutions/pivot_list.cc new file mode 100644 index 000000000..a88994515 --- /dev/null +++ b/epi_judge_cpp_solutions/pivot_list.cc @@ -0,0 +1,89 @@ +#include +#include +#include +#include + +#include "list_node.h" +#define main _main +#include "sorted_lists_merge.cc" // uses AppendNode() +#undef main +#include "test_framework/generic_test.h" +#include "test_framework/test_failure.h" +#include "test_framework/timed_executor.h" + +using std::shared_ptr; + +shared_ptr> ListPivoting(const shared_ptr>& l, + int x) { + shared_ptr> less_head(new ListNode), + equal_head(new ListNode), greater_head(new ListNode); + shared_ptr> less_iter = less_head, equal_iter = equal_head, + greater_iter = greater_head; + // Populates the three lists. + shared_ptr> iter = l; + while (iter) { + AppendNode(&iter, iter->data < x + ? &less_iter + : iter->data == x ? &equal_iter : &greater_iter); + } + // Combines the three lists. + greater_iter->next = nullptr; + equal_iter->next = greater_head->next; + less_iter->next = equal_head->next; + return less_head->next; +} + +std::vector ListToVector(const shared_ptr>& l) { + std::vector v; + ListNode* it = l.get(); + while (it) { + v.push_back(it->data); + it = it->next.get(); + } + return v; +} + +void ListPivotingWrapper(TimedExecutor& executor, + const shared_ptr>& l, int x) { + std::vector original = ListToVector(l); + + std::shared_ptr> pivoted_list = + executor.Run([&] { return ListPivoting(l, x); }); + + std::vector pivoted = ListToVector(pivoted_list); + enum { kLess, kEq, kGreater } mode = kLess; + for (auto& i : pivoted) { + switch (mode) { + case kLess: + if (i == x) { + mode = kEq; + } else if (i > x) { + mode = kGreater; + } + break; + case kEq: + if (i < x) { + throw TestFailure("List is not pivoted"); + } else if (i > x) { + mode = kGreater; + } + break; + case kGreater: + if (i <= x) { + throw TestFailure("List is not pivoted"); + } + } + } + std::sort(begin(original), end(original)); + std::sort(begin(pivoted), end(pivoted)); + if (original != pivoted) { + throw TestFailure("Result list contains different values"); + } +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"executor", "l", "x"}; + return GenericTestMain(args, "pivot_list.tsv", &ListPivotingWrapper, + DefaultComparator{}, param_names); +} diff --git a/epi_judge_cpp_solutions/posting_list_node.h b/epi_judge_cpp_solutions/posting_list_node.h new file mode 100644 index 000000000..16e8ab84c --- /dev/null +++ b/epi_judge_cpp_solutions/posting_list_node.h @@ -0,0 +1,15 @@ +#include +#include +#pragma once + +using std::shared_ptr; + +class PostingListNode { + public: + int order; + shared_ptr next; + PostingListNode* jump; + PostingListNode(int order, shared_ptr next, + PostingListNode* jump) + : order(order), next(next), jump(jump) {} +}; diff --git a/epi_judge_cpp_solutions/power_set.cc b/epi_judge_cpp_solutions/power_set.cc new file mode 100644 index 000000000..1b014f681 --- /dev/null +++ b/epi_judge_cpp_solutions/power_set.cc @@ -0,0 +1,30 @@ +#include +#include +#include "test_framework/generic_test.h" + +using std::vector; + +vector> GeneratePowerSet(const vector& input_set) { + vector> power_set; + for (int int_for_subset = 0; int_for_subset < (1 << size(input_set)); + ++int_for_subset) { + int bit_array = int_for_subset; + vector subset; + while (bit_array) { + subset.emplace_back(input_set[log2(bit_array & ~(bit_array - 1))]); + bit_array &= bit_array - 1; + } + power_set.emplace_back(subset); + } + return power_set; +} + +// clang-format off + + +int main(int argc, char* argv[]) { + std::vector args {argv + 1, argv + argc}; + std::vector param_names {"input_set"}; + return GenericTestMain(args, "power_set.tsv", &GeneratePowerSet, &UnorderedComparator>>, param_names); +} +// clang-format on diff --git a/epi_judge_cpp_solutions/power_x_y.cc b/epi_judge_cpp_solutions/power_x_y.cc new file mode 100644 index 000000000..878d223bb --- /dev/null +++ b/epi_judge_cpp_solutions/power_x_y.cc @@ -0,0 +1,22 @@ +#include "test_framework/generic_test.h" +double Power(double x, int y) { + double result = 1.0; + long long power = y; + if (y < 0) { + power = -power, x = 1.0 / x; + } + while (power) { + if (power & 1) { + result *= x; + } + x *= x, power >>= 1; + } + return result; +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"x", "y"}; + return GenericTestMain(args, "power_x_y.tsv", &Power, DefaultComparator{}, + param_names); +} diff --git a/epi_judge_cpp_solutions/pretty_printing.cc b/epi_judge_cpp_solutions/pretty_printing.cc new file mode 100644 index 000000000..da91f7733 --- /dev/null +++ b/epi_judge_cpp_solutions/pretty_printing.cc @@ -0,0 +1,42 @@ +#include +#include +#include +#include +#include "test_framework/generic_test.h" + +using std::min; +using std::numeric_limits; +using std::string; +using std::vector; + +int MinimumMessiness(const vector& words, int line_length) { + // minimum_messiness[i] is the minimum messiness when placing words[0, i]. + vector minimum_messiness(size(words), numeric_limits::max()); + int num_remaining_blanks = line_length - size(words[0]); + minimum_messiness[0] = num_remaining_blanks * num_remaining_blanks; + for (int i = 1; i < size(words); ++i) { + num_remaining_blanks = line_length - size(words[i]); + minimum_messiness[i] = + minimum_messiness[i - 1] + num_remaining_blanks * num_remaining_blanks; + // Try adding words[i - 1], words[i - 2], ... + for (int j = i - 1; j >= 0; --j) { + num_remaining_blanks -= (size(words[j]) + 1); + if (num_remaining_blanks < 0) { + // Not enough space to add more words. + break; + } + int first_j_messiness = j - 1 < 0 ? 0 : minimum_messiness[j - 1]; + int current_line_messiness = num_remaining_blanks * num_remaining_blanks; + minimum_messiness[i] = + min(minimum_messiness[i], first_j_messiness + current_line_messiness); + } + } + return minimum_messiness.back(); +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"words", "line_length"}; + return GenericTestMain(args, "pretty_printing.tsv", &MinimumMessiness, + DefaultComparator{}, param_names); +} diff --git a/epi_judge_cpp_solutions/prime_sieve.cc b/epi_judge_cpp_solutions/prime_sieve.cc new file mode 100644 index 000000000..2702e169b --- /dev/null +++ b/epi_judge_cpp_solutions/prime_sieve.cc @@ -0,0 +1,41 @@ +#include +#include +#include +#include "test_framework/generic_test.h" + +using std::deque; +using std::vector; + +// Given n, return all primes up to and including n. +vector GeneratePrimes(int n) { + if (n < 2) { + return {}; + } + const int size = floor(0.5 * (n - 3)) + 1; + vector primes; + primes.emplace_back(2); + // is_prime[i] represents whether (2i + 3) is prime or not. + // Initially, set each to true. Then use sieving to eliminate nonprimes. + deque is_prime(size, true); + for (int i = 0; i < size; ++i) { + if (is_prime[i]) { + int p = (i * 2) + 3; + primes.emplace_back(p); + // Sieving from p^2, whose value is (4i^2 + 12i + 9). The index in + // is_prime is (2i^2 + 6i + 3) because is_prime[i] represents 2i + 3. + // + // Note that we need to use long long for j because p^2 might overflow. + for (long long j = 2LL * i * i + 6 * i + 3; j < size; j += p) { + is_prime[j] = false; + } + } + } + return primes; +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"n"}; + return GenericTestMain(args, "prime_sieve.tsv", &GeneratePrimes, + DefaultComparator{}, param_names); +} diff --git a/epi_judge_cpp_solutions/primitive_divide.cc b/epi_judge_cpp_solutions/primitive_divide.cc new file mode 100644 index 000000000..6720dc08e --- /dev/null +++ b/epi_judge_cpp_solutions/primitive_divide.cc @@ -0,0 +1,23 @@ +#include "test_framework/generic_test.h" +int Divide(int x, int y) { + int result = 0; + int power = 32; + unsigned long long y_power = static_cast(y) << power; + while (x >= y) { + while (y_power > x) { + y_power >>= 1; + --power; + } + + result += 1 << power; + x -= y_power; + } + return result; +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"x", "y"}; + return GenericTestMain(args, "primitive_divide.tsv", &Divide, + DefaultComparator{}, param_names); +} diff --git a/epi_judge_cpp_solutions/primitive_multiply.cc b/epi_judge_cpp_solutions/primitive_multiply.cc new file mode 100644 index 000000000..2812edd31 --- /dev/null +++ b/epi_judge_cpp_solutions/primitive_multiply.cc @@ -0,0 +1,30 @@ +#include "test_framework/generic_test.h" +unsigned long long Add(unsigned long long, unsigned long long); + +unsigned long long Multiply(unsigned long long x, unsigned long long y) { + unsigned long long sum = 0; + while (x) { + // Examines each bit of x. + if (x & 1) { + sum = Add(sum, y); + } + x >>= 1, y <<= 1; + } + return sum; +} + +unsigned long long Add(unsigned long long a, unsigned long long b) { + while (b) { + unsigned long long carry = a & b; + a = a ^ b; + b = carry << 1; + } + return a; +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"x", "y"}; + return GenericTestMain(args, "primitive_multiply.tsv", &Multiply, + DefaultComparator{}, param_names); +} diff --git a/epi_judge_cpp_solutions/queue_from_stacks.cc b/epi_judge_cpp_solutions/queue_from_stacks.cc new file mode 100644 index 000000000..e1748d80d --- /dev/null +++ b/epi_judge_cpp_solutions/queue_from_stacks.cc @@ -0,0 +1,89 @@ +#include +#include +#include +#include + +#include "test_framework/generic_test.h" +#include "test_framework/test_failure.h" +#include "test_framework/test_utils_serialization_traits.h" + +using std::length_error; +using std::stack; + +class Queue { + public: + void Enqueue(int x) { enqueue_.emplace(x); } + + int Dequeue() { + if (empty(dequeue_)) { + // Transfers the elements in enqueue_ to dequeue_. + while (!empty(enqueue_)) { + dequeue_.emplace(enqueue_.top()); + enqueue_.pop(); + } + } + + if (empty(dequeue_)) { // dequeue_ is still empty! + throw length_error("empty queue"); + } + int result = dequeue_.top(); + dequeue_.pop(); + return result; + } + + private: + stack enqueue_, dequeue_; +}; + +struct QueueOp { + enum { kConstruct, kDequeue, kEnqueue } op; + int argument; + + QueueOp(const std::string& op_string, int arg) : argument(arg) { + if (op_string == "Queue") { + op = kConstruct; + } else if (op_string == "dequeue") { + op = kDequeue; + } else if (op_string == "enqueue") { + op = kEnqueue; + } else { + throw std::runtime_error("Unsupported queue operation: " + op_string); + } + } +}; + +template <> +struct SerializationTraits : UserSerTraits { +}; + +void QueueTester(const std::vector& ops) { + try { + Queue q; + for (auto& x : ops) { + switch (x.op) { + case QueueOp::kConstruct: + break; + case QueueOp::kDequeue: { + int result = q.Dequeue(); + if (result != x.argument) { + throw TestFailure("Dequeue: expected " + + std::to_string(x.argument) + ", got " + + std::to_string(result)); + } + } break; + case QueueOp::kEnqueue: + q.Enqueue(x.argument); + break; + } + } + } catch (length_error&) { + throw TestFailure("Unexpected length_error exception"); + } +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"ops"}; + return GenericTestMain(args, "queue_from_stacks.tsv", &QueueTester, + DefaultComparator{}, param_names); +} diff --git a/epi_judge_cpp_solutions/queue_with_max.cc b/epi_judge_cpp_solutions/queue_with_max.cc new file mode 100644 index 000000000..90af63e67 --- /dev/null +++ b/epi_judge_cpp_solutions/queue_with_max.cc @@ -0,0 +1,104 @@ +#include +#include + +#define main _main +#include "stack_with_max.cc" +#undef main +#include "test_framework/generic_test.h" +#include "test_framework/test_failure.h" +#include "test_framework/test_utils_serialization_traits.h" + +using std::length_error; +using std::max; + +class QueueWithMax { + public: + void Enqueue(int x) { enqueue_.Push(x); } + + int Dequeue() { + if (dequeue_.Empty()) { + while (!enqueue_.Empty()) { + dequeue_.Push(enqueue_.Pop()); + } + } + if (!dequeue_.Empty()) { + return dequeue_.Pop(); + } + throw length_error("Cannot get Dequeue() on empty queue."); + } + + int Max() const { + if (!enqueue_.Empty()) { + return dequeue_.Empty() ? enqueue_.Max() + : max(enqueue_.Max(), dequeue_.Max()); + } else if (!dequeue_.Empty()) { + return dequeue_.Max(); + } + throw length_error("Cannot get max() on empty queue."); + } + + private: + Stack enqueue_, dequeue_; +}; + +struct QueueOp { + enum { kConstruct, kDequeue, kEnqueue, kMax } op; + int argument; + + QueueOp(const std::string& op_string, int arg) : argument(arg) { + if (op_string == "QueueWithMax") { + op = kConstruct; + } else if (op_string == "dequeue") { + op = kDequeue; + } else if (op_string == "enqueue") { + op = kEnqueue; + } else if (op_string == "max") { + op = kMax; + } else { + throw std::runtime_error("Unsupported queue operation: " + op_string); + } + } +}; + +template <> +struct SerializationTraits : UserSerTraits { +}; + +void QueueTester(const std::vector& ops) { + try { + QueueWithMax q; + for (auto& x : ops) { + switch (x.op) { + case QueueOp::kConstruct: + break; + case QueueOp::kDequeue: { + int result = q.Dequeue(); + if (result != x.argument) { + throw TestFailure("Dequeue: expected " + + std::to_string(x.argument) + ", got " + + std::to_string(result)); + } + } break; + case QueueOp::kEnqueue: + q.Enqueue(x.argument); + break; + case QueueOp::kMax: { + int s = q.Max(); + if (s != x.argument) { + throw TestFailure("Max: expected " + std::to_string(x.argument) + + ", got " + std::to_string(s)); + } + } break; + } + } + } catch (const length_error&) { + throw TestFailure("Unexpected length_error exception"); + } +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"ops"}; + return GenericTestMain(args, "queue_with_max.tsv", &QueueTester, + DefaultComparator{}, param_names); +} diff --git a/epi_judge_cpp_solutions/queue_with_max_using_deque.cc b/epi_judge_cpp_solutions/queue_with_max_using_deque.cc new file mode 100644 index 000000000..0f70d24fb --- /dev/null +++ b/epi_judge_cpp_solutions/queue_with_max_using_deque.cc @@ -0,0 +1,114 @@ +#include +#include +#include +#include +#include + +#include "test_framework/generic_test.h" +#include "test_framework/test_failure.h" +#include "test_framework/test_utils_serialization_traits.h" + +using std::deque; +using std::length_error; +using std::queue; + +template +class QueueWithMax { + public: + void Enqueue(const T& x) { + entries_.emplace(x); + // Eliminate dominated elements in candidates_for_max_. + while (!empty(candidates_for_max_) && candidates_for_max_.back() < x) { + candidates_for_max_.pop_back(); + } + candidates_for_max_.emplace_back(x); + } + + T Dequeue() { + if (!empty(entries_)) { + T result = entries_.front(); + if (result == candidates_for_max_.front()) { + candidates_for_max_.pop_front(); + } + entries_.pop(); + return result; + } + throw length_error("empty queue"); + } + + const T& Max() const { + if (!empty(candidates_for_max_)) { + return candidates_for_max_.front(); + } + throw length_error("empty queue"); + } + T& Head() { return entries_.front(); } + + const T& Head() const { return entries_.front(); } + + private: + queue entries_; + deque candidates_for_max_; +}; + +struct QueueOp { + enum { kConstruct, kDequeue, kEnqueue, kMax } op; + int argument; + + QueueOp(const std::string& op_string, int arg) : argument(arg) { + if (op_string == "QueueWithMax") { + op = kConstruct; + } else if (op_string == "dequeue") { + op = kDequeue; + } else if (op_string == "enqueue") { + op = kEnqueue; + } else if (op_string == "max") { + op = kMax; + } else { + throw std::runtime_error("Unsupported queue operation: " + op_string); + } + } +}; + +template <> +struct SerializationTraits : UserSerTraits { +}; + +void QueueTester(const std::vector& ops) { + try { + QueueWithMax q; + for (auto& x : ops) { + switch (x.op) { + case QueueOp::kConstruct: + break; + case QueueOp::kDequeue: { + int result = q.Dequeue(); + if (result != x.argument) { + throw TestFailure("Dequeue: expected " + + std::to_string(x.argument) + ", got " + + std::to_string(result)); + } + } break; + case QueueOp::kEnqueue: + q.Enqueue(x.argument); + break; + case QueueOp::kMax: { + int s = q.Max(); + if (s != x.argument) { + throw TestFailure("Max: expected " + std::to_string(x.argument) + + ", got " + std::to_string(s)); + } + } break; + } + } + } catch (length_error&) { + throw TestFailure("Unexpected length_error exception"); + } +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"ops"}; + return GenericTestMain(args, "queue_with_max.tsv", &QueueTester, + DefaultComparator{}, param_names); +} diff --git a/epi_judge_cpp_solutions/random_permutation.cc b/epi_judge_cpp_solutions/random_permutation.cc new file mode 100644 index 000000000..85813c632 --- /dev/null +++ b/epi_judge_cpp_solutions/random_permutation.cc @@ -0,0 +1,70 @@ +#include +#include +#include + +#define main _main +#include "offline_sampling.cc" +#undef main +#include "test_framework/generic_test.h" +#include "test_framework/random_sequence_checker.h" +#include "test_framework/timed_executor.h" + +using std::bind; +using std::vector; + +vector ComputeRandomPermutation(int n) { + vector permutation(n); + // Initializes permutation to 0, 1, 2, ..., n - 1. + iota(begin(permutation), end(permutation), 0); + RandomSampling(n, &permutation); + return permutation; +} + +int Factorial(int n) { return n <= 1 ? 1 : n * Factorial(n - 1); } + +int PermutationIndex(vector perm) { + int idx = 0; + int n = perm.size(); + for (int i = 0; i < perm.size(); ++i) { + int a = perm[i]; + idx += a * Factorial(n - 1); + for (int j = i + 1; j < perm.size(); ++j) { + if (perm[j] > a) { + --perm[j]; + } + } + --n; + } + return idx; +} + +bool ComputeRandomPermutationRunner(TimedExecutor& executor, int n) { + vector> results; + + executor.Run([&] { + for (int i = 0; i < 1000000; ++i) { + results.emplace_back(ComputeRandomPermutation(n)); + } + }); + + vector sequence; + for (const vector& result : results) { + sequence.emplace_back(PermutationIndex(result)); + } + return CheckSequenceIsUniformlyRandom(sequence, Factorial(n), 0.01); +} + +void ComputeRandomPermutationWrapper(TimedExecutor& executor, int n) { + RunFuncWithRetries( + std::bind(ComputeRandomPermutationRunner, std::ref(executor), n)); +} + +// clang-format off + + +int main(int argc, char* argv[]) { + std::vector args {argv + 1, argv + argc}; + std::vector param_names {"executor", "n"}; + return GenericTestMain(args, "random_permutation.tsv", &ComputeRandomPermutationWrapper, DefaultComparator{}, param_names); +} +// clang-format on diff --git a/epi_judge_cpp_solutions/random_subset.cc b/epi_judge_cpp_solutions/random_subset.cc new file mode 100644 index 000000000..4ee3e1c63 --- /dev/null +++ b/epi_judge_cpp_solutions/random_subset.cc @@ -0,0 +1,88 @@ +#include +#include +#include +#include +#include +#include +#include + +#include "test_framework/generic_test.h" +#include "test_framework/random_sequence_checker.h" +#include "test_framework/timed_executor.h" + +using std::bind; +using std::default_random_engine; +using std::iota; +using std::random_device; +using std::uniform_int_distribution; +using std::unordered_map; +using std::vector; + +// Returns a random k-sized subset of {0, 1, ..., n - 1}. +vector RandomSubset(int n, int k) { + unordered_map changed_elements; + default_random_engine seed((random_device())()); // Random num generator. + for (int i = 0; i < k; ++i) { + // Generate a random index in [i, n - 1]. + int rand_idx = uniform_int_distribution{i, n - 1}(seed); + if (auto ptr1 = changed_elements.find(rand_idx), + ptr2 = changed_elements.find(i); + ptr1 == end(changed_elements) && ptr2 == end(changed_elements)) { + changed_elements[rand_idx] = i; + changed_elements[i] = rand_idx; + } else if (ptr1 == end(changed_elements) && ptr2 != end(changed_elements)) { + changed_elements[rand_idx] = ptr2->second; + ptr2->second = rand_idx; + } else if (ptr1 != end(changed_elements) && ptr2 == end(changed_elements)) { + changed_elements[i] = ptr1->second; + ptr1->second = i; + } else { + int temp = ptr2->second; + changed_elements[i] = ptr1->second; + changed_elements[rand_idx] = temp; + } + } + + vector result; + for (int i = 0; i < k; ++i) { + result.emplace_back(changed_elements[i]); + } + return result; +} + +bool RandomSubsetRunner(TimedExecutor& executor, int n, int k) { + vector> results; + + executor.Run([&] { + std::generate_n(back_inserter(results), 100000, + std::bind(RandomSubset, n, k)); + }); + + int total_possible_outcomes = BinomialCoefficient(n, k); + vector A(n); + iota(begin(A), end(A), 0); + vector> combinations; + for (int i = 0; i < BinomialCoefficient(n, k); ++i) { + combinations.emplace_back(ComputeCombinationIdx(A, n, k, i)); + } + vector sequence; + for (vector result : results) { + sort(begin(result), end(result)); + sequence.emplace_back( + distance(begin(combinations), + find(begin(combinations), end(combinations), result))); + } + return CheckSequenceIsUniformlyRandom(sequence, total_possible_outcomes, + 0.01); +} + +void RandomSubsetWrapper(TimedExecutor& executor, int n, int k) { + RunFuncWithRetries(bind(RandomSubsetRunner, std::ref(executor), n, k)); +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"executor", "n", "k"}; + return GenericTestMain(args, "random_subset.tsv", &RandomSubsetWrapper, + DefaultComparator{}, param_names); +} diff --git a/epi_judge_cpp_solutions/real_square_root.cc b/epi_judge_cpp_solutions/real_square_root.cc new file mode 100644 index 000000000..da184e858 --- /dev/null +++ b/epi_judge_cpp_solutions/real_square_root.cc @@ -0,0 +1,47 @@ +#include +#include +#include +#include "test_framework/generic_test.h" + +using std::abs; +using std::max; +using std::numeric_limits; + +typedef enum { kSmaller, kEqual, kLarger } Ordering; + +Ordering Compare(double a, double b); +double SquareRoot(double x) { + // Decides the search range according to x's value relative to 1.0. + double left, right; + if (x < 1.0) { + left = x, right = 1.0; + } else { // x >= 1.0. + left = 1.0, right = x; + } + + // Keeps searching as long as left != right, within tolerance. + while (Compare(left, right) != kEqual) { + double mid = left + 0.5 * (right - left); + if (double mid_squared = mid * mid; Compare(mid_squared, x) == kLarger) { + right = mid; + } else { + left = mid; + } + } + return left; +} + +Ordering Compare(double a, double b) { + // Uses normalization for precision problem. + double diff = (a - b) / max(abs(a), abs(b)); + return diff < -numeric_limits::epsilon() + ? kSmaller + : diff > numeric_limits::epsilon() ? kLarger : kEqual; +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"x"}; + return GenericTestMain(args, "real_square_root.tsv", &SquareRoot, + DefaultComparator{}, param_names); +} diff --git a/epi_judge_cpp_solutions/rectangle_intersection.cc b/epi_judge_cpp_solutions/rectangle_intersection.cc new file mode 100644 index 000000000..2589569c4 --- /dev/null +++ b/epi_judge_cpp_solutions/rectangle_intersection.cc @@ -0,0 +1,50 @@ +#include +#include + +#include "test_framework/fmt_print.h" +#include "test_framework/generic_test.h" +#include "test_framework/test_utils_serialization_traits.h" + +using std::max; +using std::min; + +struct Rectangle; +bool IsIntersect(const Rectangle&, const Rectangle&); + +struct Rectangle { + int x, y, width, height; +}; + +Rectangle IntersectRectangle(const Rectangle& R1, const Rectangle& R2) { + if (!IsIntersect(R1, R2)) { + return {0, 0, -1, -1}; // No intersection. + } + return {max(R1.x, R2.x), max(R1.y, R2.y), + min(R1.x + R1.width, R2.x + R2.width) - max(R1.x, R2.x), + min(R1.y + R1.height, R2.y + R2.height) - max(R1.y, R2.y)}; +} + +bool IsIntersect(const Rectangle& R1, const Rectangle& R2) { + return R1.x <= R2.x + R2.width && R1.x + R1.width >= R2.x && + R1.y <= R2.y + R2.height && R1.y + R1.height >= R2.y; +} + +bool operator==(const Rectangle& r1, const Rectangle& r2) { + return std::tie(r1.x, r1.y, r1.width, r1.height) == + std::tie(r2.x, r2.y, r2.width, r2.height); +} + +template <> +struct SerializationTraits + : UserSerTraits {}; + +std::ostream& operator<<(std::ostream& out, const Rectangle& r) { + return PrintTo(out, std::make_tuple(r.x, r.y, r.width, r.height)); +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"R1", "R2"}; + return GenericTestMain(args, "rectangle_intersection.tsv", + &IntersectRectangle, DefaultComparator{}, param_names); +} diff --git a/epi_judge_cpp_solutions/refueling_schedule.cc b/epi_judge_cpp_solutions/refueling_schedule.cc new file mode 100644 index 000000000..5474ca608 --- /dev/null +++ b/epi_judge_cpp_solutions/refueling_schedule.cc @@ -0,0 +1,31 @@ +#include +#include "test_framework/generic_test.h" + +using std::vector; + +const int kMPG = 20; + +// gallons[i] is the amount of gas in city i, and distances[i] is the distance +// city i to the next city. +int FindAmpleCity(const vector& gallons, const vector& distances) { + int remaining_gallons = 0; + struct CityAndRemainingGas { + int city = 0, remaining_gallons = 0; + }; + CityAndRemainingGas city_remaining_gallons_pair; + const int num_cities = size(gallons); + for (int i = 1; i < num_cities; ++i) { + remaining_gallons += gallons[i - 1] - distances[i - 1] / kMPG; + if (remaining_gallons < city_remaining_gallons_pair.remaining_gallons) { + city_remaining_gallons_pair = {i, remaining_gallons}; + } + } + return city_remaining_gallons_pair.city; +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"gallons", "distances"}; + return GenericTestMain(args, "refueling_schedule.tsv", &FindAmpleCity, + DefaultComparator{}, param_names); +} diff --git a/epi_judge_cpp_solutions/regular_expression.cc b/epi_judge_cpp_solutions/regular_expression.cc new file mode 100644 index 000000000..d4fffea46 --- /dev/null +++ b/epi_judge_cpp_solutions/regular_expression.cc @@ -0,0 +1,61 @@ +#include +#include "test_framework/generic_test.h" + +using std::string; + +bool IsMatchHere(const string &, int, const string &, int); + +bool IsMatch(const string ®ex, const string &s) { + // Case (2.): regex starts with '^'. + if (regex.front() == '^') { + return IsMatchHere(regex, 1, s, 0); + } + + for (int i = 0; i <= size(s); ++i) { + if (IsMatchHere(regex, 0, s, i)) { + return true; + } + } + return false; +} + +bool IsMatchHere(const string ®ex, int regex_offset, const string &s, + int s_offset) { + if (regex_offset == size(regex)) { + // Case (1.): Empty regex matches all strings. + return true; + } + + if (regex_offset == size(regex) - 1 && regex[regex_offset] == '$') { + // Case (2.): Reach the end of regex, and last char is '$'. + return s_offset == size(s); + } + + if (size(regex) - regex_offset >= 2 && regex[regex_offset + 1] == '*') { + // Case (3.): A '*' match. + // Iterate through s, checking '*' condition, if '*' condition holds, + // performs the remaining checks. + for (int i = s_offset + 1; + i <= size(s) && + (regex[regex_offset] == '.' || regex[regex_offset] == s[i - 1]); + ++i) { + if (IsMatchHere(regex, regex_offset + 2, s, i)) { + return true; + } + } + // See '*' matches zero character in s[s_offset, size(s) - 1]. + return IsMatchHere(regex, regex_offset + 2, s, s_offset); + } + + // Case (4.): regex begins with single character match. + return s_offset < size(s) && + (regex[regex_offset] == '.' || regex[regex_offset] == s[s_offset]) && + IsMatchHere(regex, regex_offset + 1, s, s_offset + 1); +} + +int main(int argc, char *argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"regex", "s"}; + return GenericTestMain(args, "regular_expression.tsv", &IsMatch, + DefaultComparator{}, param_names); +} diff --git a/epi_judge_cpp_solutions/remove_duplicates.cc b/epi_judge_cpp_solutions/remove_duplicates.cc new file mode 100644 index 000000000..54e40830a --- /dev/null +++ b/epi_judge_cpp_solutions/remove_duplicates.cc @@ -0,0 +1,60 @@ +#include +#include +#include +#include + +#include "test_framework/generic_test.h" +#include "test_framework/test_utils_serialization_traits.h" + +using std::string; +using std::vector; + +struct Name { + bool operator==(const Name& that) const { + return first_name == that.first_name; + } + + bool operator<(const Name& that) const { + return first_name != that.first_name ? first_name < that.first_name + : last_name < that.last_name; + } + + string first_name, last_name; +}; + +void EliminateDuplicate(vector* names) { + sort(begin(*names), + end(*names)); // Makes identical elements become neighbors. + // unique() removes adjacent duplicates and returns an iterator to the + // element the follows the last element not removed. The effect of erase() + // is to restrict names to the distinct elements. + names->erase(unique(begin(*names), end(*names)), end(*names)); +} + +template <> +struct SerializationTraits + : UserSerTraits {}; + +std::ostream& operator<<(std::ostream& out, const Name& n) { + return out << n.first_name; +} + +vector EliminateDuplicateWrapper(vector names) { + EliminateDuplicate(&names); + return names; +} + +bool Comp(vector expected, vector result) { + std::sort(begin(expected), end(expected)); + std::sort(begin(result), end(result)); + return std::equal( + begin(expected), end(expected), begin(result), end(result), + [](const std::string& s, const Name& n) { return s == n.first_name; }); +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"names"}; + return GenericTestMain(args, "remove_duplicates.tsv", + &EliminateDuplicateWrapper, &Comp, param_names); +} diff --git a/epi_judge_cpp_solutions/remove_duplicates_from_sorted_list.cc b/epi_judge_cpp_solutions/remove_duplicates_from_sorted_list.cc new file mode 100644 index 000000000..daba58e40 --- /dev/null +++ b/epi_judge_cpp_solutions/remove_duplicates_from_sorted_list.cc @@ -0,0 +1,27 @@ +#include + +#include "list_node.h" +#include "test_framework/generic_test.h" + +using std::shared_ptr; + +shared_ptr> RemoveDuplicates(const shared_ptr>& L) { + auto iter = L; + while (iter) { + // Uses next_distinct to find the next distinct value. + auto next_distinct = iter->next; + while (next_distinct && next_distinct->data == iter->data) { + next_distinct = next_distinct->next; + } + iter->next = next_distinct; + iter = next_distinct; + } + return L; +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"L"}; + return GenericTestMain(args, "remove_duplicates_from_sorted_list.tsv", + &RemoveDuplicates, DefaultComparator{}, param_names); +} diff --git a/epi_judge_cpp_solutions/replace_and_remove.cc b/epi_judge_cpp_solutions/replace_and_remove.cc new file mode 100644 index 000000000..e8c8b53c7 --- /dev/null +++ b/epi_judge_cpp_solutions/replace_and_remove.cc @@ -0,0 +1,64 @@ +#include +#include +#include + +#include "test_framework/generic_test.h" +#include "test_framework/timed_executor.h" + +using std::string; +using std::vector; + +int ReplaceAndRemove(int size, char s[]) { + // Forward iteration: remove "b"s and count the number of "a"s. + int write_idx = 0, a_count = 0; + for (int i = 0; i < size; ++i) { + if (s[i] != 'b') { + s[write_idx++] = s[i]; + } + if (s[i] == 'a') { + ++a_count; + } + } + + // Backward iteration: replace "a"s with "dd"s starting from the end. + int cur_idx = write_idx - 1; + write_idx = write_idx + a_count - 1; + const int final_size = write_idx + 1; + while (cur_idx >= 0) { + if (s[cur_idx] == 'a') { + s[write_idx--] = 'd'; + s[write_idx--] = 'd'; + } else { + s[write_idx--] = s[cur_idx]; + } + --cur_idx; + } + return final_size; +} + +vector ReplaceAndRemoveWrapper(TimedExecutor& executor, int size, + const vector& s) { + std::vector s_copy(s.size(), '\0'); + for (int i = 0; i < s.size(); ++i) { + if (!s[i].empty()) { + s_copy[i] = s[i][0]; + } + } + + int res_size = + executor.Run([&] { return ReplaceAndRemove(size, s_copy.data()); }); + + vector result; + for (int i = 0; i < res_size; ++i) { + result.emplace_back(string(1, s_copy[i])); + } + return result; +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"executor", "size", "s"}; + return GenericTestMain(args, "replace_and_remove.tsv", + &ReplaceAndRemoveWrapper, DefaultComparator{}, + param_names); +} diff --git a/epi_judge_cpp_solutions/reverse_bits.cc b/epi_judge_cpp_solutions/reverse_bits.cc new file mode 100644 index 000000000..5e587de85 --- /dev/null +++ b/epi_judge_cpp_solutions/reverse_bits.cc @@ -0,0 +1,5980 @@ +#include +#include "test_framework/generic_test.h" + +using std::array; + +static array precomputed_reverse{ + 0, 32768, 16384, 49152, 8192, 40960, 24576, 57344, 4096, 36864, 20480, + 53248, 12288, 45056, 28672, 61440, 2048, 34816, 18432, 51200, 10240, 43008, + 26624, 59392, 6144, 38912, 22528, 55296, 14336, 47104, 30720, 63488, 1024, + 33792, 17408, 50176, 9216, 41984, 25600, 58368, 5120, 37888, 21504, 54272, + 13312, 46080, 29696, 62464, 3072, 35840, 19456, 52224, 11264, 44032, 27648, + 60416, 7168, 39936, 23552, 56320, 15360, 48128, 31744, 64512, 512, 33280, + 16896, 49664, 8704, 41472, 25088, 57856, 4608, 37376, 20992, 53760, 12800, + 45568, 29184, 61952, 2560, 35328, 18944, 51712, 10752, 43520, 27136, 59904, + 6656, 39424, 23040, 55808, 14848, 47616, 31232, 64000, 1536, 34304, 17920, + 50688, 9728, 42496, 26112, 58880, 5632, 38400, 22016, 54784, 13824, 46592, + 30208, 62976, 3584, 36352, 19968, 52736, 11776, 44544, 28160, 60928, 7680, + 40448, 24064, 56832, 15872, 48640, 32256, 65024, 256, 33024, 16640, 49408, + 8448, 41216, 24832, 57600, 4352, 37120, 20736, 53504, 12544, 45312, 28928, + 61696, 2304, 35072, 18688, 51456, 10496, 43264, 26880, 59648, 6400, 39168, + 22784, 55552, 14592, 47360, 30976, 63744, 1280, 34048, 17664, 50432, 9472, + 42240, 25856, 58624, 5376, 38144, 21760, 54528, 13568, 46336, 29952, 62720, + 3328, 36096, 19712, 52480, 11520, 44288, 27904, 60672, 7424, 40192, 23808, + 56576, 15616, 48384, 32000, 64768, 768, 33536, 17152, 49920, 8960, 41728, + 25344, 58112, 4864, 37632, 21248, 54016, 13056, 45824, 29440, 62208, 2816, + 35584, 19200, 51968, 11008, 43776, 27392, 60160, 6912, 39680, 23296, 56064, + 15104, 47872, 31488, 64256, 1792, 34560, 18176, 50944, 9984, 42752, 26368, + 59136, 5888, 38656, 22272, 55040, 14080, 46848, 30464, 63232, 3840, 36608, + 20224, 52992, 12032, 44800, 28416, 61184, 7936, 40704, 24320, 57088, 16128, + 48896, 32512, 65280, 128, 32896, 16512, 49280, 8320, 41088, 24704, 57472, + 4224, 36992, 20608, 53376, 12416, 45184, 28800, 61568, 2176, 34944, 18560, + 51328, 10368, 43136, 26752, 59520, 6272, 39040, 22656, 55424, 14464, 47232, + 30848, 63616, 1152, 33920, 17536, 50304, 9344, 42112, 25728, 58496, 5248, + 38016, 21632, 54400, 13440, 46208, 29824, 62592, 3200, 35968, 19584, 52352, + 11392, 44160, 27776, 60544, 7296, 40064, 23680, 56448, 15488, 48256, 31872, + 64640, 640, 33408, 17024, 49792, 8832, 41600, 25216, 57984, 4736, 37504, + 21120, 53888, 12928, 45696, 29312, 62080, 2688, 35456, 19072, 51840, 10880, + 43648, 27264, 60032, 6784, 39552, 23168, 55936, 14976, 47744, 31360, 64128, + 1664, 34432, 18048, 50816, 9856, 42624, 26240, 59008, 5760, 38528, 22144, + 54912, 13952, 46720, 30336, 63104, 3712, 36480, 20096, 52864, 11904, 44672, + 28288, 61056, 7808, 40576, 24192, 56960, 16000, 48768, 32384, 65152, 384, + 33152, 16768, 49536, 8576, 41344, 24960, 57728, 4480, 37248, 20864, 53632, + 12672, 45440, 29056, 61824, 2432, 35200, 18816, 51584, 10624, 43392, 27008, + 59776, 6528, 39296, 22912, 55680, 14720, 47488, 31104, 63872, 1408, 34176, + 17792, 50560, 9600, 42368, 25984, 58752, 5504, 38272, 21888, 54656, 13696, + 46464, 30080, 62848, 3456, 36224, 19840, 52608, 11648, 44416, 28032, 60800, + 7552, 40320, 23936, 56704, 15744, 48512, 32128, 64896, 896, 33664, 17280, + 50048, 9088, 41856, 25472, 58240, 4992, 37760, 21376, 54144, 13184, 45952, + 29568, 62336, 2944, 35712, 19328, 52096, 11136, 43904, 27520, 60288, 7040, + 39808, 23424, 56192, 15232, 48000, 31616, 64384, 1920, 34688, 18304, 51072, + 10112, 42880, 26496, 59264, 6016, 38784, 22400, 55168, 14208, 46976, 30592, + 63360, 3968, 36736, 20352, 53120, 12160, 44928, 28544, 61312, 8064, 40832, + 24448, 57216, 16256, 49024, 32640, 65408, 64, 32832, 16448, 49216, 8256, + 41024, 24640, 57408, 4160, 36928, 20544, 53312, 12352, 45120, 28736, 61504, + 2112, 34880, 18496, 51264, 10304, 43072, 26688, 59456, 6208, 38976, 22592, + 55360, 14400, 47168, 30784, 63552, 1088, 33856, 17472, 50240, 9280, 42048, + 25664, 58432, 5184, 37952, 21568, 54336, 13376, 46144, 29760, 62528, 3136, + 35904, 19520, 52288, 11328, 44096, 27712, 60480, 7232, 40000, 23616, 56384, + 15424, 48192, 31808, 64576, 576, 33344, 16960, 49728, 8768, 41536, 25152, + 57920, 4672, 37440, 21056, 53824, 12864, 45632, 29248, 62016, 2624, 35392, + 19008, 51776, 10816, 43584, 27200, 59968, 6720, 39488, 23104, 55872, 14912, + 47680, 31296, 64064, 1600, 34368, 17984, 50752, 9792, 42560, 26176, 58944, + 5696, 38464, 22080, 54848, 13888, 46656, 30272, 63040, 3648, 36416, 20032, + 52800, 11840, 44608, 28224, 60992, 7744, 40512, 24128, 56896, 15936, 48704, + 32320, 65088, 320, 33088, 16704, 49472, 8512, 41280, 24896, 57664, 4416, + 37184, 20800, 53568, 12608, 45376, 28992, 61760, 2368, 35136, 18752, 51520, + 10560, 43328, 26944, 59712, 6464, 39232, 22848, 55616, 14656, 47424, 31040, + 63808, 1344, 34112, 17728, 50496, 9536, 42304, 25920, 58688, 5440, 38208, + 21824, 54592, 13632, 46400, 30016, 62784, 3392, 36160, 19776, 52544, 11584, + 44352, 27968, 60736, 7488, 40256, 23872, 56640, 15680, 48448, 32064, 64832, + 832, 33600, 17216, 49984, 9024, 41792, 25408, 58176, 4928, 37696, 21312, + 54080, 13120, 45888, 29504, 62272, 2880, 35648, 19264, 52032, 11072, 43840, + 27456, 60224, 6976, 39744, 23360, 56128, 15168, 47936, 31552, 64320, 1856, + 34624, 18240, 51008, 10048, 42816, 26432, 59200, 5952, 38720, 22336, 55104, + 14144, 46912, 30528, 63296, 3904, 36672, 20288, 53056, 12096, 44864, 28480, + 61248, 8000, 40768, 24384, 57152, 16192, 48960, 32576, 65344, 192, 32960, + 16576, 49344, 8384, 41152, 24768, 57536, 4288, 37056, 20672, 53440, 12480, + 45248, 28864, 61632, 2240, 35008, 18624, 51392, 10432, 43200, 26816, 59584, + 6336, 39104, 22720, 55488, 14528, 47296, 30912, 63680, 1216, 33984, 17600, + 50368, 9408, 42176, 25792, 58560, 5312, 38080, 21696, 54464, 13504, 46272, + 29888, 62656, 3264, 36032, 19648, 52416, 11456, 44224, 27840, 60608, 7360, + 40128, 23744, 56512, 15552, 48320, 31936, 64704, 704, 33472, 17088, 49856, + 8896, 41664, 25280, 58048, 4800, 37568, 21184, 53952, 12992, 45760, 29376, + 62144, 2752, 35520, 19136, 51904, 10944, 43712, 27328, 60096, 6848, 39616, + 23232, 56000, 15040, 47808, 31424, 64192, 1728, 34496, 18112, 50880, 9920, + 42688, 26304, 59072, 5824, 38592, 22208, 54976, 14016, 46784, 30400, 63168, + 3776, 36544, 20160, 52928, 11968, 44736, 28352, 61120, 7872, 40640, 24256, + 57024, 16064, 48832, 32448, 65216, 448, 33216, 16832, 49600, 8640, 41408, + 25024, 57792, 4544, 37312, 20928, 53696, 12736, 45504, 29120, 61888, 2496, + 35264, 18880, 51648, 10688, 43456, 27072, 59840, 6592, 39360, 22976, 55744, + 14784, 47552, 31168, 63936, 1472, 34240, 17856, 50624, 9664, 42432, 26048, + 58816, 5568, 38336, 21952, 54720, 13760, 46528, 30144, 62912, 3520, 36288, + 19904, 52672, 11712, 44480, 28096, 60864, 7616, 40384, 24000, 56768, 15808, + 48576, 32192, 64960, 960, 33728, 17344, 50112, 9152, 41920, 25536, 58304, + 5056, 37824, 21440, 54208, 13248, 46016, 29632, 62400, 3008, 35776, 19392, + 52160, 11200, 43968, 27584, 60352, 7104, 39872, 23488, 56256, 15296, 48064, + 31680, 64448, 1984, 34752, 18368, 51136, 10176, 42944, 26560, 59328, 6080, + 38848, 22464, 55232, 14272, 47040, 30656, 63424, 4032, 36800, 20416, 53184, + 12224, 44992, 28608, 61376, 8128, 40896, 24512, 57280, 16320, 49088, 32704, + 65472, 32, 32800, 16416, 49184, 8224, 40992, 24608, 57376, 4128, 36896, + 20512, 53280, 12320, 45088, 28704, 61472, 2080, 34848, 18464, 51232, 10272, + 43040, 26656, 59424, 6176, 38944, 22560, 55328, 14368, 47136, 30752, 63520, + 1056, 33824, 17440, 50208, 9248, 42016, 25632, 58400, 5152, 37920, 21536, + 54304, 13344, 46112, 29728, 62496, 3104, 35872, 19488, 52256, 11296, 44064, + 27680, 60448, 7200, 39968, 23584, 56352, 15392, 48160, 31776, 64544, 544, + 33312, 16928, 49696, 8736, 41504, 25120, 57888, 4640, 37408, 21024, 53792, + 12832, 45600, 29216, 61984, 2592, 35360, 18976, 51744, 10784, 43552, 27168, + 59936, 6688, 39456, 23072, 55840, 14880, 47648, 31264, 64032, 1568, 34336, + 17952, 50720, 9760, 42528, 26144, 58912, 5664, 38432, 22048, 54816, 13856, + 46624, 30240, 63008, 3616, 36384, 20000, 52768, 11808, 44576, 28192, 60960, + 7712, 40480, 24096, 56864, 15904, 48672, 32288, 65056, 288, 33056, 16672, + 49440, 8480, 41248, 24864, 57632, 4384, 37152, 20768, 53536, 12576, 45344, + 28960, 61728, 2336, 35104, 18720, 51488, 10528, 43296, 26912, 59680, 6432, + 39200, 22816, 55584, 14624, 47392, 31008, 63776, 1312, 34080, 17696, 50464, + 9504, 42272, 25888, 58656, 5408, 38176, 21792, 54560, 13600, 46368, 29984, + 62752, 3360, 36128, 19744, 52512, 11552, 44320, 27936, 60704, 7456, 40224, + 23840, 56608, 15648, 48416, 32032, 64800, 800, 33568, 17184, 49952, 8992, + 41760, 25376, 58144, 4896, 37664, 21280, 54048, 13088, 45856, 29472, 62240, + 2848, 35616, 19232, 52000, 11040, 43808, 27424, 60192, 6944, 39712, 23328, + 56096, 15136, 47904, 31520, 64288, 1824, 34592, 18208, 50976, 10016, 42784, + 26400, 59168, 5920, 38688, 22304, 55072, 14112, 46880, 30496, 63264, 3872, + 36640, 20256, 53024, 12064, 44832, 28448, 61216, 7968, 40736, 24352, 57120, + 16160, 48928, 32544, 65312, 160, 32928, 16544, 49312, 8352, 41120, 24736, + 57504, 4256, 37024, 20640, 53408, 12448, 45216, 28832, 61600, 2208, 34976, + 18592, 51360, 10400, 43168, 26784, 59552, 6304, 39072, 22688, 55456, 14496, + 47264, 30880, 63648, 1184, 33952, 17568, 50336, 9376, 42144, 25760, 58528, + 5280, 38048, 21664, 54432, 13472, 46240, 29856, 62624, 3232, 36000, 19616, + 52384, 11424, 44192, 27808, 60576, 7328, 40096, 23712, 56480, 15520, 48288, + 31904, 64672, 672, 33440, 17056, 49824, 8864, 41632, 25248, 58016, 4768, + 37536, 21152, 53920, 12960, 45728, 29344, 62112, 2720, 35488, 19104, 51872, + 10912, 43680, 27296, 60064, 6816, 39584, 23200, 55968, 15008, 47776, 31392, + 64160, 1696, 34464, 18080, 50848, 9888, 42656, 26272, 59040, 5792, 38560, + 22176, 54944, 13984, 46752, 30368, 63136, 3744, 36512, 20128, 52896, 11936, + 44704, 28320, 61088, 7840, 40608, 24224, 56992, 16032, 48800, 32416, 65184, + 416, 33184, 16800, 49568, 8608, 41376, 24992, 57760, 4512, 37280, 20896, + 53664, 12704, 45472, 29088, 61856, 2464, 35232, 18848, 51616, 10656, 43424, + 27040, 59808, 6560, 39328, 22944, 55712, 14752, 47520, 31136, 63904, 1440, + 34208, 17824, 50592, 9632, 42400, 26016, 58784, 5536, 38304, 21920, 54688, + 13728, 46496, 30112, 62880, 3488, 36256, 19872, 52640, 11680, 44448, 28064, + 60832, 7584, 40352, 23968, 56736, 15776, 48544, 32160, 64928, 928, 33696, + 17312, 50080, 9120, 41888, 25504, 58272, 5024, 37792, 21408, 54176, 13216, + 45984, 29600, 62368, 2976, 35744, 19360, 52128, 11168, 43936, 27552, 60320, + 7072, 39840, 23456, 56224, 15264, 48032, 31648, 64416, 1952, 34720, 18336, + 51104, 10144, 42912, 26528, 59296, 6048, 38816, 22432, 55200, 14240, 47008, + 30624, 63392, 4000, 36768, 20384, 53152, 12192, 44960, 28576, 61344, 8096, + 40864, 24480, 57248, 16288, 49056, 32672, 65440, 96, 32864, 16480, 49248, + 8288, 41056, 24672, 57440, 4192, 36960, 20576, 53344, 12384, 45152, 28768, + 61536, 2144, 34912, 18528, 51296, 10336, 43104, 26720, 59488, 6240, 39008, + 22624, 55392, 14432, 47200, 30816, 63584, 1120, 33888, 17504, 50272, 9312, + 42080, 25696, 58464, 5216, 37984, 21600, 54368, 13408, 46176, 29792, 62560, + 3168, 35936, 19552, 52320, 11360, 44128, 27744, 60512, 7264, 40032, 23648, + 56416, 15456, 48224, 31840, 64608, 608, 33376, 16992, 49760, 8800, 41568, + 25184, 57952, 4704, 37472, 21088, 53856, 12896, 45664, 29280, 62048, 2656, + 35424, 19040, 51808, 10848, 43616, 27232, 60000, 6752, 39520, 23136, 55904, + 14944, 47712, 31328, 64096, 1632, 34400, 18016, 50784, 9824, 42592, 26208, + 58976, 5728, 38496, 22112, 54880, 13920, 46688, 30304, 63072, 3680, 36448, + 20064, 52832, 11872, 44640, 28256, 61024, 7776, 40544, 24160, 56928, 15968, + 48736, 32352, 65120, 352, 33120, 16736, 49504, 8544, 41312, 24928, 57696, + 4448, 37216, 20832, 53600, 12640, 45408, 29024, 61792, 2400, 35168, 18784, + 51552, 10592, 43360, 26976, 59744, 6496, 39264, 22880, 55648, 14688, 47456, + 31072, 63840, 1376, 34144, 17760, 50528, 9568, 42336, 25952, 58720, 5472, + 38240, 21856, 54624, 13664, 46432, 30048, 62816, 3424, 36192, 19808, 52576, + 11616, 44384, 28000, 60768, 7520, 40288, 23904, 56672, 15712, 48480, 32096, + 64864, 864, 33632, 17248, 50016, 9056, 41824, 25440, 58208, 4960, 37728, + 21344, 54112, 13152, 45920, 29536, 62304, 2912, 35680, 19296, 52064, 11104, + 43872, 27488, 60256, 7008, 39776, 23392, 56160, 15200, 47968, 31584, 64352, + 1888, 34656, 18272, 51040, 10080, 42848, 26464, 59232, 5984, 38752, 22368, + 55136, 14176, 46944, 30560, 63328, 3936, 36704, 20320, 53088, 12128, 44896, + 28512, 61280, 8032, 40800, 24416, 57184, 16224, 48992, 32608, 65376, 224, + 32992, 16608, 49376, 8416, 41184, 24800, 57568, 4320, 37088, 20704, 53472, + 12512, 45280, 28896, 61664, 2272, 35040, 18656, 51424, 10464, 43232, 26848, + 59616, 6368, 39136, 22752, 55520, 14560, 47328, 30944, 63712, 1248, 34016, + 17632, 50400, 9440, 42208, 25824, 58592, 5344, 38112, 21728, 54496, 13536, + 46304, 29920, 62688, 3296, 36064, 19680, 52448, 11488, 44256, 27872, 60640, + 7392, 40160, 23776, 56544, 15584, 48352, 31968, 64736, 736, 33504, 17120, + 49888, 8928, 41696, 25312, 58080, 4832, 37600, 21216, 53984, 13024, 45792, + 29408, 62176, 2784, 35552, 19168, 51936, 10976, 43744, 27360, 60128, 6880, + 39648, 23264, 56032, 15072, 47840, 31456, 64224, 1760, 34528, 18144, 50912, + 9952, 42720, 26336, 59104, 5856, 38624, 22240, 55008, 14048, 46816, 30432, + 63200, 3808, 36576, 20192, 52960, 12000, 44768, 28384, 61152, 7904, 40672, + 24288, 57056, 16096, 48864, 32480, 65248, 480, 33248, 16864, 49632, 8672, + 41440, 25056, 57824, 4576, 37344, 20960, 53728, 12768, 45536, 29152, 61920, + 2528, 35296, 18912, 51680, 10720, 43488, 27104, 59872, 6624, 39392, 23008, + 55776, 14816, 47584, 31200, 63968, 1504, 34272, 17888, 50656, 9696, 42464, + 26080, 58848, 5600, 38368, 21984, 54752, 13792, 46560, 30176, 62944, 3552, + 36320, 19936, 52704, 11744, 44512, 28128, 60896, 7648, 40416, 24032, 56800, + 15840, 48608, 32224, 64992, 992, 33760, 17376, 50144, 9184, 41952, 25568, + 58336, 5088, 37856, 21472, 54240, 13280, 46048, 29664, 62432, 3040, 35808, + 19424, 52192, 11232, 44000, 27616, 60384, 7136, 39904, 23520, 56288, 15328, + 48096, 31712, 64480, 2016, 34784, 18400, 51168, 10208, 42976, 26592, 59360, + 6112, 38880, 22496, 55264, 14304, 47072, 30688, 63456, 4064, 36832, 20448, + 53216, 12256, 45024, 28640, 61408, 8160, 40928, 24544, 57312, 16352, 49120, + 32736, 65504, 16, 32784, 16400, 49168, 8208, 40976, 24592, 57360, 4112, + 36880, 20496, 53264, 12304, 45072, 28688, 61456, 2064, 34832, 18448, 51216, + 10256, 43024, 26640, 59408, 6160, 38928, 22544, 55312, 14352, 47120, 30736, + 63504, 1040, 33808, 17424, 50192, 9232, 42000, 25616, 58384, 5136, 37904, + 21520, 54288, 13328, 46096, 29712, 62480, 3088, 35856, 19472, 52240, 11280, + 44048, 27664, 60432, 7184, 39952, 23568, 56336, 15376, 48144, 31760, 64528, + 528, 33296, 16912, 49680, 8720, 41488, 25104, 57872, 4624, 37392, 21008, + 53776, 12816, 45584, 29200, 61968, 2576, 35344, 18960, 51728, 10768, 43536, + 27152, 59920, 6672, 39440, 23056, 55824, 14864, 47632, 31248, 64016, 1552, + 34320, 17936, 50704, 9744, 42512, 26128, 58896, 5648, 38416, 22032, 54800, + 13840, 46608, 30224, 62992, 3600, 36368, 19984, 52752, 11792, 44560, 28176, + 60944, 7696, 40464, 24080, 56848, 15888, 48656, 32272, 65040, 272, 33040, + 16656, 49424, 8464, 41232, 24848, 57616, 4368, 37136, 20752, 53520, 12560, + 45328, 28944, 61712, 2320, 35088, 18704, 51472, 10512, 43280, 26896, 59664, + 6416, 39184, 22800, 55568, 14608, 47376, 30992, 63760, 1296, 34064, 17680, + 50448, 9488, 42256, 25872, 58640, 5392, 38160, 21776, 54544, 13584, 46352, + 29968, 62736, 3344, 36112, 19728, 52496, 11536, 44304, 27920, 60688, 7440, + 40208, 23824, 56592, 15632, 48400, 32016, 64784, 784, 33552, 17168, 49936, + 8976, 41744, 25360, 58128, 4880, 37648, 21264, 54032, 13072, 45840, 29456, + 62224, 2832, 35600, 19216, 51984, 11024, 43792, 27408, 60176, 6928, 39696, + 23312, 56080, 15120, 47888, 31504, 64272, 1808, 34576, 18192, 50960, 10000, + 42768, 26384, 59152, 5904, 38672, 22288, 55056, 14096, 46864, 30480, 63248, + 3856, 36624, 20240, 53008, 12048, 44816, 28432, 61200, 7952, 40720, 24336, + 57104, 16144, 48912, 32528, 65296, 144, 32912, 16528, 49296, 8336, 41104, + 24720, 57488, 4240, 37008, 20624, 53392, 12432, 45200, 28816, 61584, 2192, + 34960, 18576, 51344, 10384, 43152, 26768, 59536, 6288, 39056, 22672, 55440, + 14480, 47248, 30864, 63632, 1168, 33936, 17552, 50320, 9360, 42128, 25744, + 58512, 5264, 38032, 21648, 54416, 13456, 46224, 29840, 62608, 3216, 35984, + 19600, 52368, 11408, 44176, 27792, 60560, 7312, 40080, 23696, 56464, 15504, + 48272, 31888, 64656, 656, 33424, 17040, 49808, 8848, 41616, 25232, 58000, + 4752, 37520, 21136, 53904, 12944, 45712, 29328, 62096, 2704, 35472, 19088, + 51856, 10896, 43664, 27280, 60048, 6800, 39568, 23184, 55952, 14992, 47760, + 31376, 64144, 1680, 34448, 18064, 50832, 9872, 42640, 26256, 59024, 5776, + 38544, 22160, 54928, 13968, 46736, 30352, 63120, 3728, 36496, 20112, 52880, + 11920, 44688, 28304, 61072, 7824, 40592, 24208, 56976, 16016, 48784, 32400, + 65168, 400, 33168, 16784, 49552, 8592, 41360, 24976, 57744, 4496, 37264, + 20880, 53648, 12688, 45456, 29072, 61840, 2448, 35216, 18832, 51600, 10640, + 43408, 27024, 59792, 6544, 39312, 22928, 55696, 14736, 47504, 31120, 63888, + 1424, 34192, 17808, 50576, 9616, 42384, 26000, 58768, 5520, 38288, 21904, + 54672, 13712, 46480, 30096, 62864, 3472, 36240, 19856, 52624, 11664, 44432, + 28048, 60816, 7568, 40336, 23952, 56720, 15760, 48528, 32144, 64912, 912, + 33680, 17296, 50064, 9104, 41872, 25488, 58256, 5008, 37776, 21392, 54160, + 13200, 45968, 29584, 62352, 2960, 35728, 19344, 52112, 11152, 43920, 27536, + 60304, 7056, 39824, 23440, 56208, 15248, 48016, 31632, 64400, 1936, 34704, + 18320, 51088, 10128, 42896, 26512, 59280, 6032, 38800, 22416, 55184, 14224, + 46992, 30608, 63376, 3984, 36752, 20368, 53136, 12176, 44944, 28560, 61328, + 8080, 40848, 24464, 57232, 16272, 49040, 32656, 65424, 80, 32848, 16464, + 49232, 8272, 41040, 24656, 57424, 4176, 36944, 20560, 53328, 12368, 45136, + 28752, 61520, 2128, 34896, 18512, 51280, 10320, 43088, 26704, 59472, 6224, + 38992, 22608, 55376, 14416, 47184, 30800, 63568, 1104, 33872, 17488, 50256, + 9296, 42064, 25680, 58448, 5200, 37968, 21584, 54352, 13392, 46160, 29776, + 62544, 3152, 35920, 19536, 52304, 11344, 44112, 27728, 60496, 7248, 40016, + 23632, 56400, 15440, 48208, 31824, 64592, 592, 33360, 16976, 49744, 8784, + 41552, 25168, 57936, 4688, 37456, 21072, 53840, 12880, 45648, 29264, 62032, + 2640, 35408, 19024, 51792, 10832, 43600, 27216, 59984, 6736, 39504, 23120, + 55888, 14928, 47696, 31312, 64080, 1616, 34384, 18000, 50768, 9808, 42576, + 26192, 58960, 5712, 38480, 22096, 54864, 13904, 46672, 30288, 63056, 3664, + 36432, 20048, 52816, 11856, 44624, 28240, 61008, 7760, 40528, 24144, 56912, + 15952, 48720, 32336, 65104, 336, 33104, 16720, 49488, 8528, 41296, 24912, + 57680, 4432, 37200, 20816, 53584, 12624, 45392, 29008, 61776, 2384, 35152, + 18768, 51536, 10576, 43344, 26960, 59728, 6480, 39248, 22864, 55632, 14672, + 47440, 31056, 63824, 1360, 34128, 17744, 50512, 9552, 42320, 25936, 58704, + 5456, 38224, 21840, 54608, 13648, 46416, 30032, 62800, 3408, 36176, 19792, + 52560, 11600, 44368, 27984, 60752, 7504, 40272, 23888, 56656, 15696, 48464, + 32080, 64848, 848, 33616, 17232, 50000, 9040, 41808, 25424, 58192, 4944, + 37712, 21328, 54096, 13136, 45904, 29520, 62288, 2896, 35664, 19280, 52048, + 11088, 43856, 27472, 60240, 6992, 39760, 23376, 56144, 15184, 47952, 31568, + 64336, 1872, 34640, 18256, 51024, 10064, 42832, 26448, 59216, 5968, 38736, + 22352, 55120, 14160, 46928, 30544, 63312, 3920, 36688, 20304, 53072, 12112, + 44880, 28496, 61264, 8016, 40784, 24400, 57168, 16208, 48976, 32592, 65360, + 208, 32976, 16592, 49360, 8400, 41168, 24784, 57552, 4304, 37072, 20688, + 53456, 12496, 45264, 28880, 61648, 2256, 35024, 18640, 51408, 10448, 43216, + 26832, 59600, 6352, 39120, 22736, 55504, 14544, 47312, 30928, 63696, 1232, + 34000, 17616, 50384, 9424, 42192, 25808, 58576, 5328, 38096, 21712, 54480, + 13520, 46288, 29904, 62672, 3280, 36048, 19664, 52432, 11472, 44240, 27856, + 60624, 7376, 40144, 23760, 56528, 15568, 48336, 31952, 64720, 720, 33488, + 17104, 49872, 8912, 41680, 25296, 58064, 4816, 37584, 21200, 53968, 13008, + 45776, 29392, 62160, 2768, 35536, 19152, 51920, 10960, 43728, 27344, 60112, + 6864, 39632, 23248, 56016, 15056, 47824, 31440, 64208, 1744, 34512, 18128, + 50896, 9936, 42704, 26320, 59088, 5840, 38608, 22224, 54992, 14032, 46800, + 30416, 63184, 3792, 36560, 20176, 52944, 11984, 44752, 28368, 61136, 7888, + 40656, 24272, 57040, 16080, 48848, 32464, 65232, 464, 33232, 16848, 49616, + 8656, 41424, 25040, 57808, 4560, 37328, 20944, 53712, 12752, 45520, 29136, + 61904, 2512, 35280, 18896, 51664, 10704, 43472, 27088, 59856, 6608, 39376, + 22992, 55760, 14800, 47568, 31184, 63952, 1488, 34256, 17872, 50640, 9680, + 42448, 26064, 58832, 5584, 38352, 21968, 54736, 13776, 46544, 30160, 62928, + 3536, 36304, 19920, 52688, 11728, 44496, 28112, 60880, 7632, 40400, 24016, + 56784, 15824, 48592, 32208, 64976, 976, 33744, 17360, 50128, 9168, 41936, + 25552, 58320, 5072, 37840, 21456, 54224, 13264, 46032, 29648, 62416, 3024, + 35792, 19408, 52176, 11216, 43984, 27600, 60368, 7120, 39888, 23504, 56272, + 15312, 48080, 31696, 64464, 2000, 34768, 18384, 51152, 10192, 42960, 26576, + 59344, 6096, 38864, 22480, 55248, 14288, 47056, 30672, 63440, 4048, 36816, + 20432, 53200, 12240, 45008, 28624, 61392, 8144, 40912, 24528, 57296, 16336, + 49104, 32720, 65488, 48, 32816, 16432, 49200, 8240, 41008, 24624, 57392, + 4144, 36912, 20528, 53296, 12336, 45104, 28720, 61488, 2096, 34864, 18480, + 51248, 10288, 43056, 26672, 59440, 6192, 38960, 22576, 55344, 14384, 47152, + 30768, 63536, 1072, 33840, 17456, 50224, 9264, 42032, 25648, 58416, 5168, + 37936, 21552, 54320, 13360, 46128, 29744, 62512, 3120, 35888, 19504, 52272, + 11312, 44080, 27696, 60464, 7216, 39984, 23600, 56368, 15408, 48176, 31792, + 64560, 560, 33328, 16944, 49712, 8752, 41520, 25136, 57904, 4656, 37424, + 21040, 53808, 12848, 45616, 29232, 62000, 2608, 35376, 18992, 51760, 10800, + 43568, 27184, 59952, 6704, 39472, 23088, 55856, 14896, 47664, 31280, 64048, + 1584, 34352, 17968, 50736, 9776, 42544, 26160, 58928, 5680, 38448, 22064, + 54832, 13872, 46640, 30256, 63024, 3632, 36400, 20016, 52784, 11824, 44592, + 28208, 60976, 7728, 40496, 24112, 56880, 15920, 48688, 32304, 65072, 304, + 33072, 16688, 49456, 8496, 41264, 24880, 57648, 4400, 37168, 20784, 53552, + 12592, 45360, 28976, 61744, 2352, 35120, 18736, 51504, 10544, 43312, 26928, + 59696, 6448, 39216, 22832, 55600, 14640, 47408, 31024, 63792, 1328, 34096, + 17712, 50480, 9520, 42288, 25904, 58672, 5424, 38192, 21808, 54576, 13616, + 46384, 30000, 62768, 3376, 36144, 19760, 52528, 11568, 44336, 27952, 60720, + 7472, 40240, 23856, 56624, 15664, 48432, 32048, 64816, 816, 33584, 17200, + 49968, 9008, 41776, 25392, 58160, 4912, 37680, 21296, 54064, 13104, 45872, + 29488, 62256, 2864, 35632, 19248, 52016, 11056, 43824, 27440, 60208, 6960, + 39728, 23344, 56112, 15152, 47920, 31536, 64304, 1840, 34608, 18224, 50992, + 10032, 42800, 26416, 59184, 5936, 38704, 22320, 55088, 14128, 46896, 30512, + 63280, 3888, 36656, 20272, 53040, 12080, 44848, 28464, 61232, 7984, 40752, + 24368, 57136, 16176, 48944, 32560, 65328, 176, 32944, 16560, 49328, 8368, + 41136, 24752, 57520, 4272, 37040, 20656, 53424, 12464, 45232, 28848, 61616, + 2224, 34992, 18608, 51376, 10416, 43184, 26800, 59568, 6320, 39088, 22704, + 55472, 14512, 47280, 30896, 63664, 1200, 33968, 17584, 50352, 9392, 42160, + 25776, 58544, 5296, 38064, 21680, 54448, 13488, 46256, 29872, 62640, 3248, + 36016, 19632, 52400, 11440, 44208, 27824, 60592, 7344, 40112, 23728, 56496, + 15536, 48304, 31920, 64688, 688, 33456, 17072, 49840, 8880, 41648, 25264, + 58032, 4784, 37552, 21168, 53936, 12976, 45744, 29360, 62128, 2736, 35504, + 19120, 51888, 10928, 43696, 27312, 60080, 6832, 39600, 23216, 55984, 15024, + 47792, 31408, 64176, 1712, 34480, 18096, 50864, 9904, 42672, 26288, 59056, + 5808, 38576, 22192, 54960, 14000, 46768, 30384, 63152, 3760, 36528, 20144, + 52912, 11952, 44720, 28336, 61104, 7856, 40624, 24240, 57008, 16048, 48816, + 32432, 65200, 432, 33200, 16816, 49584, 8624, 41392, 25008, 57776, 4528, + 37296, 20912, 53680, 12720, 45488, 29104, 61872, 2480, 35248, 18864, 51632, + 10672, 43440, 27056, 59824, 6576, 39344, 22960, 55728, 14768, 47536, 31152, + 63920, 1456, 34224, 17840, 50608, 9648, 42416, 26032, 58800, 5552, 38320, + 21936, 54704, 13744, 46512, 30128, 62896, 3504, 36272, 19888, 52656, 11696, + 44464, 28080, 60848, 7600, 40368, 23984, 56752, 15792, 48560, 32176, 64944, + 944, 33712, 17328, 50096, 9136, 41904, 25520, 58288, 5040, 37808, 21424, + 54192, 13232, 46000, 29616, 62384, 2992, 35760, 19376, 52144, 11184, 43952, + 27568, 60336, 7088, 39856, 23472, 56240, 15280, 48048, 31664, 64432, 1968, + 34736, 18352, 51120, 10160, 42928, 26544, 59312, 6064, 38832, 22448, 55216, + 14256, 47024, 30640, 63408, 4016, 36784, 20400, 53168, 12208, 44976, 28592, + 61360, 8112, 40880, 24496, 57264, 16304, 49072, 32688, 65456, 112, 32880, + 16496, 49264, 8304, 41072, 24688, 57456, 4208, 36976, 20592, 53360, 12400, + 45168, 28784, 61552, 2160, 34928, 18544, 51312, 10352, 43120, 26736, 59504, + 6256, 39024, 22640, 55408, 14448, 47216, 30832, 63600, 1136, 33904, 17520, + 50288, 9328, 42096, 25712, 58480, 5232, 38000, 21616, 54384, 13424, 46192, + 29808, 62576, 3184, 35952, 19568, 52336, 11376, 44144, 27760, 60528, 7280, + 40048, 23664, 56432, 15472, 48240, 31856, 64624, 624, 33392, 17008, 49776, + 8816, 41584, 25200, 57968, 4720, 37488, 21104, 53872, 12912, 45680, 29296, + 62064, 2672, 35440, 19056, 51824, 10864, 43632, 27248, 60016, 6768, 39536, + 23152, 55920, 14960, 47728, 31344, 64112, 1648, 34416, 18032, 50800, 9840, + 42608, 26224, 58992, 5744, 38512, 22128, 54896, 13936, 46704, 30320, 63088, + 3696, 36464, 20080, 52848, 11888, 44656, 28272, 61040, 7792, 40560, 24176, + 56944, 15984, 48752, 32368, 65136, 368, 33136, 16752, 49520, 8560, 41328, + 24944, 57712, 4464, 37232, 20848, 53616, 12656, 45424, 29040, 61808, 2416, + 35184, 18800, 51568, 10608, 43376, 26992, 59760, 6512, 39280, 22896, 55664, + 14704, 47472, 31088, 63856, 1392, 34160, 17776, 50544, 9584, 42352, 25968, + 58736, 5488, 38256, 21872, 54640, 13680, 46448, 30064, 62832, 3440, 36208, + 19824, 52592, 11632, 44400, 28016, 60784, 7536, 40304, 23920, 56688, 15728, + 48496, 32112, 64880, 880, 33648, 17264, 50032, 9072, 41840, 25456, 58224, + 4976, 37744, 21360, 54128, 13168, 45936, 29552, 62320, 2928, 35696, 19312, + 52080, 11120, 43888, 27504, 60272, 7024, 39792, 23408, 56176, 15216, 47984, + 31600, 64368, 1904, 34672, 18288, 51056, 10096, 42864, 26480, 59248, 6000, + 38768, 22384, 55152, 14192, 46960, 30576, 63344, 3952, 36720, 20336, 53104, + 12144, 44912, 28528, 61296, 8048, 40816, 24432, 57200, 16240, 49008, 32624, + 65392, 240, 33008, 16624, 49392, 8432, 41200, 24816, 57584, 4336, 37104, + 20720, 53488, 12528, 45296, 28912, 61680, 2288, 35056, 18672, 51440, 10480, + 43248, 26864, 59632, 6384, 39152, 22768, 55536, 14576, 47344, 30960, 63728, + 1264, 34032, 17648, 50416, 9456, 42224, 25840, 58608, 5360, 38128, 21744, + 54512, 13552, 46320, 29936, 62704, 3312, 36080, 19696, 52464, 11504, 44272, + 27888, 60656, 7408, 40176, 23792, 56560, 15600, 48368, 31984, 64752, 752, + 33520, 17136, 49904, 8944, 41712, 25328, 58096, 4848, 37616, 21232, 54000, + 13040, 45808, 29424, 62192, 2800, 35568, 19184, 51952, 10992, 43760, 27376, + 60144, 6896, 39664, 23280, 56048, 15088, 47856, 31472, 64240, 1776, 34544, + 18160, 50928, 9968, 42736, 26352, 59120, 5872, 38640, 22256, 55024, 14064, + 46832, 30448, 63216, 3824, 36592, 20208, 52976, 12016, 44784, 28400, 61168, + 7920, 40688, 24304, 57072, 16112, 48880, 32496, 65264, 496, 33264, 16880, + 49648, 8688, 41456, 25072, 57840, 4592, 37360, 20976, 53744, 12784, 45552, + 29168, 61936, 2544, 35312, 18928, 51696, 10736, 43504, 27120, 59888, 6640, + 39408, 23024, 55792, 14832, 47600, 31216, 63984, 1520, 34288, 17904, 50672, + 9712, 42480, 26096, 58864, 5616, 38384, 22000, 54768, 13808, 46576, 30192, + 62960, 3568, 36336, 19952, 52720, 11760, 44528, 28144, 60912, 7664, 40432, + 24048, 56816, 15856, 48624, 32240, 65008, 1008, 33776, 17392, 50160, 9200, + 41968, 25584, 58352, 5104, 37872, 21488, 54256, 13296, 46064, 29680, 62448, + 3056, 35824, 19440, 52208, 11248, 44016, 27632, 60400, 7152, 39920, 23536, + 56304, 15344, 48112, 31728, 64496, 2032, 34800, 18416, 51184, 10224, 42992, + 26608, 59376, 6128, 38896, 22512, 55280, 14320, 47088, 30704, 63472, 4080, + 36848, 20464, 53232, 12272, 45040, 28656, 61424, 8176, 40944, 24560, 57328, + 16368, 49136, 32752, 65520, 8, 32776, 16392, 49160, 8200, 40968, 24584, + 57352, 4104, 36872, 20488, 53256, 12296, 45064, 28680, 61448, 2056, 34824, + 18440, 51208, 10248, 43016, 26632, 59400, 6152, 38920, 22536, 55304, 14344, + 47112, 30728, 63496, 1032, 33800, 17416, 50184, 9224, 41992, 25608, 58376, + 5128, 37896, 21512, 54280, 13320, 46088, 29704, 62472, 3080, 35848, 19464, + 52232, 11272, 44040, 27656, 60424, 7176, 39944, 23560, 56328, 15368, 48136, + 31752, 64520, 520, 33288, 16904, 49672, 8712, 41480, 25096, 57864, 4616, + 37384, 21000, 53768, 12808, 45576, 29192, 61960, 2568, 35336, 18952, 51720, + 10760, 43528, 27144, 59912, 6664, 39432, 23048, 55816, 14856, 47624, 31240, + 64008, 1544, 34312, 17928, 50696, 9736, 42504, 26120, 58888, 5640, 38408, + 22024, 54792, 13832, 46600, 30216, 62984, 3592, 36360, 19976, 52744, 11784, + 44552, 28168, 60936, 7688, 40456, 24072, 56840, 15880, 48648, 32264, 65032, + 264, 33032, 16648, 49416, 8456, 41224, 24840, 57608, 4360, 37128, 20744, + 53512, 12552, 45320, 28936, 61704, 2312, 35080, 18696, 51464, 10504, 43272, + 26888, 59656, 6408, 39176, 22792, 55560, 14600, 47368, 30984, 63752, 1288, + 34056, 17672, 50440, 9480, 42248, 25864, 58632, 5384, 38152, 21768, 54536, + 13576, 46344, 29960, 62728, 3336, 36104, 19720, 52488, 11528, 44296, 27912, + 60680, 7432, 40200, 23816, 56584, 15624, 48392, 32008, 64776, 776, 33544, + 17160, 49928, 8968, 41736, 25352, 58120, 4872, 37640, 21256, 54024, 13064, + 45832, 29448, 62216, 2824, 35592, 19208, 51976, 11016, 43784, 27400, 60168, + 6920, 39688, 23304, 56072, 15112, 47880, 31496, 64264, 1800, 34568, 18184, + 50952, 9992, 42760, 26376, 59144, 5896, 38664, 22280, 55048, 14088, 46856, + 30472, 63240, 3848, 36616, 20232, 53000, 12040, 44808, 28424, 61192, 7944, + 40712, 24328, 57096, 16136, 48904, 32520, 65288, 136, 32904, 16520, 49288, + 8328, 41096, 24712, 57480, 4232, 37000, 20616, 53384, 12424, 45192, 28808, + 61576, 2184, 34952, 18568, 51336, 10376, 43144, 26760, 59528, 6280, 39048, + 22664, 55432, 14472, 47240, 30856, 63624, 1160, 33928, 17544, 50312, 9352, + 42120, 25736, 58504, 5256, 38024, 21640, 54408, 13448, 46216, 29832, 62600, + 3208, 35976, 19592, 52360, 11400, 44168, 27784, 60552, 7304, 40072, 23688, + 56456, 15496, 48264, 31880, 64648, 648, 33416, 17032, 49800, 8840, 41608, + 25224, 57992, 4744, 37512, 21128, 53896, 12936, 45704, 29320, 62088, 2696, + 35464, 19080, 51848, 10888, 43656, 27272, 60040, 6792, 39560, 23176, 55944, + 14984, 47752, 31368, 64136, 1672, 34440, 18056, 50824, 9864, 42632, 26248, + 59016, 5768, 38536, 22152, 54920, 13960, 46728, 30344, 63112, 3720, 36488, + 20104, 52872, 11912, 44680, 28296, 61064, 7816, 40584, 24200, 56968, 16008, + 48776, 32392, 65160, 392, 33160, 16776, 49544, 8584, 41352, 24968, 57736, + 4488, 37256, 20872, 53640, 12680, 45448, 29064, 61832, 2440, 35208, 18824, + 51592, 10632, 43400, 27016, 59784, 6536, 39304, 22920, 55688, 14728, 47496, + 31112, 63880, 1416, 34184, 17800, 50568, 9608, 42376, 25992, 58760, 5512, + 38280, 21896, 54664, 13704, 46472, 30088, 62856, 3464, 36232, 19848, 52616, + 11656, 44424, 28040, 60808, 7560, 40328, 23944, 56712, 15752, 48520, 32136, + 64904, 904, 33672, 17288, 50056, 9096, 41864, 25480, 58248, 5000, 37768, + 21384, 54152, 13192, 45960, 29576, 62344, 2952, 35720, 19336, 52104, 11144, + 43912, 27528, 60296, 7048, 39816, 23432, 56200, 15240, 48008, 31624, 64392, + 1928, 34696, 18312, 51080, 10120, 42888, 26504, 59272, 6024, 38792, 22408, + 55176, 14216, 46984, 30600, 63368, 3976, 36744, 20360, 53128, 12168, 44936, + 28552, 61320, 8072, 40840, 24456, 57224, 16264, 49032, 32648, 65416, 72, + 32840, 16456, 49224, 8264, 41032, 24648, 57416, 4168, 36936, 20552, 53320, + 12360, 45128, 28744, 61512, 2120, 34888, 18504, 51272, 10312, 43080, 26696, + 59464, 6216, 38984, 22600, 55368, 14408, 47176, 30792, 63560, 1096, 33864, + 17480, 50248, 9288, 42056, 25672, 58440, 5192, 37960, 21576, 54344, 13384, + 46152, 29768, 62536, 3144, 35912, 19528, 52296, 11336, 44104, 27720, 60488, + 7240, 40008, 23624, 56392, 15432, 48200, 31816, 64584, 584, 33352, 16968, + 49736, 8776, 41544, 25160, 57928, 4680, 37448, 21064, 53832, 12872, 45640, + 29256, 62024, 2632, 35400, 19016, 51784, 10824, 43592, 27208, 59976, 6728, + 39496, 23112, 55880, 14920, 47688, 31304, 64072, 1608, 34376, 17992, 50760, + 9800, 42568, 26184, 58952, 5704, 38472, 22088, 54856, 13896, 46664, 30280, + 63048, 3656, 36424, 20040, 52808, 11848, 44616, 28232, 61000, 7752, 40520, + 24136, 56904, 15944, 48712, 32328, 65096, 328, 33096, 16712, 49480, 8520, + 41288, 24904, 57672, 4424, 37192, 20808, 53576, 12616, 45384, 29000, 61768, + 2376, 35144, 18760, 51528, 10568, 43336, 26952, 59720, 6472, 39240, 22856, + 55624, 14664, 47432, 31048, 63816, 1352, 34120, 17736, 50504, 9544, 42312, + 25928, 58696, 5448, 38216, 21832, 54600, 13640, 46408, 30024, 62792, 3400, + 36168, 19784, 52552, 11592, 44360, 27976, 60744, 7496, 40264, 23880, 56648, + 15688, 48456, 32072, 64840, 840, 33608, 17224, 49992, 9032, 41800, 25416, + 58184, 4936, 37704, 21320, 54088, 13128, 45896, 29512, 62280, 2888, 35656, + 19272, 52040, 11080, 43848, 27464, 60232, 6984, 39752, 23368, 56136, 15176, + 47944, 31560, 64328, 1864, 34632, 18248, 51016, 10056, 42824, 26440, 59208, + 5960, 38728, 22344, 55112, 14152, 46920, 30536, 63304, 3912, 36680, 20296, + 53064, 12104, 44872, 28488, 61256, 8008, 40776, 24392, 57160, 16200, 48968, + 32584, 65352, 200, 32968, 16584, 49352, 8392, 41160, 24776, 57544, 4296, + 37064, 20680, 53448, 12488, 45256, 28872, 61640, 2248, 35016, 18632, 51400, + 10440, 43208, 26824, 59592, 6344, 39112, 22728, 55496, 14536, 47304, 30920, + 63688, 1224, 33992, 17608, 50376, 9416, 42184, 25800, 58568, 5320, 38088, + 21704, 54472, 13512, 46280, 29896, 62664, 3272, 36040, 19656, 52424, 11464, + 44232, 27848, 60616, 7368, 40136, 23752, 56520, 15560, 48328, 31944, 64712, + 712, 33480, 17096, 49864, 8904, 41672, 25288, 58056, 4808, 37576, 21192, + 53960, 13000, 45768, 29384, 62152, 2760, 35528, 19144, 51912, 10952, 43720, + 27336, 60104, 6856, 39624, 23240, 56008, 15048, 47816, 31432, 64200, 1736, + 34504, 18120, 50888, 9928, 42696, 26312, 59080, 5832, 38600, 22216, 54984, + 14024, 46792, 30408, 63176, 3784, 36552, 20168, 52936, 11976, 44744, 28360, + 61128, 7880, 40648, 24264, 57032, 16072, 48840, 32456, 65224, 456, 33224, + 16840, 49608, 8648, 41416, 25032, 57800, 4552, 37320, 20936, 53704, 12744, + 45512, 29128, 61896, 2504, 35272, 18888, 51656, 10696, 43464, 27080, 59848, + 6600, 39368, 22984, 55752, 14792, 47560, 31176, 63944, 1480, 34248, 17864, + 50632, 9672, 42440, 26056, 58824, 5576, 38344, 21960, 54728, 13768, 46536, + 30152, 62920, 3528, 36296, 19912, 52680, 11720, 44488, 28104, 60872, 7624, + 40392, 24008, 56776, 15816, 48584, 32200, 64968, 968, 33736, 17352, 50120, + 9160, 41928, 25544, 58312, 5064, 37832, 21448, 54216, 13256, 46024, 29640, + 62408, 3016, 35784, 19400, 52168, 11208, 43976, 27592, 60360, 7112, 39880, + 23496, 56264, 15304, 48072, 31688, 64456, 1992, 34760, 18376, 51144, 10184, + 42952, 26568, 59336, 6088, 38856, 22472, 55240, 14280, 47048, 30664, 63432, + 4040, 36808, 20424, 53192, 12232, 45000, 28616, 61384, 8136, 40904, 24520, + 57288, 16328, 49096, 32712, 65480, 40, 32808, 16424, 49192, 8232, 41000, + 24616, 57384, 4136, 36904, 20520, 53288, 12328, 45096, 28712, 61480, 2088, + 34856, 18472, 51240, 10280, 43048, 26664, 59432, 6184, 38952, 22568, 55336, + 14376, 47144, 30760, 63528, 1064, 33832, 17448, 50216, 9256, 42024, 25640, + 58408, 5160, 37928, 21544, 54312, 13352, 46120, 29736, 62504, 3112, 35880, + 19496, 52264, 11304, 44072, 27688, 60456, 7208, 39976, 23592, 56360, 15400, + 48168, 31784, 64552, 552, 33320, 16936, 49704, 8744, 41512, 25128, 57896, + 4648, 37416, 21032, 53800, 12840, 45608, 29224, 61992, 2600, 35368, 18984, + 51752, 10792, 43560, 27176, 59944, 6696, 39464, 23080, 55848, 14888, 47656, + 31272, 64040, 1576, 34344, 17960, 50728, 9768, 42536, 26152, 58920, 5672, + 38440, 22056, 54824, 13864, 46632, 30248, 63016, 3624, 36392, 20008, 52776, + 11816, 44584, 28200, 60968, 7720, 40488, 24104, 56872, 15912, 48680, 32296, + 65064, 296, 33064, 16680, 49448, 8488, 41256, 24872, 57640, 4392, 37160, + 20776, 53544, 12584, 45352, 28968, 61736, 2344, 35112, 18728, 51496, 10536, + 43304, 26920, 59688, 6440, 39208, 22824, 55592, 14632, 47400, 31016, 63784, + 1320, 34088, 17704, 50472, 9512, 42280, 25896, 58664, 5416, 38184, 21800, + 54568, 13608, 46376, 29992, 62760, 3368, 36136, 19752, 52520, 11560, 44328, + 27944, 60712, 7464, 40232, 23848, 56616, 15656, 48424, 32040, 64808, 808, + 33576, 17192, 49960, 9000, 41768, 25384, 58152, 4904, 37672, 21288, 54056, + 13096, 45864, 29480, 62248, 2856, 35624, 19240, 52008, 11048, 43816, 27432, + 60200, 6952, 39720, 23336, 56104, 15144, 47912, 31528, 64296, 1832, 34600, + 18216, 50984, 10024, 42792, 26408, 59176, 5928, 38696, 22312, 55080, 14120, + 46888, 30504, 63272, 3880, 36648, 20264, 53032, 12072, 44840, 28456, 61224, + 7976, 40744, 24360, 57128, 16168, 48936, 32552, 65320, 168, 32936, 16552, + 49320, 8360, 41128, 24744, 57512, 4264, 37032, 20648, 53416, 12456, 45224, + 28840, 61608, 2216, 34984, 18600, 51368, 10408, 43176, 26792, 59560, 6312, + 39080, 22696, 55464, 14504, 47272, 30888, 63656, 1192, 33960, 17576, 50344, + 9384, 42152, 25768, 58536, 5288, 38056, 21672, 54440, 13480, 46248, 29864, + 62632, 3240, 36008, 19624, 52392, 11432, 44200, 27816, 60584, 7336, 40104, + 23720, 56488, 15528, 48296, 31912, 64680, 680, 33448, 17064, 49832, 8872, + 41640, 25256, 58024, 4776, 37544, 21160, 53928, 12968, 45736, 29352, 62120, + 2728, 35496, 19112, 51880, 10920, 43688, 27304, 60072, 6824, 39592, 23208, + 55976, 15016, 47784, 31400, 64168, 1704, 34472, 18088, 50856, 9896, 42664, + 26280, 59048, 5800, 38568, 22184, 54952, 13992, 46760, 30376, 63144, 3752, + 36520, 20136, 52904, 11944, 44712, 28328, 61096, 7848, 40616, 24232, 57000, + 16040, 48808, 32424, 65192, 424, 33192, 16808, 49576, 8616, 41384, 25000, + 57768, 4520, 37288, 20904, 53672, 12712, 45480, 29096, 61864, 2472, 35240, + 18856, 51624, 10664, 43432, 27048, 59816, 6568, 39336, 22952, 55720, 14760, + 47528, 31144, 63912, 1448, 34216, 17832, 50600, 9640, 42408, 26024, 58792, + 5544, 38312, 21928, 54696, 13736, 46504, 30120, 62888, 3496, 36264, 19880, + 52648, 11688, 44456, 28072, 60840, 7592, 40360, 23976, 56744, 15784, 48552, + 32168, 64936, 936, 33704, 17320, 50088, 9128, 41896, 25512, 58280, 5032, + 37800, 21416, 54184, 13224, 45992, 29608, 62376, 2984, 35752, 19368, 52136, + 11176, 43944, 27560, 60328, 7080, 39848, 23464, 56232, 15272, 48040, 31656, + 64424, 1960, 34728, 18344, 51112, 10152, 42920, 26536, 59304, 6056, 38824, + 22440, 55208, 14248, 47016, 30632, 63400, 4008, 36776, 20392, 53160, 12200, + 44968, 28584, 61352, 8104, 40872, 24488, 57256, 16296, 49064, 32680, 65448, + 104, 32872, 16488, 49256, 8296, 41064, 24680, 57448, 4200, 36968, 20584, + 53352, 12392, 45160, 28776, 61544, 2152, 34920, 18536, 51304, 10344, 43112, + 26728, 59496, 6248, 39016, 22632, 55400, 14440, 47208, 30824, 63592, 1128, + 33896, 17512, 50280, 9320, 42088, 25704, 58472, 5224, 37992, 21608, 54376, + 13416, 46184, 29800, 62568, 3176, 35944, 19560, 52328, 11368, 44136, 27752, + 60520, 7272, 40040, 23656, 56424, 15464, 48232, 31848, 64616, 616, 33384, + 17000, 49768, 8808, 41576, 25192, 57960, 4712, 37480, 21096, 53864, 12904, + 45672, 29288, 62056, 2664, 35432, 19048, 51816, 10856, 43624, 27240, 60008, + 6760, 39528, 23144, 55912, 14952, 47720, 31336, 64104, 1640, 34408, 18024, + 50792, 9832, 42600, 26216, 58984, 5736, 38504, 22120, 54888, 13928, 46696, + 30312, 63080, 3688, 36456, 20072, 52840, 11880, 44648, 28264, 61032, 7784, + 40552, 24168, 56936, 15976, 48744, 32360, 65128, 360, 33128, 16744, 49512, + 8552, 41320, 24936, 57704, 4456, 37224, 20840, 53608, 12648, 45416, 29032, + 61800, 2408, 35176, 18792, 51560, 10600, 43368, 26984, 59752, 6504, 39272, + 22888, 55656, 14696, 47464, 31080, 63848, 1384, 34152, 17768, 50536, 9576, + 42344, 25960, 58728, 5480, 38248, 21864, 54632, 13672, 46440, 30056, 62824, + 3432, 36200, 19816, 52584, 11624, 44392, 28008, 60776, 7528, 40296, 23912, + 56680, 15720, 48488, 32104, 64872, 872, 33640, 17256, 50024, 9064, 41832, + 25448, 58216, 4968, 37736, 21352, 54120, 13160, 45928, 29544, 62312, 2920, + 35688, 19304, 52072, 11112, 43880, 27496, 60264, 7016, 39784, 23400, 56168, + 15208, 47976, 31592, 64360, 1896, 34664, 18280, 51048, 10088, 42856, 26472, + 59240, 5992, 38760, 22376, 55144, 14184, 46952, 30568, 63336, 3944, 36712, + 20328, 53096, 12136, 44904, 28520, 61288, 8040, 40808, 24424, 57192, 16232, + 49000, 32616, 65384, 232, 33000, 16616, 49384, 8424, 41192, 24808, 57576, + 4328, 37096, 20712, 53480, 12520, 45288, 28904, 61672, 2280, 35048, 18664, + 51432, 10472, 43240, 26856, 59624, 6376, 39144, 22760, 55528, 14568, 47336, + 30952, 63720, 1256, 34024, 17640, 50408, 9448, 42216, 25832, 58600, 5352, + 38120, 21736, 54504, 13544, 46312, 29928, 62696, 3304, 36072, 19688, 52456, + 11496, 44264, 27880, 60648, 7400, 40168, 23784, 56552, 15592, 48360, 31976, + 64744, 744, 33512, 17128, 49896, 8936, 41704, 25320, 58088, 4840, 37608, + 21224, 53992, 13032, 45800, 29416, 62184, 2792, 35560, 19176, 51944, 10984, + 43752, 27368, 60136, 6888, 39656, 23272, 56040, 15080, 47848, 31464, 64232, + 1768, 34536, 18152, 50920, 9960, 42728, 26344, 59112, 5864, 38632, 22248, + 55016, 14056, 46824, 30440, 63208, 3816, 36584, 20200, 52968, 12008, 44776, + 28392, 61160, 7912, 40680, 24296, 57064, 16104, 48872, 32488, 65256, 488, + 33256, 16872, 49640, 8680, 41448, 25064, 57832, 4584, 37352, 20968, 53736, + 12776, 45544, 29160, 61928, 2536, 35304, 18920, 51688, 10728, 43496, 27112, + 59880, 6632, 39400, 23016, 55784, 14824, 47592, 31208, 63976, 1512, 34280, + 17896, 50664, 9704, 42472, 26088, 58856, 5608, 38376, 21992, 54760, 13800, + 46568, 30184, 62952, 3560, 36328, 19944, 52712, 11752, 44520, 28136, 60904, + 7656, 40424, 24040, 56808, 15848, 48616, 32232, 65000, 1000, 33768, 17384, + 50152, 9192, 41960, 25576, 58344, 5096, 37864, 21480, 54248, 13288, 46056, + 29672, 62440, 3048, 35816, 19432, 52200, 11240, 44008, 27624, 60392, 7144, + 39912, 23528, 56296, 15336, 48104, 31720, 64488, 2024, 34792, 18408, 51176, + 10216, 42984, 26600, 59368, 6120, 38888, 22504, 55272, 14312, 47080, 30696, + 63464, 4072, 36840, 20456, 53224, 12264, 45032, 28648, 61416, 8168, 40936, + 24552, 57320, 16360, 49128, 32744, 65512, 24, 32792, 16408, 49176, 8216, + 40984, 24600, 57368, 4120, 36888, 20504, 53272, 12312, 45080, 28696, 61464, + 2072, 34840, 18456, 51224, 10264, 43032, 26648, 59416, 6168, 38936, 22552, + 55320, 14360, 47128, 30744, 63512, 1048, 33816, 17432, 50200, 9240, 42008, + 25624, 58392, 5144, 37912, 21528, 54296, 13336, 46104, 29720, 62488, 3096, + 35864, 19480, 52248, 11288, 44056, 27672, 60440, 7192, 39960, 23576, 56344, + 15384, 48152, 31768, 64536, 536, 33304, 16920, 49688, 8728, 41496, 25112, + 57880, 4632, 37400, 21016, 53784, 12824, 45592, 29208, 61976, 2584, 35352, + 18968, 51736, 10776, 43544, 27160, 59928, 6680, 39448, 23064, 55832, 14872, + 47640, 31256, 64024, 1560, 34328, 17944, 50712, 9752, 42520, 26136, 58904, + 5656, 38424, 22040, 54808, 13848, 46616, 30232, 63000, 3608, 36376, 19992, + 52760, 11800, 44568, 28184, 60952, 7704, 40472, 24088, 56856, 15896, 48664, + 32280, 65048, 280, 33048, 16664, 49432, 8472, 41240, 24856, 57624, 4376, + 37144, 20760, 53528, 12568, 45336, 28952, 61720, 2328, 35096, 18712, 51480, + 10520, 43288, 26904, 59672, 6424, 39192, 22808, 55576, 14616, 47384, 31000, + 63768, 1304, 34072, 17688, 50456, 9496, 42264, 25880, 58648, 5400, 38168, + 21784, 54552, 13592, 46360, 29976, 62744, 3352, 36120, 19736, 52504, 11544, + 44312, 27928, 60696, 7448, 40216, 23832, 56600, 15640, 48408, 32024, 64792, + 792, 33560, 17176, 49944, 8984, 41752, 25368, 58136, 4888, 37656, 21272, + 54040, 13080, 45848, 29464, 62232, 2840, 35608, 19224, 51992, 11032, 43800, + 27416, 60184, 6936, 39704, 23320, 56088, 15128, 47896, 31512, 64280, 1816, + 34584, 18200, 50968, 10008, 42776, 26392, 59160, 5912, 38680, 22296, 55064, + 14104, 46872, 30488, 63256, 3864, 36632, 20248, 53016, 12056, 44824, 28440, + 61208, 7960, 40728, 24344, 57112, 16152, 48920, 32536, 65304, 152, 32920, + 16536, 49304, 8344, 41112, 24728, 57496, 4248, 37016, 20632, 53400, 12440, + 45208, 28824, 61592, 2200, 34968, 18584, 51352, 10392, 43160, 26776, 59544, + 6296, 39064, 22680, 55448, 14488, 47256, 30872, 63640, 1176, 33944, 17560, + 50328, 9368, 42136, 25752, 58520, 5272, 38040, 21656, 54424, 13464, 46232, + 29848, 62616, 3224, 35992, 19608, 52376, 11416, 44184, 27800, 60568, 7320, + 40088, 23704, 56472, 15512, 48280, 31896, 64664, 664, 33432, 17048, 49816, + 8856, 41624, 25240, 58008, 4760, 37528, 21144, 53912, 12952, 45720, 29336, + 62104, 2712, 35480, 19096, 51864, 10904, 43672, 27288, 60056, 6808, 39576, + 23192, 55960, 15000, 47768, 31384, 64152, 1688, 34456, 18072, 50840, 9880, + 42648, 26264, 59032, 5784, 38552, 22168, 54936, 13976, 46744, 30360, 63128, + 3736, 36504, 20120, 52888, 11928, 44696, 28312, 61080, 7832, 40600, 24216, + 56984, 16024, 48792, 32408, 65176, 408, 33176, 16792, 49560, 8600, 41368, + 24984, 57752, 4504, 37272, 20888, 53656, 12696, 45464, 29080, 61848, 2456, + 35224, 18840, 51608, 10648, 43416, 27032, 59800, 6552, 39320, 22936, 55704, + 14744, 47512, 31128, 63896, 1432, 34200, 17816, 50584, 9624, 42392, 26008, + 58776, 5528, 38296, 21912, 54680, 13720, 46488, 30104, 62872, 3480, 36248, + 19864, 52632, 11672, 44440, 28056, 60824, 7576, 40344, 23960, 56728, 15768, + 48536, 32152, 64920, 920, 33688, 17304, 50072, 9112, 41880, 25496, 58264, + 5016, 37784, 21400, 54168, 13208, 45976, 29592, 62360, 2968, 35736, 19352, + 52120, 11160, 43928, 27544, 60312, 7064, 39832, 23448, 56216, 15256, 48024, + 31640, 64408, 1944, 34712, 18328, 51096, 10136, 42904, 26520, 59288, 6040, + 38808, 22424, 55192, 14232, 47000, 30616, 63384, 3992, 36760, 20376, 53144, + 12184, 44952, 28568, 61336, 8088, 40856, 24472, 57240, 16280, 49048, 32664, + 65432, 88, 32856, 16472, 49240, 8280, 41048, 24664, 57432, 4184, 36952, + 20568, 53336, 12376, 45144, 28760, 61528, 2136, 34904, 18520, 51288, 10328, + 43096, 26712, 59480, 6232, 39000, 22616, 55384, 14424, 47192, 30808, 63576, + 1112, 33880, 17496, 50264, 9304, 42072, 25688, 58456, 5208, 37976, 21592, + 54360, 13400, 46168, 29784, 62552, 3160, 35928, 19544, 52312, 11352, 44120, + 27736, 60504, 7256, 40024, 23640, 56408, 15448, 48216, 31832, 64600, 600, + 33368, 16984, 49752, 8792, 41560, 25176, 57944, 4696, 37464, 21080, 53848, + 12888, 45656, 29272, 62040, 2648, 35416, 19032, 51800, 10840, 43608, 27224, + 59992, 6744, 39512, 23128, 55896, 14936, 47704, 31320, 64088, 1624, 34392, + 18008, 50776, 9816, 42584, 26200, 58968, 5720, 38488, 22104, 54872, 13912, + 46680, 30296, 63064, 3672, 36440, 20056, 52824, 11864, 44632, 28248, 61016, + 7768, 40536, 24152, 56920, 15960, 48728, 32344, 65112, 344, 33112, 16728, + 49496, 8536, 41304, 24920, 57688, 4440, 37208, 20824, 53592, 12632, 45400, + 29016, 61784, 2392, 35160, 18776, 51544, 10584, 43352, 26968, 59736, 6488, + 39256, 22872, 55640, 14680, 47448, 31064, 63832, 1368, 34136, 17752, 50520, + 9560, 42328, 25944, 58712, 5464, 38232, 21848, 54616, 13656, 46424, 30040, + 62808, 3416, 36184, 19800, 52568, 11608, 44376, 27992, 60760, 7512, 40280, + 23896, 56664, 15704, 48472, 32088, 64856, 856, 33624, 17240, 50008, 9048, + 41816, 25432, 58200, 4952, 37720, 21336, 54104, 13144, 45912, 29528, 62296, + 2904, 35672, 19288, 52056, 11096, 43864, 27480, 60248, 7000, 39768, 23384, + 56152, 15192, 47960, 31576, 64344, 1880, 34648, 18264, 51032, 10072, 42840, + 26456, 59224, 5976, 38744, 22360, 55128, 14168, 46936, 30552, 63320, 3928, + 36696, 20312, 53080, 12120, 44888, 28504, 61272, 8024, 40792, 24408, 57176, + 16216, 48984, 32600, 65368, 216, 32984, 16600, 49368, 8408, 41176, 24792, + 57560, 4312, 37080, 20696, 53464, 12504, 45272, 28888, 61656, 2264, 35032, + 18648, 51416, 10456, 43224, 26840, 59608, 6360, 39128, 22744, 55512, 14552, + 47320, 30936, 63704, 1240, 34008, 17624, 50392, 9432, 42200, 25816, 58584, + 5336, 38104, 21720, 54488, 13528, 46296, 29912, 62680, 3288, 36056, 19672, + 52440, 11480, 44248, 27864, 60632, 7384, 40152, 23768, 56536, 15576, 48344, + 31960, 64728, 728, 33496, 17112, 49880, 8920, 41688, 25304, 58072, 4824, + 37592, 21208, 53976, 13016, 45784, 29400, 62168, 2776, 35544, 19160, 51928, + 10968, 43736, 27352, 60120, 6872, 39640, 23256, 56024, 15064, 47832, 31448, + 64216, 1752, 34520, 18136, 50904, 9944, 42712, 26328, 59096, 5848, 38616, + 22232, 55000, 14040, 46808, 30424, 63192, 3800, 36568, 20184, 52952, 11992, + 44760, 28376, 61144, 7896, 40664, 24280, 57048, 16088, 48856, 32472, 65240, + 472, 33240, 16856, 49624, 8664, 41432, 25048, 57816, 4568, 37336, 20952, + 53720, 12760, 45528, 29144, 61912, 2520, 35288, 18904, 51672, 10712, 43480, + 27096, 59864, 6616, 39384, 23000, 55768, 14808, 47576, 31192, 63960, 1496, + 34264, 17880, 50648, 9688, 42456, 26072, 58840, 5592, 38360, 21976, 54744, + 13784, 46552, 30168, 62936, 3544, 36312, 19928, 52696, 11736, 44504, 28120, + 60888, 7640, 40408, 24024, 56792, 15832, 48600, 32216, 64984, 984, 33752, + 17368, 50136, 9176, 41944, 25560, 58328, 5080, 37848, 21464, 54232, 13272, + 46040, 29656, 62424, 3032, 35800, 19416, 52184, 11224, 43992, 27608, 60376, + 7128, 39896, 23512, 56280, 15320, 48088, 31704, 64472, 2008, 34776, 18392, + 51160, 10200, 42968, 26584, 59352, 6104, 38872, 22488, 55256, 14296, 47064, + 30680, 63448, 4056, 36824, 20440, 53208, 12248, 45016, 28632, 61400, 8152, + 40920, 24536, 57304, 16344, 49112, 32728, 65496, 56, 32824, 16440, 49208, + 8248, 41016, 24632, 57400, 4152, 36920, 20536, 53304, 12344, 45112, 28728, + 61496, 2104, 34872, 18488, 51256, 10296, 43064, 26680, 59448, 6200, 38968, + 22584, 55352, 14392, 47160, 30776, 63544, 1080, 33848, 17464, 50232, 9272, + 42040, 25656, 58424, 5176, 37944, 21560, 54328, 13368, 46136, 29752, 62520, + 3128, 35896, 19512, 52280, 11320, 44088, 27704, 60472, 7224, 39992, 23608, + 56376, 15416, 48184, 31800, 64568, 568, 33336, 16952, 49720, 8760, 41528, + 25144, 57912, 4664, 37432, 21048, 53816, 12856, 45624, 29240, 62008, 2616, + 35384, 19000, 51768, 10808, 43576, 27192, 59960, 6712, 39480, 23096, 55864, + 14904, 47672, 31288, 64056, 1592, 34360, 17976, 50744, 9784, 42552, 26168, + 58936, 5688, 38456, 22072, 54840, 13880, 46648, 30264, 63032, 3640, 36408, + 20024, 52792, 11832, 44600, 28216, 60984, 7736, 40504, 24120, 56888, 15928, + 48696, 32312, 65080, 312, 33080, 16696, 49464, 8504, 41272, 24888, 57656, + 4408, 37176, 20792, 53560, 12600, 45368, 28984, 61752, 2360, 35128, 18744, + 51512, 10552, 43320, 26936, 59704, 6456, 39224, 22840, 55608, 14648, 47416, + 31032, 63800, 1336, 34104, 17720, 50488, 9528, 42296, 25912, 58680, 5432, + 38200, 21816, 54584, 13624, 46392, 30008, 62776, 3384, 36152, 19768, 52536, + 11576, 44344, 27960, 60728, 7480, 40248, 23864, 56632, 15672, 48440, 32056, + 64824, 824, 33592, 17208, 49976, 9016, 41784, 25400, 58168, 4920, 37688, + 21304, 54072, 13112, 45880, 29496, 62264, 2872, 35640, 19256, 52024, 11064, + 43832, 27448, 60216, 6968, 39736, 23352, 56120, 15160, 47928, 31544, 64312, + 1848, 34616, 18232, 51000, 10040, 42808, 26424, 59192, 5944, 38712, 22328, + 55096, 14136, 46904, 30520, 63288, 3896, 36664, 20280, 53048, 12088, 44856, + 28472, 61240, 7992, 40760, 24376, 57144, 16184, 48952, 32568, 65336, 184, + 32952, 16568, 49336, 8376, 41144, 24760, 57528, 4280, 37048, 20664, 53432, + 12472, 45240, 28856, 61624, 2232, 35000, 18616, 51384, 10424, 43192, 26808, + 59576, 6328, 39096, 22712, 55480, 14520, 47288, 30904, 63672, 1208, 33976, + 17592, 50360, 9400, 42168, 25784, 58552, 5304, 38072, 21688, 54456, 13496, + 46264, 29880, 62648, 3256, 36024, 19640, 52408, 11448, 44216, 27832, 60600, + 7352, 40120, 23736, 56504, 15544, 48312, 31928, 64696, 696, 33464, 17080, + 49848, 8888, 41656, 25272, 58040, 4792, 37560, 21176, 53944, 12984, 45752, + 29368, 62136, 2744, 35512, 19128, 51896, 10936, 43704, 27320, 60088, 6840, + 39608, 23224, 55992, 15032, 47800, 31416, 64184, 1720, 34488, 18104, 50872, + 9912, 42680, 26296, 59064, 5816, 38584, 22200, 54968, 14008, 46776, 30392, + 63160, 3768, 36536, 20152, 52920, 11960, 44728, 28344, 61112, 7864, 40632, + 24248, 57016, 16056, 48824, 32440, 65208, 440, 33208, 16824, 49592, 8632, + 41400, 25016, 57784, 4536, 37304, 20920, 53688, 12728, 45496, 29112, 61880, + 2488, 35256, 18872, 51640, 10680, 43448, 27064, 59832, 6584, 39352, 22968, + 55736, 14776, 47544, 31160, 63928, 1464, 34232, 17848, 50616, 9656, 42424, + 26040, 58808, 5560, 38328, 21944, 54712, 13752, 46520, 30136, 62904, 3512, + 36280, 19896, 52664, 11704, 44472, 28088, 60856, 7608, 40376, 23992, 56760, + 15800, 48568, 32184, 64952, 952, 33720, 17336, 50104, 9144, 41912, 25528, + 58296, 5048, 37816, 21432, 54200, 13240, 46008, 29624, 62392, 3000, 35768, + 19384, 52152, 11192, 43960, 27576, 60344, 7096, 39864, 23480, 56248, 15288, + 48056, 31672, 64440, 1976, 34744, 18360, 51128, 10168, 42936, 26552, 59320, + 6072, 38840, 22456, 55224, 14264, 47032, 30648, 63416, 4024, 36792, 20408, + 53176, 12216, 44984, 28600, 61368, 8120, 40888, 24504, 57272, 16312, 49080, + 32696, 65464, 120, 32888, 16504, 49272, 8312, 41080, 24696, 57464, 4216, + 36984, 20600, 53368, 12408, 45176, 28792, 61560, 2168, 34936, 18552, 51320, + 10360, 43128, 26744, 59512, 6264, 39032, 22648, 55416, 14456, 47224, 30840, + 63608, 1144, 33912, 17528, 50296, 9336, 42104, 25720, 58488, 5240, 38008, + 21624, 54392, 13432, 46200, 29816, 62584, 3192, 35960, 19576, 52344, 11384, + 44152, 27768, 60536, 7288, 40056, 23672, 56440, 15480, 48248, 31864, 64632, + 632, 33400, 17016, 49784, 8824, 41592, 25208, 57976, 4728, 37496, 21112, + 53880, 12920, 45688, 29304, 62072, 2680, 35448, 19064, 51832, 10872, 43640, + 27256, 60024, 6776, 39544, 23160, 55928, 14968, 47736, 31352, 64120, 1656, + 34424, 18040, 50808, 9848, 42616, 26232, 59000, 5752, 38520, 22136, 54904, + 13944, 46712, 30328, 63096, 3704, 36472, 20088, 52856, 11896, 44664, 28280, + 61048, 7800, 40568, 24184, 56952, 15992, 48760, 32376, 65144, 376, 33144, + 16760, 49528, 8568, 41336, 24952, 57720, 4472, 37240, 20856, 53624, 12664, + 45432, 29048, 61816, 2424, 35192, 18808, 51576, 10616, 43384, 27000, 59768, + 6520, 39288, 22904, 55672, 14712, 47480, 31096, 63864, 1400, 34168, 17784, + 50552, 9592, 42360, 25976, 58744, 5496, 38264, 21880, 54648, 13688, 46456, + 30072, 62840, 3448, 36216, 19832, 52600, 11640, 44408, 28024, 60792, 7544, + 40312, 23928, 56696, 15736, 48504, 32120, 64888, 888, 33656, 17272, 50040, + 9080, 41848, 25464, 58232, 4984, 37752, 21368, 54136, 13176, 45944, 29560, + 62328, 2936, 35704, 19320, 52088, 11128, 43896, 27512, 60280, 7032, 39800, + 23416, 56184, 15224, 47992, 31608, 64376, 1912, 34680, 18296, 51064, 10104, + 42872, 26488, 59256, 6008, 38776, 22392, 55160, 14200, 46968, 30584, 63352, + 3960, 36728, 20344, 53112, 12152, 44920, 28536, 61304, 8056, 40824, 24440, + 57208, 16248, 49016, 32632, 65400, 248, 33016, 16632, 49400, 8440, 41208, + 24824, 57592, 4344, 37112, 20728, 53496, 12536, 45304, 28920, 61688, 2296, + 35064, 18680, 51448, 10488, 43256, 26872, 59640, 6392, 39160, 22776, 55544, + 14584, 47352, 30968, 63736, 1272, 34040, 17656, 50424, 9464, 42232, 25848, + 58616, 5368, 38136, 21752, 54520, 13560, 46328, 29944, 62712, 3320, 36088, + 19704, 52472, 11512, 44280, 27896, 60664, 7416, 40184, 23800, 56568, 15608, + 48376, 31992, 64760, 760, 33528, 17144, 49912, 8952, 41720, 25336, 58104, + 4856, 37624, 21240, 54008, 13048, 45816, 29432, 62200, 2808, 35576, 19192, + 51960, 11000, 43768, 27384, 60152, 6904, 39672, 23288, 56056, 15096, 47864, + 31480, 64248, 1784, 34552, 18168, 50936, 9976, 42744, 26360, 59128, 5880, + 38648, 22264, 55032, 14072, 46840, 30456, 63224, 3832, 36600, 20216, 52984, + 12024, 44792, 28408, 61176, 7928, 40696, 24312, 57080, 16120, 48888, 32504, + 65272, 504, 33272, 16888, 49656, 8696, 41464, 25080, 57848, 4600, 37368, + 20984, 53752, 12792, 45560, 29176, 61944, 2552, 35320, 18936, 51704, 10744, + 43512, 27128, 59896, 6648, 39416, 23032, 55800, 14840, 47608, 31224, 63992, + 1528, 34296, 17912, 50680, 9720, 42488, 26104, 58872, 5624, 38392, 22008, + 54776, 13816, 46584, 30200, 62968, 3576, 36344, 19960, 52728, 11768, 44536, + 28152, 60920, 7672, 40440, 24056, 56824, 15864, 48632, 32248, 65016, 1016, + 33784, 17400, 50168, 9208, 41976, 25592, 58360, 5112, 37880, 21496, 54264, + 13304, 46072, 29688, 62456, 3064, 35832, 19448, 52216, 11256, 44024, 27640, + 60408, 7160, 39928, 23544, 56312, 15352, 48120, 31736, 64504, 2040, 34808, + 18424, 51192, 10232, 43000, 26616, 59384, 6136, 38904, 22520, 55288, 14328, + 47096, 30712, 63480, 4088, 36856, 20472, 53240, 12280, 45048, 28664, 61432, + 8184, 40952, 24568, 57336, 16376, 49144, 32760, 65528, 4, 32772, 16388, + 49156, 8196, 40964, 24580, 57348, 4100, 36868, 20484, 53252, 12292, 45060, + 28676, 61444, 2052, 34820, 18436, 51204, 10244, 43012, 26628, 59396, 6148, + 38916, 22532, 55300, 14340, 47108, 30724, 63492, 1028, 33796, 17412, 50180, + 9220, 41988, 25604, 58372, 5124, 37892, 21508, 54276, 13316, 46084, 29700, + 62468, 3076, 35844, 19460, 52228, 11268, 44036, 27652, 60420, 7172, 39940, + 23556, 56324, 15364, 48132, 31748, 64516, 516, 33284, 16900, 49668, 8708, + 41476, 25092, 57860, 4612, 37380, 20996, 53764, 12804, 45572, 29188, 61956, + 2564, 35332, 18948, 51716, 10756, 43524, 27140, 59908, 6660, 39428, 23044, + 55812, 14852, 47620, 31236, 64004, 1540, 34308, 17924, 50692, 9732, 42500, + 26116, 58884, 5636, 38404, 22020, 54788, 13828, 46596, 30212, 62980, 3588, + 36356, 19972, 52740, 11780, 44548, 28164, 60932, 7684, 40452, 24068, 56836, + 15876, 48644, 32260, 65028, 260, 33028, 16644, 49412, 8452, 41220, 24836, + 57604, 4356, 37124, 20740, 53508, 12548, 45316, 28932, 61700, 2308, 35076, + 18692, 51460, 10500, 43268, 26884, 59652, 6404, 39172, 22788, 55556, 14596, + 47364, 30980, 63748, 1284, 34052, 17668, 50436, 9476, 42244, 25860, 58628, + 5380, 38148, 21764, 54532, 13572, 46340, 29956, 62724, 3332, 36100, 19716, + 52484, 11524, 44292, 27908, 60676, 7428, 40196, 23812, 56580, 15620, 48388, + 32004, 64772, 772, 33540, 17156, 49924, 8964, 41732, 25348, 58116, 4868, + 37636, 21252, 54020, 13060, 45828, 29444, 62212, 2820, 35588, 19204, 51972, + 11012, 43780, 27396, 60164, 6916, 39684, 23300, 56068, 15108, 47876, 31492, + 64260, 1796, 34564, 18180, 50948, 9988, 42756, 26372, 59140, 5892, 38660, + 22276, 55044, 14084, 46852, 30468, 63236, 3844, 36612, 20228, 52996, 12036, + 44804, 28420, 61188, 7940, 40708, 24324, 57092, 16132, 48900, 32516, 65284, + 132, 32900, 16516, 49284, 8324, 41092, 24708, 57476, 4228, 36996, 20612, + 53380, 12420, 45188, 28804, 61572, 2180, 34948, 18564, 51332, 10372, 43140, + 26756, 59524, 6276, 39044, 22660, 55428, 14468, 47236, 30852, 63620, 1156, + 33924, 17540, 50308, 9348, 42116, 25732, 58500, 5252, 38020, 21636, 54404, + 13444, 46212, 29828, 62596, 3204, 35972, 19588, 52356, 11396, 44164, 27780, + 60548, 7300, 40068, 23684, 56452, 15492, 48260, 31876, 64644, 644, 33412, + 17028, 49796, 8836, 41604, 25220, 57988, 4740, 37508, 21124, 53892, 12932, + 45700, 29316, 62084, 2692, 35460, 19076, 51844, 10884, 43652, 27268, 60036, + 6788, 39556, 23172, 55940, 14980, 47748, 31364, 64132, 1668, 34436, 18052, + 50820, 9860, 42628, 26244, 59012, 5764, 38532, 22148, 54916, 13956, 46724, + 30340, 63108, 3716, 36484, 20100, 52868, 11908, 44676, 28292, 61060, 7812, + 40580, 24196, 56964, 16004, 48772, 32388, 65156, 388, 33156, 16772, 49540, + 8580, 41348, 24964, 57732, 4484, 37252, 20868, 53636, 12676, 45444, 29060, + 61828, 2436, 35204, 18820, 51588, 10628, 43396, 27012, 59780, 6532, 39300, + 22916, 55684, 14724, 47492, 31108, 63876, 1412, 34180, 17796, 50564, 9604, + 42372, 25988, 58756, 5508, 38276, 21892, 54660, 13700, 46468, 30084, 62852, + 3460, 36228, 19844, 52612, 11652, 44420, 28036, 60804, 7556, 40324, 23940, + 56708, 15748, 48516, 32132, 64900, 900, 33668, 17284, 50052, 9092, 41860, + 25476, 58244, 4996, 37764, 21380, 54148, 13188, 45956, 29572, 62340, 2948, + 35716, 19332, 52100, 11140, 43908, 27524, 60292, 7044, 39812, 23428, 56196, + 15236, 48004, 31620, 64388, 1924, 34692, 18308, 51076, 10116, 42884, 26500, + 59268, 6020, 38788, 22404, 55172, 14212, 46980, 30596, 63364, 3972, 36740, + 20356, 53124, 12164, 44932, 28548, 61316, 8068, 40836, 24452, 57220, 16260, + 49028, 32644, 65412, 68, 32836, 16452, 49220, 8260, 41028, 24644, 57412, + 4164, 36932, 20548, 53316, 12356, 45124, 28740, 61508, 2116, 34884, 18500, + 51268, 10308, 43076, 26692, 59460, 6212, 38980, 22596, 55364, 14404, 47172, + 30788, 63556, 1092, 33860, 17476, 50244, 9284, 42052, 25668, 58436, 5188, + 37956, 21572, 54340, 13380, 46148, 29764, 62532, 3140, 35908, 19524, 52292, + 11332, 44100, 27716, 60484, 7236, 40004, 23620, 56388, 15428, 48196, 31812, + 64580, 580, 33348, 16964, 49732, 8772, 41540, 25156, 57924, 4676, 37444, + 21060, 53828, 12868, 45636, 29252, 62020, 2628, 35396, 19012, 51780, 10820, + 43588, 27204, 59972, 6724, 39492, 23108, 55876, 14916, 47684, 31300, 64068, + 1604, 34372, 17988, 50756, 9796, 42564, 26180, 58948, 5700, 38468, 22084, + 54852, 13892, 46660, 30276, 63044, 3652, 36420, 20036, 52804, 11844, 44612, + 28228, 60996, 7748, 40516, 24132, 56900, 15940, 48708, 32324, 65092, 324, + 33092, 16708, 49476, 8516, 41284, 24900, 57668, 4420, 37188, 20804, 53572, + 12612, 45380, 28996, 61764, 2372, 35140, 18756, 51524, 10564, 43332, 26948, + 59716, 6468, 39236, 22852, 55620, 14660, 47428, 31044, 63812, 1348, 34116, + 17732, 50500, 9540, 42308, 25924, 58692, 5444, 38212, 21828, 54596, 13636, + 46404, 30020, 62788, 3396, 36164, 19780, 52548, 11588, 44356, 27972, 60740, + 7492, 40260, 23876, 56644, 15684, 48452, 32068, 64836, 836, 33604, 17220, + 49988, 9028, 41796, 25412, 58180, 4932, 37700, 21316, 54084, 13124, 45892, + 29508, 62276, 2884, 35652, 19268, 52036, 11076, 43844, 27460, 60228, 6980, + 39748, 23364, 56132, 15172, 47940, 31556, 64324, 1860, 34628, 18244, 51012, + 10052, 42820, 26436, 59204, 5956, 38724, 22340, 55108, 14148, 46916, 30532, + 63300, 3908, 36676, 20292, 53060, 12100, 44868, 28484, 61252, 8004, 40772, + 24388, 57156, 16196, 48964, 32580, 65348, 196, 32964, 16580, 49348, 8388, + 41156, 24772, 57540, 4292, 37060, 20676, 53444, 12484, 45252, 28868, 61636, + 2244, 35012, 18628, 51396, 10436, 43204, 26820, 59588, 6340, 39108, 22724, + 55492, 14532, 47300, 30916, 63684, 1220, 33988, 17604, 50372, 9412, 42180, + 25796, 58564, 5316, 38084, 21700, 54468, 13508, 46276, 29892, 62660, 3268, + 36036, 19652, 52420, 11460, 44228, 27844, 60612, 7364, 40132, 23748, 56516, + 15556, 48324, 31940, 64708, 708, 33476, 17092, 49860, 8900, 41668, 25284, + 58052, 4804, 37572, 21188, 53956, 12996, 45764, 29380, 62148, 2756, 35524, + 19140, 51908, 10948, 43716, 27332, 60100, 6852, 39620, 23236, 56004, 15044, + 47812, 31428, 64196, 1732, 34500, 18116, 50884, 9924, 42692, 26308, 59076, + 5828, 38596, 22212, 54980, 14020, 46788, 30404, 63172, 3780, 36548, 20164, + 52932, 11972, 44740, 28356, 61124, 7876, 40644, 24260, 57028, 16068, 48836, + 32452, 65220, 452, 33220, 16836, 49604, 8644, 41412, 25028, 57796, 4548, + 37316, 20932, 53700, 12740, 45508, 29124, 61892, 2500, 35268, 18884, 51652, + 10692, 43460, 27076, 59844, 6596, 39364, 22980, 55748, 14788, 47556, 31172, + 63940, 1476, 34244, 17860, 50628, 9668, 42436, 26052, 58820, 5572, 38340, + 21956, 54724, 13764, 46532, 30148, 62916, 3524, 36292, 19908, 52676, 11716, + 44484, 28100, 60868, 7620, 40388, 24004, 56772, 15812, 48580, 32196, 64964, + 964, 33732, 17348, 50116, 9156, 41924, 25540, 58308, 5060, 37828, 21444, + 54212, 13252, 46020, 29636, 62404, 3012, 35780, 19396, 52164, 11204, 43972, + 27588, 60356, 7108, 39876, 23492, 56260, 15300, 48068, 31684, 64452, 1988, + 34756, 18372, 51140, 10180, 42948, 26564, 59332, 6084, 38852, 22468, 55236, + 14276, 47044, 30660, 63428, 4036, 36804, 20420, 53188, 12228, 44996, 28612, + 61380, 8132, 40900, 24516, 57284, 16324, 49092, 32708, 65476, 36, 32804, + 16420, 49188, 8228, 40996, 24612, 57380, 4132, 36900, 20516, 53284, 12324, + 45092, 28708, 61476, 2084, 34852, 18468, 51236, 10276, 43044, 26660, 59428, + 6180, 38948, 22564, 55332, 14372, 47140, 30756, 63524, 1060, 33828, 17444, + 50212, 9252, 42020, 25636, 58404, 5156, 37924, 21540, 54308, 13348, 46116, + 29732, 62500, 3108, 35876, 19492, 52260, 11300, 44068, 27684, 60452, 7204, + 39972, 23588, 56356, 15396, 48164, 31780, 64548, 548, 33316, 16932, 49700, + 8740, 41508, 25124, 57892, 4644, 37412, 21028, 53796, 12836, 45604, 29220, + 61988, 2596, 35364, 18980, 51748, 10788, 43556, 27172, 59940, 6692, 39460, + 23076, 55844, 14884, 47652, 31268, 64036, 1572, 34340, 17956, 50724, 9764, + 42532, 26148, 58916, 5668, 38436, 22052, 54820, 13860, 46628, 30244, 63012, + 3620, 36388, 20004, 52772, 11812, 44580, 28196, 60964, 7716, 40484, 24100, + 56868, 15908, 48676, 32292, 65060, 292, 33060, 16676, 49444, 8484, 41252, + 24868, 57636, 4388, 37156, 20772, 53540, 12580, 45348, 28964, 61732, 2340, + 35108, 18724, 51492, 10532, 43300, 26916, 59684, 6436, 39204, 22820, 55588, + 14628, 47396, 31012, 63780, 1316, 34084, 17700, 50468, 9508, 42276, 25892, + 58660, 5412, 38180, 21796, 54564, 13604, 46372, 29988, 62756, 3364, 36132, + 19748, 52516, 11556, 44324, 27940, 60708, 7460, 40228, 23844, 56612, 15652, + 48420, 32036, 64804, 804, 33572, 17188, 49956, 8996, 41764, 25380, 58148, + 4900, 37668, 21284, 54052, 13092, 45860, 29476, 62244, 2852, 35620, 19236, + 52004, 11044, 43812, 27428, 60196, 6948, 39716, 23332, 56100, 15140, 47908, + 31524, 64292, 1828, 34596, 18212, 50980, 10020, 42788, 26404, 59172, 5924, + 38692, 22308, 55076, 14116, 46884, 30500, 63268, 3876, 36644, 20260, 53028, + 12068, 44836, 28452, 61220, 7972, 40740, 24356, 57124, 16164, 48932, 32548, + 65316, 164, 32932, 16548, 49316, 8356, 41124, 24740, 57508, 4260, 37028, + 20644, 53412, 12452, 45220, 28836, 61604, 2212, 34980, 18596, 51364, 10404, + 43172, 26788, 59556, 6308, 39076, 22692, 55460, 14500, 47268, 30884, 63652, + 1188, 33956, 17572, 50340, 9380, 42148, 25764, 58532, 5284, 38052, 21668, + 54436, 13476, 46244, 29860, 62628, 3236, 36004, 19620, 52388, 11428, 44196, + 27812, 60580, 7332, 40100, 23716, 56484, 15524, 48292, 31908, 64676, 676, + 33444, 17060, 49828, 8868, 41636, 25252, 58020, 4772, 37540, 21156, 53924, + 12964, 45732, 29348, 62116, 2724, 35492, 19108, 51876, 10916, 43684, 27300, + 60068, 6820, 39588, 23204, 55972, 15012, 47780, 31396, 64164, 1700, 34468, + 18084, 50852, 9892, 42660, 26276, 59044, 5796, 38564, 22180, 54948, 13988, + 46756, 30372, 63140, 3748, 36516, 20132, 52900, 11940, 44708, 28324, 61092, + 7844, 40612, 24228, 56996, 16036, 48804, 32420, 65188, 420, 33188, 16804, + 49572, 8612, 41380, 24996, 57764, 4516, 37284, 20900, 53668, 12708, 45476, + 29092, 61860, 2468, 35236, 18852, 51620, 10660, 43428, 27044, 59812, 6564, + 39332, 22948, 55716, 14756, 47524, 31140, 63908, 1444, 34212, 17828, 50596, + 9636, 42404, 26020, 58788, 5540, 38308, 21924, 54692, 13732, 46500, 30116, + 62884, 3492, 36260, 19876, 52644, 11684, 44452, 28068, 60836, 7588, 40356, + 23972, 56740, 15780, 48548, 32164, 64932, 932, 33700, 17316, 50084, 9124, + 41892, 25508, 58276, 5028, 37796, 21412, 54180, 13220, 45988, 29604, 62372, + 2980, 35748, 19364, 52132, 11172, 43940, 27556, 60324, 7076, 39844, 23460, + 56228, 15268, 48036, 31652, 64420, 1956, 34724, 18340, 51108, 10148, 42916, + 26532, 59300, 6052, 38820, 22436, 55204, 14244, 47012, 30628, 63396, 4004, + 36772, 20388, 53156, 12196, 44964, 28580, 61348, 8100, 40868, 24484, 57252, + 16292, 49060, 32676, 65444, 100, 32868, 16484, 49252, 8292, 41060, 24676, + 57444, 4196, 36964, 20580, 53348, 12388, 45156, 28772, 61540, 2148, 34916, + 18532, 51300, 10340, 43108, 26724, 59492, 6244, 39012, 22628, 55396, 14436, + 47204, 30820, 63588, 1124, 33892, 17508, 50276, 9316, 42084, 25700, 58468, + 5220, 37988, 21604, 54372, 13412, 46180, 29796, 62564, 3172, 35940, 19556, + 52324, 11364, 44132, 27748, 60516, 7268, 40036, 23652, 56420, 15460, 48228, + 31844, 64612, 612, 33380, 16996, 49764, 8804, 41572, 25188, 57956, 4708, + 37476, 21092, 53860, 12900, 45668, 29284, 62052, 2660, 35428, 19044, 51812, + 10852, 43620, 27236, 60004, 6756, 39524, 23140, 55908, 14948, 47716, 31332, + 64100, 1636, 34404, 18020, 50788, 9828, 42596, 26212, 58980, 5732, 38500, + 22116, 54884, 13924, 46692, 30308, 63076, 3684, 36452, 20068, 52836, 11876, + 44644, 28260, 61028, 7780, 40548, 24164, 56932, 15972, 48740, 32356, 65124, + 356, 33124, 16740, 49508, 8548, 41316, 24932, 57700, 4452, 37220, 20836, + 53604, 12644, 45412, 29028, 61796, 2404, 35172, 18788, 51556, 10596, 43364, + 26980, 59748, 6500, 39268, 22884, 55652, 14692, 47460, 31076, 63844, 1380, + 34148, 17764, 50532, 9572, 42340, 25956, 58724, 5476, 38244, 21860, 54628, + 13668, 46436, 30052, 62820, 3428, 36196, 19812, 52580, 11620, 44388, 28004, + 60772, 7524, 40292, 23908, 56676, 15716, 48484, 32100, 64868, 868, 33636, + 17252, 50020, 9060, 41828, 25444, 58212, 4964, 37732, 21348, 54116, 13156, + 45924, 29540, 62308, 2916, 35684, 19300, 52068, 11108, 43876, 27492, 60260, + 7012, 39780, 23396, 56164, 15204, 47972, 31588, 64356, 1892, 34660, 18276, + 51044, 10084, 42852, 26468, 59236, 5988, 38756, 22372, 55140, 14180, 46948, + 30564, 63332, 3940, 36708, 20324, 53092, 12132, 44900, 28516, 61284, 8036, + 40804, 24420, 57188, 16228, 48996, 32612, 65380, 228, 32996, 16612, 49380, + 8420, 41188, 24804, 57572, 4324, 37092, 20708, 53476, 12516, 45284, 28900, + 61668, 2276, 35044, 18660, 51428, 10468, 43236, 26852, 59620, 6372, 39140, + 22756, 55524, 14564, 47332, 30948, 63716, 1252, 34020, 17636, 50404, 9444, + 42212, 25828, 58596, 5348, 38116, 21732, 54500, 13540, 46308, 29924, 62692, + 3300, 36068, 19684, 52452, 11492, 44260, 27876, 60644, 7396, 40164, 23780, + 56548, 15588, 48356, 31972, 64740, 740, 33508, 17124, 49892, 8932, 41700, + 25316, 58084, 4836, 37604, 21220, 53988, 13028, 45796, 29412, 62180, 2788, + 35556, 19172, 51940, 10980, 43748, 27364, 60132, 6884, 39652, 23268, 56036, + 15076, 47844, 31460, 64228, 1764, 34532, 18148, 50916, 9956, 42724, 26340, + 59108, 5860, 38628, 22244, 55012, 14052, 46820, 30436, 63204, 3812, 36580, + 20196, 52964, 12004, 44772, 28388, 61156, 7908, 40676, 24292, 57060, 16100, + 48868, 32484, 65252, 484, 33252, 16868, 49636, 8676, 41444, 25060, 57828, + 4580, 37348, 20964, 53732, 12772, 45540, 29156, 61924, 2532, 35300, 18916, + 51684, 10724, 43492, 27108, 59876, 6628, 39396, 23012, 55780, 14820, 47588, + 31204, 63972, 1508, 34276, 17892, 50660, 9700, 42468, 26084, 58852, 5604, + 38372, 21988, 54756, 13796, 46564, 30180, 62948, 3556, 36324, 19940, 52708, + 11748, 44516, 28132, 60900, 7652, 40420, 24036, 56804, 15844, 48612, 32228, + 64996, 996, 33764, 17380, 50148, 9188, 41956, 25572, 58340, 5092, 37860, + 21476, 54244, 13284, 46052, 29668, 62436, 3044, 35812, 19428, 52196, 11236, + 44004, 27620, 60388, 7140, 39908, 23524, 56292, 15332, 48100, 31716, 64484, + 2020, 34788, 18404, 51172, 10212, 42980, 26596, 59364, 6116, 38884, 22500, + 55268, 14308, 47076, 30692, 63460, 4068, 36836, 20452, 53220, 12260, 45028, + 28644, 61412, 8164, 40932, 24548, 57316, 16356, 49124, 32740, 65508, 20, + 32788, 16404, 49172, 8212, 40980, 24596, 57364, 4116, 36884, 20500, 53268, + 12308, 45076, 28692, 61460, 2068, 34836, 18452, 51220, 10260, 43028, 26644, + 59412, 6164, 38932, 22548, 55316, 14356, 47124, 30740, 63508, 1044, 33812, + 17428, 50196, 9236, 42004, 25620, 58388, 5140, 37908, 21524, 54292, 13332, + 46100, 29716, 62484, 3092, 35860, 19476, 52244, 11284, 44052, 27668, 60436, + 7188, 39956, 23572, 56340, 15380, 48148, 31764, 64532, 532, 33300, 16916, + 49684, 8724, 41492, 25108, 57876, 4628, 37396, 21012, 53780, 12820, 45588, + 29204, 61972, 2580, 35348, 18964, 51732, 10772, 43540, 27156, 59924, 6676, + 39444, 23060, 55828, 14868, 47636, 31252, 64020, 1556, 34324, 17940, 50708, + 9748, 42516, 26132, 58900, 5652, 38420, 22036, 54804, 13844, 46612, 30228, + 62996, 3604, 36372, 19988, 52756, 11796, 44564, 28180, 60948, 7700, 40468, + 24084, 56852, 15892, 48660, 32276, 65044, 276, 33044, 16660, 49428, 8468, + 41236, 24852, 57620, 4372, 37140, 20756, 53524, 12564, 45332, 28948, 61716, + 2324, 35092, 18708, 51476, 10516, 43284, 26900, 59668, 6420, 39188, 22804, + 55572, 14612, 47380, 30996, 63764, 1300, 34068, 17684, 50452, 9492, 42260, + 25876, 58644, 5396, 38164, 21780, 54548, 13588, 46356, 29972, 62740, 3348, + 36116, 19732, 52500, 11540, 44308, 27924, 60692, 7444, 40212, 23828, 56596, + 15636, 48404, 32020, 64788, 788, 33556, 17172, 49940, 8980, 41748, 25364, + 58132, 4884, 37652, 21268, 54036, 13076, 45844, 29460, 62228, 2836, 35604, + 19220, 51988, 11028, 43796, 27412, 60180, 6932, 39700, 23316, 56084, 15124, + 47892, 31508, 64276, 1812, 34580, 18196, 50964, 10004, 42772, 26388, 59156, + 5908, 38676, 22292, 55060, 14100, 46868, 30484, 63252, 3860, 36628, 20244, + 53012, 12052, 44820, 28436, 61204, 7956, 40724, 24340, 57108, 16148, 48916, + 32532, 65300, 148, 32916, 16532, 49300, 8340, 41108, 24724, 57492, 4244, + 37012, 20628, 53396, 12436, 45204, 28820, 61588, 2196, 34964, 18580, 51348, + 10388, 43156, 26772, 59540, 6292, 39060, 22676, 55444, 14484, 47252, 30868, + 63636, 1172, 33940, 17556, 50324, 9364, 42132, 25748, 58516, 5268, 38036, + 21652, 54420, 13460, 46228, 29844, 62612, 3220, 35988, 19604, 52372, 11412, + 44180, 27796, 60564, 7316, 40084, 23700, 56468, 15508, 48276, 31892, 64660, + 660, 33428, 17044, 49812, 8852, 41620, 25236, 58004, 4756, 37524, 21140, + 53908, 12948, 45716, 29332, 62100, 2708, 35476, 19092, 51860, 10900, 43668, + 27284, 60052, 6804, 39572, 23188, 55956, 14996, 47764, 31380, 64148, 1684, + 34452, 18068, 50836, 9876, 42644, 26260, 59028, 5780, 38548, 22164, 54932, + 13972, 46740, 30356, 63124, 3732, 36500, 20116, 52884, 11924, 44692, 28308, + 61076, 7828, 40596, 24212, 56980, 16020, 48788, 32404, 65172, 404, 33172, + 16788, 49556, 8596, 41364, 24980, 57748, 4500, 37268, 20884, 53652, 12692, + 45460, 29076, 61844, 2452, 35220, 18836, 51604, 10644, 43412, 27028, 59796, + 6548, 39316, 22932, 55700, 14740, 47508, 31124, 63892, 1428, 34196, 17812, + 50580, 9620, 42388, 26004, 58772, 5524, 38292, 21908, 54676, 13716, 46484, + 30100, 62868, 3476, 36244, 19860, 52628, 11668, 44436, 28052, 60820, 7572, + 40340, 23956, 56724, 15764, 48532, 32148, 64916, 916, 33684, 17300, 50068, + 9108, 41876, 25492, 58260, 5012, 37780, 21396, 54164, 13204, 45972, 29588, + 62356, 2964, 35732, 19348, 52116, 11156, 43924, 27540, 60308, 7060, 39828, + 23444, 56212, 15252, 48020, 31636, 64404, 1940, 34708, 18324, 51092, 10132, + 42900, 26516, 59284, 6036, 38804, 22420, 55188, 14228, 46996, 30612, 63380, + 3988, 36756, 20372, 53140, 12180, 44948, 28564, 61332, 8084, 40852, 24468, + 57236, 16276, 49044, 32660, 65428, 84, 32852, 16468, 49236, 8276, 41044, + 24660, 57428, 4180, 36948, 20564, 53332, 12372, 45140, 28756, 61524, 2132, + 34900, 18516, 51284, 10324, 43092, 26708, 59476, 6228, 38996, 22612, 55380, + 14420, 47188, 30804, 63572, 1108, 33876, 17492, 50260, 9300, 42068, 25684, + 58452, 5204, 37972, 21588, 54356, 13396, 46164, 29780, 62548, 3156, 35924, + 19540, 52308, 11348, 44116, 27732, 60500, 7252, 40020, 23636, 56404, 15444, + 48212, 31828, 64596, 596, 33364, 16980, 49748, 8788, 41556, 25172, 57940, + 4692, 37460, 21076, 53844, 12884, 45652, 29268, 62036, 2644, 35412, 19028, + 51796, 10836, 43604, 27220, 59988, 6740, 39508, 23124, 55892, 14932, 47700, + 31316, 64084, 1620, 34388, 18004, 50772, 9812, 42580, 26196, 58964, 5716, + 38484, 22100, 54868, 13908, 46676, 30292, 63060, 3668, 36436, 20052, 52820, + 11860, 44628, 28244, 61012, 7764, 40532, 24148, 56916, 15956, 48724, 32340, + 65108, 340, 33108, 16724, 49492, 8532, 41300, 24916, 57684, 4436, 37204, + 20820, 53588, 12628, 45396, 29012, 61780, 2388, 35156, 18772, 51540, 10580, + 43348, 26964, 59732, 6484, 39252, 22868, 55636, 14676, 47444, 31060, 63828, + 1364, 34132, 17748, 50516, 9556, 42324, 25940, 58708, 5460, 38228, 21844, + 54612, 13652, 46420, 30036, 62804, 3412, 36180, 19796, 52564, 11604, 44372, + 27988, 60756, 7508, 40276, 23892, 56660, 15700, 48468, 32084, 64852, 852, + 33620, 17236, 50004, 9044, 41812, 25428, 58196, 4948, 37716, 21332, 54100, + 13140, 45908, 29524, 62292, 2900, 35668, 19284, 52052, 11092, 43860, 27476, + 60244, 6996, 39764, 23380, 56148, 15188, 47956, 31572, 64340, 1876, 34644, + 18260, 51028, 10068, 42836, 26452, 59220, 5972, 38740, 22356, 55124, 14164, + 46932, 30548, 63316, 3924, 36692, 20308, 53076, 12116, 44884, 28500, 61268, + 8020, 40788, 24404, 57172, 16212, 48980, 32596, 65364, 212, 32980, 16596, + 49364, 8404, 41172, 24788, 57556, 4308, 37076, 20692, 53460, 12500, 45268, + 28884, 61652, 2260, 35028, 18644, 51412, 10452, 43220, 26836, 59604, 6356, + 39124, 22740, 55508, 14548, 47316, 30932, 63700, 1236, 34004, 17620, 50388, + 9428, 42196, 25812, 58580, 5332, 38100, 21716, 54484, 13524, 46292, 29908, + 62676, 3284, 36052, 19668, 52436, 11476, 44244, 27860, 60628, 7380, 40148, + 23764, 56532, 15572, 48340, 31956, 64724, 724, 33492, 17108, 49876, 8916, + 41684, 25300, 58068, 4820, 37588, 21204, 53972, 13012, 45780, 29396, 62164, + 2772, 35540, 19156, 51924, 10964, 43732, 27348, 60116, 6868, 39636, 23252, + 56020, 15060, 47828, 31444, 64212, 1748, 34516, 18132, 50900, 9940, 42708, + 26324, 59092, 5844, 38612, 22228, 54996, 14036, 46804, 30420, 63188, 3796, + 36564, 20180, 52948, 11988, 44756, 28372, 61140, 7892, 40660, 24276, 57044, + 16084, 48852, 32468, 65236, 468, 33236, 16852, 49620, 8660, 41428, 25044, + 57812, 4564, 37332, 20948, 53716, 12756, 45524, 29140, 61908, 2516, 35284, + 18900, 51668, 10708, 43476, 27092, 59860, 6612, 39380, 22996, 55764, 14804, + 47572, 31188, 63956, 1492, 34260, 17876, 50644, 9684, 42452, 26068, 58836, + 5588, 38356, 21972, 54740, 13780, 46548, 30164, 62932, 3540, 36308, 19924, + 52692, 11732, 44500, 28116, 60884, 7636, 40404, 24020, 56788, 15828, 48596, + 32212, 64980, 980, 33748, 17364, 50132, 9172, 41940, 25556, 58324, 5076, + 37844, 21460, 54228, 13268, 46036, 29652, 62420, 3028, 35796, 19412, 52180, + 11220, 43988, 27604, 60372, 7124, 39892, 23508, 56276, 15316, 48084, 31700, + 64468, 2004, 34772, 18388, 51156, 10196, 42964, 26580, 59348, 6100, 38868, + 22484, 55252, 14292, 47060, 30676, 63444, 4052, 36820, 20436, 53204, 12244, + 45012, 28628, 61396, 8148, 40916, 24532, 57300, 16340, 49108, 32724, 65492, + 52, 32820, 16436, 49204, 8244, 41012, 24628, 57396, 4148, 36916, 20532, + 53300, 12340, 45108, 28724, 61492, 2100, 34868, 18484, 51252, 10292, 43060, + 26676, 59444, 6196, 38964, 22580, 55348, 14388, 47156, 30772, 63540, 1076, + 33844, 17460, 50228, 9268, 42036, 25652, 58420, 5172, 37940, 21556, 54324, + 13364, 46132, 29748, 62516, 3124, 35892, 19508, 52276, 11316, 44084, 27700, + 60468, 7220, 39988, 23604, 56372, 15412, 48180, 31796, 64564, 564, 33332, + 16948, 49716, 8756, 41524, 25140, 57908, 4660, 37428, 21044, 53812, 12852, + 45620, 29236, 62004, 2612, 35380, 18996, 51764, 10804, 43572, 27188, 59956, + 6708, 39476, 23092, 55860, 14900, 47668, 31284, 64052, 1588, 34356, 17972, + 50740, 9780, 42548, 26164, 58932, 5684, 38452, 22068, 54836, 13876, 46644, + 30260, 63028, 3636, 36404, 20020, 52788, 11828, 44596, 28212, 60980, 7732, + 40500, 24116, 56884, 15924, 48692, 32308, 65076, 308, 33076, 16692, 49460, + 8500, 41268, 24884, 57652, 4404, 37172, 20788, 53556, 12596, 45364, 28980, + 61748, 2356, 35124, 18740, 51508, 10548, 43316, 26932, 59700, 6452, 39220, + 22836, 55604, 14644, 47412, 31028, 63796, 1332, 34100, 17716, 50484, 9524, + 42292, 25908, 58676, 5428, 38196, 21812, 54580, 13620, 46388, 30004, 62772, + 3380, 36148, 19764, 52532, 11572, 44340, 27956, 60724, 7476, 40244, 23860, + 56628, 15668, 48436, 32052, 64820, 820, 33588, 17204, 49972, 9012, 41780, + 25396, 58164, 4916, 37684, 21300, 54068, 13108, 45876, 29492, 62260, 2868, + 35636, 19252, 52020, 11060, 43828, 27444, 60212, 6964, 39732, 23348, 56116, + 15156, 47924, 31540, 64308, 1844, 34612, 18228, 50996, 10036, 42804, 26420, + 59188, 5940, 38708, 22324, 55092, 14132, 46900, 30516, 63284, 3892, 36660, + 20276, 53044, 12084, 44852, 28468, 61236, 7988, 40756, 24372, 57140, 16180, + 48948, 32564, 65332, 180, 32948, 16564, 49332, 8372, 41140, 24756, 57524, + 4276, 37044, 20660, 53428, 12468, 45236, 28852, 61620, 2228, 34996, 18612, + 51380, 10420, 43188, 26804, 59572, 6324, 39092, 22708, 55476, 14516, 47284, + 30900, 63668, 1204, 33972, 17588, 50356, 9396, 42164, 25780, 58548, 5300, + 38068, 21684, 54452, 13492, 46260, 29876, 62644, 3252, 36020, 19636, 52404, + 11444, 44212, 27828, 60596, 7348, 40116, 23732, 56500, 15540, 48308, 31924, + 64692, 692, 33460, 17076, 49844, 8884, 41652, 25268, 58036, 4788, 37556, + 21172, 53940, 12980, 45748, 29364, 62132, 2740, 35508, 19124, 51892, 10932, + 43700, 27316, 60084, 6836, 39604, 23220, 55988, 15028, 47796, 31412, 64180, + 1716, 34484, 18100, 50868, 9908, 42676, 26292, 59060, 5812, 38580, 22196, + 54964, 14004, 46772, 30388, 63156, 3764, 36532, 20148, 52916, 11956, 44724, + 28340, 61108, 7860, 40628, 24244, 57012, 16052, 48820, 32436, 65204, 436, + 33204, 16820, 49588, 8628, 41396, 25012, 57780, 4532, 37300, 20916, 53684, + 12724, 45492, 29108, 61876, 2484, 35252, 18868, 51636, 10676, 43444, 27060, + 59828, 6580, 39348, 22964, 55732, 14772, 47540, 31156, 63924, 1460, 34228, + 17844, 50612, 9652, 42420, 26036, 58804, 5556, 38324, 21940, 54708, 13748, + 46516, 30132, 62900, 3508, 36276, 19892, 52660, 11700, 44468, 28084, 60852, + 7604, 40372, 23988, 56756, 15796, 48564, 32180, 64948, 948, 33716, 17332, + 50100, 9140, 41908, 25524, 58292, 5044, 37812, 21428, 54196, 13236, 46004, + 29620, 62388, 2996, 35764, 19380, 52148, 11188, 43956, 27572, 60340, 7092, + 39860, 23476, 56244, 15284, 48052, 31668, 64436, 1972, 34740, 18356, 51124, + 10164, 42932, 26548, 59316, 6068, 38836, 22452, 55220, 14260, 47028, 30644, + 63412, 4020, 36788, 20404, 53172, 12212, 44980, 28596, 61364, 8116, 40884, + 24500, 57268, 16308, 49076, 32692, 65460, 116, 32884, 16500, 49268, 8308, + 41076, 24692, 57460, 4212, 36980, 20596, 53364, 12404, 45172, 28788, 61556, + 2164, 34932, 18548, 51316, 10356, 43124, 26740, 59508, 6260, 39028, 22644, + 55412, 14452, 47220, 30836, 63604, 1140, 33908, 17524, 50292, 9332, 42100, + 25716, 58484, 5236, 38004, 21620, 54388, 13428, 46196, 29812, 62580, 3188, + 35956, 19572, 52340, 11380, 44148, 27764, 60532, 7284, 40052, 23668, 56436, + 15476, 48244, 31860, 64628, 628, 33396, 17012, 49780, 8820, 41588, 25204, + 57972, 4724, 37492, 21108, 53876, 12916, 45684, 29300, 62068, 2676, 35444, + 19060, 51828, 10868, 43636, 27252, 60020, 6772, 39540, 23156, 55924, 14964, + 47732, 31348, 64116, 1652, 34420, 18036, 50804, 9844, 42612, 26228, 58996, + 5748, 38516, 22132, 54900, 13940, 46708, 30324, 63092, 3700, 36468, 20084, + 52852, 11892, 44660, 28276, 61044, 7796, 40564, 24180, 56948, 15988, 48756, + 32372, 65140, 372, 33140, 16756, 49524, 8564, 41332, 24948, 57716, 4468, + 37236, 20852, 53620, 12660, 45428, 29044, 61812, 2420, 35188, 18804, 51572, + 10612, 43380, 26996, 59764, 6516, 39284, 22900, 55668, 14708, 47476, 31092, + 63860, 1396, 34164, 17780, 50548, 9588, 42356, 25972, 58740, 5492, 38260, + 21876, 54644, 13684, 46452, 30068, 62836, 3444, 36212, 19828, 52596, 11636, + 44404, 28020, 60788, 7540, 40308, 23924, 56692, 15732, 48500, 32116, 64884, + 884, 33652, 17268, 50036, 9076, 41844, 25460, 58228, 4980, 37748, 21364, + 54132, 13172, 45940, 29556, 62324, 2932, 35700, 19316, 52084, 11124, 43892, + 27508, 60276, 7028, 39796, 23412, 56180, 15220, 47988, 31604, 64372, 1908, + 34676, 18292, 51060, 10100, 42868, 26484, 59252, 6004, 38772, 22388, 55156, + 14196, 46964, 30580, 63348, 3956, 36724, 20340, 53108, 12148, 44916, 28532, + 61300, 8052, 40820, 24436, 57204, 16244, 49012, 32628, 65396, 244, 33012, + 16628, 49396, 8436, 41204, 24820, 57588, 4340, 37108, 20724, 53492, 12532, + 45300, 28916, 61684, 2292, 35060, 18676, 51444, 10484, 43252, 26868, 59636, + 6388, 39156, 22772, 55540, 14580, 47348, 30964, 63732, 1268, 34036, 17652, + 50420, 9460, 42228, 25844, 58612, 5364, 38132, 21748, 54516, 13556, 46324, + 29940, 62708, 3316, 36084, 19700, 52468, 11508, 44276, 27892, 60660, 7412, + 40180, 23796, 56564, 15604, 48372, 31988, 64756, 756, 33524, 17140, 49908, + 8948, 41716, 25332, 58100, 4852, 37620, 21236, 54004, 13044, 45812, 29428, + 62196, 2804, 35572, 19188, 51956, 10996, 43764, 27380, 60148, 6900, 39668, + 23284, 56052, 15092, 47860, 31476, 64244, 1780, 34548, 18164, 50932, 9972, + 42740, 26356, 59124, 5876, 38644, 22260, 55028, 14068, 46836, 30452, 63220, + 3828, 36596, 20212, 52980, 12020, 44788, 28404, 61172, 7924, 40692, 24308, + 57076, 16116, 48884, 32500, 65268, 500, 33268, 16884, 49652, 8692, 41460, + 25076, 57844, 4596, 37364, 20980, 53748, 12788, 45556, 29172, 61940, 2548, + 35316, 18932, 51700, 10740, 43508, 27124, 59892, 6644, 39412, 23028, 55796, + 14836, 47604, 31220, 63988, 1524, 34292, 17908, 50676, 9716, 42484, 26100, + 58868, 5620, 38388, 22004, 54772, 13812, 46580, 30196, 62964, 3572, 36340, + 19956, 52724, 11764, 44532, 28148, 60916, 7668, 40436, 24052, 56820, 15860, + 48628, 32244, 65012, 1012, 33780, 17396, 50164, 9204, 41972, 25588, 58356, + 5108, 37876, 21492, 54260, 13300, 46068, 29684, 62452, 3060, 35828, 19444, + 52212, 11252, 44020, 27636, 60404, 7156, 39924, 23540, 56308, 15348, 48116, + 31732, 64500, 2036, 34804, 18420, 51188, 10228, 42996, 26612, 59380, 6132, + 38900, 22516, 55284, 14324, 47092, 30708, 63476, 4084, 36852, 20468, 53236, + 12276, 45044, 28660, 61428, 8180, 40948, 24564, 57332, 16372, 49140, 32756, + 65524, 12, 32780, 16396, 49164, 8204, 40972, 24588, 57356, 4108, 36876, + 20492, 53260, 12300, 45068, 28684, 61452, 2060, 34828, 18444, 51212, 10252, + 43020, 26636, 59404, 6156, 38924, 22540, 55308, 14348, 47116, 30732, 63500, + 1036, 33804, 17420, 50188, 9228, 41996, 25612, 58380, 5132, 37900, 21516, + 54284, 13324, 46092, 29708, 62476, 3084, 35852, 19468, 52236, 11276, 44044, + 27660, 60428, 7180, 39948, 23564, 56332, 15372, 48140, 31756, 64524, 524, + 33292, 16908, 49676, 8716, 41484, 25100, 57868, 4620, 37388, 21004, 53772, + 12812, 45580, 29196, 61964, 2572, 35340, 18956, 51724, 10764, 43532, 27148, + 59916, 6668, 39436, 23052, 55820, 14860, 47628, 31244, 64012, 1548, 34316, + 17932, 50700, 9740, 42508, 26124, 58892, 5644, 38412, 22028, 54796, 13836, + 46604, 30220, 62988, 3596, 36364, 19980, 52748, 11788, 44556, 28172, 60940, + 7692, 40460, 24076, 56844, 15884, 48652, 32268, 65036, 268, 33036, 16652, + 49420, 8460, 41228, 24844, 57612, 4364, 37132, 20748, 53516, 12556, 45324, + 28940, 61708, 2316, 35084, 18700, 51468, 10508, 43276, 26892, 59660, 6412, + 39180, 22796, 55564, 14604, 47372, 30988, 63756, 1292, 34060, 17676, 50444, + 9484, 42252, 25868, 58636, 5388, 38156, 21772, 54540, 13580, 46348, 29964, + 62732, 3340, 36108, 19724, 52492, 11532, 44300, 27916, 60684, 7436, 40204, + 23820, 56588, 15628, 48396, 32012, 64780, 780, 33548, 17164, 49932, 8972, + 41740, 25356, 58124, 4876, 37644, 21260, 54028, 13068, 45836, 29452, 62220, + 2828, 35596, 19212, 51980, 11020, 43788, 27404, 60172, 6924, 39692, 23308, + 56076, 15116, 47884, 31500, 64268, 1804, 34572, 18188, 50956, 9996, 42764, + 26380, 59148, 5900, 38668, 22284, 55052, 14092, 46860, 30476, 63244, 3852, + 36620, 20236, 53004, 12044, 44812, 28428, 61196, 7948, 40716, 24332, 57100, + 16140, 48908, 32524, 65292, 140, 32908, 16524, 49292, 8332, 41100, 24716, + 57484, 4236, 37004, 20620, 53388, 12428, 45196, 28812, 61580, 2188, 34956, + 18572, 51340, 10380, 43148, 26764, 59532, 6284, 39052, 22668, 55436, 14476, + 47244, 30860, 63628, 1164, 33932, 17548, 50316, 9356, 42124, 25740, 58508, + 5260, 38028, 21644, 54412, 13452, 46220, 29836, 62604, 3212, 35980, 19596, + 52364, 11404, 44172, 27788, 60556, 7308, 40076, 23692, 56460, 15500, 48268, + 31884, 64652, 652, 33420, 17036, 49804, 8844, 41612, 25228, 57996, 4748, + 37516, 21132, 53900, 12940, 45708, 29324, 62092, 2700, 35468, 19084, 51852, + 10892, 43660, 27276, 60044, 6796, 39564, 23180, 55948, 14988, 47756, 31372, + 64140, 1676, 34444, 18060, 50828, 9868, 42636, 26252, 59020, 5772, 38540, + 22156, 54924, 13964, 46732, 30348, 63116, 3724, 36492, 20108, 52876, 11916, + 44684, 28300, 61068, 7820, 40588, 24204, 56972, 16012, 48780, 32396, 65164, + 396, 33164, 16780, 49548, 8588, 41356, 24972, 57740, 4492, 37260, 20876, + 53644, 12684, 45452, 29068, 61836, 2444, 35212, 18828, 51596, 10636, 43404, + 27020, 59788, 6540, 39308, 22924, 55692, 14732, 47500, 31116, 63884, 1420, + 34188, 17804, 50572, 9612, 42380, 25996, 58764, 5516, 38284, 21900, 54668, + 13708, 46476, 30092, 62860, 3468, 36236, 19852, 52620, 11660, 44428, 28044, + 60812, 7564, 40332, 23948, 56716, 15756, 48524, 32140, 64908, 908, 33676, + 17292, 50060, 9100, 41868, 25484, 58252, 5004, 37772, 21388, 54156, 13196, + 45964, 29580, 62348, 2956, 35724, 19340, 52108, 11148, 43916, 27532, 60300, + 7052, 39820, 23436, 56204, 15244, 48012, 31628, 64396, 1932, 34700, 18316, + 51084, 10124, 42892, 26508, 59276, 6028, 38796, 22412, 55180, 14220, 46988, + 30604, 63372, 3980, 36748, 20364, 53132, 12172, 44940, 28556, 61324, 8076, + 40844, 24460, 57228, 16268, 49036, 32652, 65420, 76, 32844, 16460, 49228, + 8268, 41036, 24652, 57420, 4172, 36940, 20556, 53324, 12364, 45132, 28748, + 61516, 2124, 34892, 18508, 51276, 10316, 43084, 26700, 59468, 6220, 38988, + 22604, 55372, 14412, 47180, 30796, 63564, 1100, 33868, 17484, 50252, 9292, + 42060, 25676, 58444, 5196, 37964, 21580, 54348, 13388, 46156, 29772, 62540, + 3148, 35916, 19532, 52300, 11340, 44108, 27724, 60492, 7244, 40012, 23628, + 56396, 15436, 48204, 31820, 64588, 588, 33356, 16972, 49740, 8780, 41548, + 25164, 57932, 4684, 37452, 21068, 53836, 12876, 45644, 29260, 62028, 2636, + 35404, 19020, 51788, 10828, 43596, 27212, 59980, 6732, 39500, 23116, 55884, + 14924, 47692, 31308, 64076, 1612, 34380, 17996, 50764, 9804, 42572, 26188, + 58956, 5708, 38476, 22092, 54860, 13900, 46668, 30284, 63052, 3660, 36428, + 20044, 52812, 11852, 44620, 28236, 61004, 7756, 40524, 24140, 56908, 15948, + 48716, 32332, 65100, 332, 33100, 16716, 49484, 8524, 41292, 24908, 57676, + 4428, 37196, 20812, 53580, 12620, 45388, 29004, 61772, 2380, 35148, 18764, + 51532, 10572, 43340, 26956, 59724, 6476, 39244, 22860, 55628, 14668, 47436, + 31052, 63820, 1356, 34124, 17740, 50508, 9548, 42316, 25932, 58700, 5452, + 38220, 21836, 54604, 13644, 46412, 30028, 62796, 3404, 36172, 19788, 52556, + 11596, 44364, 27980, 60748, 7500, 40268, 23884, 56652, 15692, 48460, 32076, + 64844, 844, 33612, 17228, 49996, 9036, 41804, 25420, 58188, 4940, 37708, + 21324, 54092, 13132, 45900, 29516, 62284, 2892, 35660, 19276, 52044, 11084, + 43852, 27468, 60236, 6988, 39756, 23372, 56140, 15180, 47948, 31564, 64332, + 1868, 34636, 18252, 51020, 10060, 42828, 26444, 59212, 5964, 38732, 22348, + 55116, 14156, 46924, 30540, 63308, 3916, 36684, 20300, 53068, 12108, 44876, + 28492, 61260, 8012, 40780, 24396, 57164, 16204, 48972, 32588, 65356, 204, + 32972, 16588, 49356, 8396, 41164, 24780, 57548, 4300, 37068, 20684, 53452, + 12492, 45260, 28876, 61644, 2252, 35020, 18636, 51404, 10444, 43212, 26828, + 59596, 6348, 39116, 22732, 55500, 14540, 47308, 30924, 63692, 1228, 33996, + 17612, 50380, 9420, 42188, 25804, 58572, 5324, 38092, 21708, 54476, 13516, + 46284, 29900, 62668, 3276, 36044, 19660, 52428, 11468, 44236, 27852, 60620, + 7372, 40140, 23756, 56524, 15564, 48332, 31948, 64716, 716, 33484, 17100, + 49868, 8908, 41676, 25292, 58060, 4812, 37580, 21196, 53964, 13004, 45772, + 29388, 62156, 2764, 35532, 19148, 51916, 10956, 43724, 27340, 60108, 6860, + 39628, 23244, 56012, 15052, 47820, 31436, 64204, 1740, 34508, 18124, 50892, + 9932, 42700, 26316, 59084, 5836, 38604, 22220, 54988, 14028, 46796, 30412, + 63180, 3788, 36556, 20172, 52940, 11980, 44748, 28364, 61132, 7884, 40652, + 24268, 57036, 16076, 48844, 32460, 65228, 460, 33228, 16844, 49612, 8652, + 41420, 25036, 57804, 4556, 37324, 20940, 53708, 12748, 45516, 29132, 61900, + 2508, 35276, 18892, 51660, 10700, 43468, 27084, 59852, 6604, 39372, 22988, + 55756, 14796, 47564, 31180, 63948, 1484, 34252, 17868, 50636, 9676, 42444, + 26060, 58828, 5580, 38348, 21964, 54732, 13772, 46540, 30156, 62924, 3532, + 36300, 19916, 52684, 11724, 44492, 28108, 60876, 7628, 40396, 24012, 56780, + 15820, 48588, 32204, 64972, 972, 33740, 17356, 50124, 9164, 41932, 25548, + 58316, 5068, 37836, 21452, 54220, 13260, 46028, 29644, 62412, 3020, 35788, + 19404, 52172, 11212, 43980, 27596, 60364, 7116, 39884, 23500, 56268, 15308, + 48076, 31692, 64460, 1996, 34764, 18380, 51148, 10188, 42956, 26572, 59340, + 6092, 38860, 22476, 55244, 14284, 47052, 30668, 63436, 4044, 36812, 20428, + 53196, 12236, 45004, 28620, 61388, 8140, 40908, 24524, 57292, 16332, 49100, + 32716, 65484, 44, 32812, 16428, 49196, 8236, 41004, 24620, 57388, 4140, + 36908, 20524, 53292, 12332, 45100, 28716, 61484, 2092, 34860, 18476, 51244, + 10284, 43052, 26668, 59436, 6188, 38956, 22572, 55340, 14380, 47148, 30764, + 63532, 1068, 33836, 17452, 50220, 9260, 42028, 25644, 58412, 5164, 37932, + 21548, 54316, 13356, 46124, 29740, 62508, 3116, 35884, 19500, 52268, 11308, + 44076, 27692, 60460, 7212, 39980, 23596, 56364, 15404, 48172, 31788, 64556, + 556, 33324, 16940, 49708, 8748, 41516, 25132, 57900, 4652, 37420, 21036, + 53804, 12844, 45612, 29228, 61996, 2604, 35372, 18988, 51756, 10796, 43564, + 27180, 59948, 6700, 39468, 23084, 55852, 14892, 47660, 31276, 64044, 1580, + 34348, 17964, 50732, 9772, 42540, 26156, 58924, 5676, 38444, 22060, 54828, + 13868, 46636, 30252, 63020, 3628, 36396, 20012, 52780, 11820, 44588, 28204, + 60972, 7724, 40492, 24108, 56876, 15916, 48684, 32300, 65068, 300, 33068, + 16684, 49452, 8492, 41260, 24876, 57644, 4396, 37164, 20780, 53548, 12588, + 45356, 28972, 61740, 2348, 35116, 18732, 51500, 10540, 43308, 26924, 59692, + 6444, 39212, 22828, 55596, 14636, 47404, 31020, 63788, 1324, 34092, 17708, + 50476, 9516, 42284, 25900, 58668, 5420, 38188, 21804, 54572, 13612, 46380, + 29996, 62764, 3372, 36140, 19756, 52524, 11564, 44332, 27948, 60716, 7468, + 40236, 23852, 56620, 15660, 48428, 32044, 64812, 812, 33580, 17196, 49964, + 9004, 41772, 25388, 58156, 4908, 37676, 21292, 54060, 13100, 45868, 29484, + 62252, 2860, 35628, 19244, 52012, 11052, 43820, 27436, 60204, 6956, 39724, + 23340, 56108, 15148, 47916, 31532, 64300, 1836, 34604, 18220, 50988, 10028, + 42796, 26412, 59180, 5932, 38700, 22316, 55084, 14124, 46892, 30508, 63276, + 3884, 36652, 20268, 53036, 12076, 44844, 28460, 61228, 7980, 40748, 24364, + 57132, 16172, 48940, 32556, 65324, 172, 32940, 16556, 49324, 8364, 41132, + 24748, 57516, 4268, 37036, 20652, 53420, 12460, 45228, 28844, 61612, 2220, + 34988, 18604, 51372, 10412, 43180, 26796, 59564, 6316, 39084, 22700, 55468, + 14508, 47276, 30892, 63660, 1196, 33964, 17580, 50348, 9388, 42156, 25772, + 58540, 5292, 38060, 21676, 54444, 13484, 46252, 29868, 62636, 3244, 36012, + 19628, 52396, 11436, 44204, 27820, 60588, 7340, 40108, 23724, 56492, 15532, + 48300, 31916, 64684, 684, 33452, 17068, 49836, 8876, 41644, 25260, 58028, + 4780, 37548, 21164, 53932, 12972, 45740, 29356, 62124, 2732, 35500, 19116, + 51884, 10924, 43692, 27308, 60076, 6828, 39596, 23212, 55980, 15020, 47788, + 31404, 64172, 1708, 34476, 18092, 50860, 9900, 42668, 26284, 59052, 5804, + 38572, 22188, 54956, 13996, 46764, 30380, 63148, 3756, 36524, 20140, 52908, + 11948, 44716, 28332, 61100, 7852, 40620, 24236, 57004, 16044, 48812, 32428, + 65196, 428, 33196, 16812, 49580, 8620, 41388, 25004, 57772, 4524, 37292, + 20908, 53676, 12716, 45484, 29100, 61868, 2476, 35244, 18860, 51628, 10668, + 43436, 27052, 59820, 6572, 39340, 22956, 55724, 14764, 47532, 31148, 63916, + 1452, 34220, 17836, 50604, 9644, 42412, 26028, 58796, 5548, 38316, 21932, + 54700, 13740, 46508, 30124, 62892, 3500, 36268, 19884, 52652, 11692, 44460, + 28076, 60844, 7596, 40364, 23980, 56748, 15788, 48556, 32172, 64940, 940, + 33708, 17324, 50092, 9132, 41900, 25516, 58284, 5036, 37804, 21420, 54188, + 13228, 45996, 29612, 62380, 2988, 35756, 19372, 52140, 11180, 43948, 27564, + 60332, 7084, 39852, 23468, 56236, 15276, 48044, 31660, 64428, 1964, 34732, + 18348, 51116, 10156, 42924, 26540, 59308, 6060, 38828, 22444, 55212, 14252, + 47020, 30636, 63404, 4012, 36780, 20396, 53164, 12204, 44972, 28588, 61356, + 8108, 40876, 24492, 57260, 16300, 49068, 32684, 65452, 108, 32876, 16492, + 49260, 8300, 41068, 24684, 57452, 4204, 36972, 20588, 53356, 12396, 45164, + 28780, 61548, 2156, 34924, 18540, 51308, 10348, 43116, 26732, 59500, 6252, + 39020, 22636, 55404, 14444, 47212, 30828, 63596, 1132, 33900, 17516, 50284, + 9324, 42092, 25708, 58476, 5228, 37996, 21612, 54380, 13420, 46188, 29804, + 62572, 3180, 35948, 19564, 52332, 11372, 44140, 27756, 60524, 7276, 40044, + 23660, 56428, 15468, 48236, 31852, 64620, 620, 33388, 17004, 49772, 8812, + 41580, 25196, 57964, 4716, 37484, 21100, 53868, 12908, 45676, 29292, 62060, + 2668, 35436, 19052, 51820, 10860, 43628, 27244, 60012, 6764, 39532, 23148, + 55916, 14956, 47724, 31340, 64108, 1644, 34412, 18028, 50796, 9836, 42604, + 26220, 58988, 5740, 38508, 22124, 54892, 13932, 46700, 30316, 63084, 3692, + 36460, 20076, 52844, 11884, 44652, 28268, 61036, 7788, 40556, 24172, 56940, + 15980, 48748, 32364, 65132, 364, 33132, 16748, 49516, 8556, 41324, 24940, + 57708, 4460, 37228, 20844, 53612, 12652, 45420, 29036, 61804, 2412, 35180, + 18796, 51564, 10604, 43372, 26988, 59756, 6508, 39276, 22892, 55660, 14700, + 47468, 31084, 63852, 1388, 34156, 17772, 50540, 9580, 42348, 25964, 58732, + 5484, 38252, 21868, 54636, 13676, 46444, 30060, 62828, 3436, 36204, 19820, + 52588, 11628, 44396, 28012, 60780, 7532, 40300, 23916, 56684, 15724, 48492, + 32108, 64876, 876, 33644, 17260, 50028, 9068, 41836, 25452, 58220, 4972, + 37740, 21356, 54124, 13164, 45932, 29548, 62316, 2924, 35692, 19308, 52076, + 11116, 43884, 27500, 60268, 7020, 39788, 23404, 56172, 15212, 47980, 31596, + 64364, 1900, 34668, 18284, 51052, 10092, 42860, 26476, 59244, 5996, 38764, + 22380, 55148, 14188, 46956, 30572, 63340, 3948, 36716, 20332, 53100, 12140, + 44908, 28524, 61292, 8044, 40812, 24428, 57196, 16236, 49004, 32620, 65388, + 236, 33004, 16620, 49388, 8428, 41196, 24812, 57580, 4332, 37100, 20716, + 53484, 12524, 45292, 28908, 61676, 2284, 35052, 18668, 51436, 10476, 43244, + 26860, 59628, 6380, 39148, 22764, 55532, 14572, 47340, 30956, 63724, 1260, + 34028, 17644, 50412, 9452, 42220, 25836, 58604, 5356, 38124, 21740, 54508, + 13548, 46316, 29932, 62700, 3308, 36076, 19692, 52460, 11500, 44268, 27884, + 60652, 7404, 40172, 23788, 56556, 15596, 48364, 31980, 64748, 748, 33516, + 17132, 49900, 8940, 41708, 25324, 58092, 4844, 37612, 21228, 53996, 13036, + 45804, 29420, 62188, 2796, 35564, 19180, 51948, 10988, 43756, 27372, 60140, + 6892, 39660, 23276, 56044, 15084, 47852, 31468, 64236, 1772, 34540, 18156, + 50924, 9964, 42732, 26348, 59116, 5868, 38636, 22252, 55020, 14060, 46828, + 30444, 63212, 3820, 36588, 20204, 52972, 12012, 44780, 28396, 61164, 7916, + 40684, 24300, 57068, 16108, 48876, 32492, 65260, 492, 33260, 16876, 49644, + 8684, 41452, 25068, 57836, 4588, 37356, 20972, 53740, 12780, 45548, 29164, + 61932, 2540, 35308, 18924, 51692, 10732, 43500, 27116, 59884, 6636, 39404, + 23020, 55788, 14828, 47596, 31212, 63980, 1516, 34284, 17900, 50668, 9708, + 42476, 26092, 58860, 5612, 38380, 21996, 54764, 13804, 46572, 30188, 62956, + 3564, 36332, 19948, 52716, 11756, 44524, 28140, 60908, 7660, 40428, 24044, + 56812, 15852, 48620, 32236, 65004, 1004, 33772, 17388, 50156, 9196, 41964, + 25580, 58348, 5100, 37868, 21484, 54252, 13292, 46060, 29676, 62444, 3052, + 35820, 19436, 52204, 11244, 44012, 27628, 60396, 7148, 39916, 23532, 56300, + 15340, 48108, 31724, 64492, 2028, 34796, 18412, 51180, 10220, 42988, 26604, + 59372, 6124, 38892, 22508, 55276, 14316, 47084, 30700, 63468, 4076, 36844, + 20460, 53228, 12268, 45036, 28652, 61420, 8172, 40940, 24556, 57324, 16364, + 49132, 32748, 65516, 28, 32796, 16412, 49180, 8220, 40988, 24604, 57372, + 4124, 36892, 20508, 53276, 12316, 45084, 28700, 61468, 2076, 34844, 18460, + 51228, 10268, 43036, 26652, 59420, 6172, 38940, 22556, 55324, 14364, 47132, + 30748, 63516, 1052, 33820, 17436, 50204, 9244, 42012, 25628, 58396, 5148, + 37916, 21532, 54300, 13340, 46108, 29724, 62492, 3100, 35868, 19484, 52252, + 11292, 44060, 27676, 60444, 7196, 39964, 23580, 56348, 15388, 48156, 31772, + 64540, 540, 33308, 16924, 49692, 8732, 41500, 25116, 57884, 4636, 37404, + 21020, 53788, 12828, 45596, 29212, 61980, 2588, 35356, 18972, 51740, 10780, + 43548, 27164, 59932, 6684, 39452, 23068, 55836, 14876, 47644, 31260, 64028, + 1564, 34332, 17948, 50716, 9756, 42524, 26140, 58908, 5660, 38428, 22044, + 54812, 13852, 46620, 30236, 63004, 3612, 36380, 19996, 52764, 11804, 44572, + 28188, 60956, 7708, 40476, 24092, 56860, 15900, 48668, 32284, 65052, 284, + 33052, 16668, 49436, 8476, 41244, 24860, 57628, 4380, 37148, 20764, 53532, + 12572, 45340, 28956, 61724, 2332, 35100, 18716, 51484, 10524, 43292, 26908, + 59676, 6428, 39196, 22812, 55580, 14620, 47388, 31004, 63772, 1308, 34076, + 17692, 50460, 9500, 42268, 25884, 58652, 5404, 38172, 21788, 54556, 13596, + 46364, 29980, 62748, 3356, 36124, 19740, 52508, 11548, 44316, 27932, 60700, + 7452, 40220, 23836, 56604, 15644, 48412, 32028, 64796, 796, 33564, 17180, + 49948, 8988, 41756, 25372, 58140, 4892, 37660, 21276, 54044, 13084, 45852, + 29468, 62236, 2844, 35612, 19228, 51996, 11036, 43804, 27420, 60188, 6940, + 39708, 23324, 56092, 15132, 47900, 31516, 64284, 1820, 34588, 18204, 50972, + 10012, 42780, 26396, 59164, 5916, 38684, 22300, 55068, 14108, 46876, 30492, + 63260, 3868, 36636, 20252, 53020, 12060, 44828, 28444, 61212, 7964, 40732, + 24348, 57116, 16156, 48924, 32540, 65308, 156, 32924, 16540, 49308, 8348, + 41116, 24732, 57500, 4252, 37020, 20636, 53404, 12444, 45212, 28828, 61596, + 2204, 34972, 18588, 51356, 10396, 43164, 26780, 59548, 6300, 39068, 22684, + 55452, 14492, 47260, 30876, 63644, 1180, 33948, 17564, 50332, 9372, 42140, + 25756, 58524, 5276, 38044, 21660, 54428, 13468, 46236, 29852, 62620, 3228, + 35996, 19612, 52380, 11420, 44188, 27804, 60572, 7324, 40092, 23708, 56476, + 15516, 48284, 31900, 64668, 668, 33436, 17052, 49820, 8860, 41628, 25244, + 58012, 4764, 37532, 21148, 53916, 12956, 45724, 29340, 62108, 2716, 35484, + 19100, 51868, 10908, 43676, 27292, 60060, 6812, 39580, 23196, 55964, 15004, + 47772, 31388, 64156, 1692, 34460, 18076, 50844, 9884, 42652, 26268, 59036, + 5788, 38556, 22172, 54940, 13980, 46748, 30364, 63132, 3740, 36508, 20124, + 52892, 11932, 44700, 28316, 61084, 7836, 40604, 24220, 56988, 16028, 48796, + 32412, 65180, 412, 33180, 16796, 49564, 8604, 41372, 24988, 57756, 4508, + 37276, 20892, 53660, 12700, 45468, 29084, 61852, 2460, 35228, 18844, 51612, + 10652, 43420, 27036, 59804, 6556, 39324, 22940, 55708, 14748, 47516, 31132, + 63900, 1436, 34204, 17820, 50588, 9628, 42396, 26012, 58780, 5532, 38300, + 21916, 54684, 13724, 46492, 30108, 62876, 3484, 36252, 19868, 52636, 11676, + 44444, 28060, 60828, 7580, 40348, 23964, 56732, 15772, 48540, 32156, 64924, + 924, 33692, 17308, 50076, 9116, 41884, 25500, 58268, 5020, 37788, 21404, + 54172, 13212, 45980, 29596, 62364, 2972, 35740, 19356, 52124, 11164, 43932, + 27548, 60316, 7068, 39836, 23452, 56220, 15260, 48028, 31644, 64412, 1948, + 34716, 18332, 51100, 10140, 42908, 26524, 59292, 6044, 38812, 22428, 55196, + 14236, 47004, 30620, 63388, 3996, 36764, 20380, 53148, 12188, 44956, 28572, + 61340, 8092, 40860, 24476, 57244, 16284, 49052, 32668, 65436, 92, 32860, + 16476, 49244, 8284, 41052, 24668, 57436, 4188, 36956, 20572, 53340, 12380, + 45148, 28764, 61532, 2140, 34908, 18524, 51292, 10332, 43100, 26716, 59484, + 6236, 39004, 22620, 55388, 14428, 47196, 30812, 63580, 1116, 33884, 17500, + 50268, 9308, 42076, 25692, 58460, 5212, 37980, 21596, 54364, 13404, 46172, + 29788, 62556, 3164, 35932, 19548, 52316, 11356, 44124, 27740, 60508, 7260, + 40028, 23644, 56412, 15452, 48220, 31836, 64604, 604, 33372, 16988, 49756, + 8796, 41564, 25180, 57948, 4700, 37468, 21084, 53852, 12892, 45660, 29276, + 62044, 2652, 35420, 19036, 51804, 10844, 43612, 27228, 59996, 6748, 39516, + 23132, 55900, 14940, 47708, 31324, 64092, 1628, 34396, 18012, 50780, 9820, + 42588, 26204, 58972, 5724, 38492, 22108, 54876, 13916, 46684, 30300, 63068, + 3676, 36444, 20060, 52828, 11868, 44636, 28252, 61020, 7772, 40540, 24156, + 56924, 15964, 48732, 32348, 65116, 348, 33116, 16732, 49500, 8540, 41308, + 24924, 57692, 4444, 37212, 20828, 53596, 12636, 45404, 29020, 61788, 2396, + 35164, 18780, 51548, 10588, 43356, 26972, 59740, 6492, 39260, 22876, 55644, + 14684, 47452, 31068, 63836, 1372, 34140, 17756, 50524, 9564, 42332, 25948, + 58716, 5468, 38236, 21852, 54620, 13660, 46428, 30044, 62812, 3420, 36188, + 19804, 52572, 11612, 44380, 27996, 60764, 7516, 40284, 23900, 56668, 15708, + 48476, 32092, 64860, 860, 33628, 17244, 50012, 9052, 41820, 25436, 58204, + 4956, 37724, 21340, 54108, 13148, 45916, 29532, 62300, 2908, 35676, 19292, + 52060, 11100, 43868, 27484, 60252, 7004, 39772, 23388, 56156, 15196, 47964, + 31580, 64348, 1884, 34652, 18268, 51036, 10076, 42844, 26460, 59228, 5980, + 38748, 22364, 55132, 14172, 46940, 30556, 63324, 3932, 36700, 20316, 53084, + 12124, 44892, 28508, 61276, 8028, 40796, 24412, 57180, 16220, 48988, 32604, + 65372, 220, 32988, 16604, 49372, 8412, 41180, 24796, 57564, 4316, 37084, + 20700, 53468, 12508, 45276, 28892, 61660, 2268, 35036, 18652, 51420, 10460, + 43228, 26844, 59612, 6364, 39132, 22748, 55516, 14556, 47324, 30940, 63708, + 1244, 34012, 17628, 50396, 9436, 42204, 25820, 58588, 5340, 38108, 21724, + 54492, 13532, 46300, 29916, 62684, 3292, 36060, 19676, 52444, 11484, 44252, + 27868, 60636, 7388, 40156, 23772, 56540, 15580, 48348, 31964, 64732, 732, + 33500, 17116, 49884, 8924, 41692, 25308, 58076, 4828, 37596, 21212, 53980, + 13020, 45788, 29404, 62172, 2780, 35548, 19164, 51932, 10972, 43740, 27356, + 60124, 6876, 39644, 23260, 56028, 15068, 47836, 31452, 64220, 1756, 34524, + 18140, 50908, 9948, 42716, 26332, 59100, 5852, 38620, 22236, 55004, 14044, + 46812, 30428, 63196, 3804, 36572, 20188, 52956, 11996, 44764, 28380, 61148, + 7900, 40668, 24284, 57052, 16092, 48860, 32476, 65244, 476, 33244, 16860, + 49628, 8668, 41436, 25052, 57820, 4572, 37340, 20956, 53724, 12764, 45532, + 29148, 61916, 2524, 35292, 18908, 51676, 10716, 43484, 27100, 59868, 6620, + 39388, 23004, 55772, 14812, 47580, 31196, 63964, 1500, 34268, 17884, 50652, + 9692, 42460, 26076, 58844, 5596, 38364, 21980, 54748, 13788, 46556, 30172, + 62940, 3548, 36316, 19932, 52700, 11740, 44508, 28124, 60892, 7644, 40412, + 24028, 56796, 15836, 48604, 32220, 64988, 988, 33756, 17372, 50140, 9180, + 41948, 25564, 58332, 5084, 37852, 21468, 54236, 13276, 46044, 29660, 62428, + 3036, 35804, 19420, 52188, 11228, 43996, 27612, 60380, 7132, 39900, 23516, + 56284, 15324, 48092, 31708, 64476, 2012, 34780, 18396, 51164, 10204, 42972, + 26588, 59356, 6108, 38876, 22492, 55260, 14300, 47068, 30684, 63452, 4060, + 36828, 20444, 53212, 12252, 45020, 28636, 61404, 8156, 40924, 24540, 57308, + 16348, 49116, 32732, 65500, 60, 32828, 16444, 49212, 8252, 41020, 24636, + 57404, 4156, 36924, 20540, 53308, 12348, 45116, 28732, 61500, 2108, 34876, + 18492, 51260, 10300, 43068, 26684, 59452, 6204, 38972, 22588, 55356, 14396, + 47164, 30780, 63548, 1084, 33852, 17468, 50236, 9276, 42044, 25660, 58428, + 5180, 37948, 21564, 54332, 13372, 46140, 29756, 62524, 3132, 35900, 19516, + 52284, 11324, 44092, 27708, 60476, 7228, 39996, 23612, 56380, 15420, 48188, + 31804, 64572, 572, 33340, 16956, 49724, 8764, 41532, 25148, 57916, 4668, + 37436, 21052, 53820, 12860, 45628, 29244, 62012, 2620, 35388, 19004, 51772, + 10812, 43580, 27196, 59964, 6716, 39484, 23100, 55868, 14908, 47676, 31292, + 64060, 1596, 34364, 17980, 50748, 9788, 42556, 26172, 58940, 5692, 38460, + 22076, 54844, 13884, 46652, 30268, 63036, 3644, 36412, 20028, 52796, 11836, + 44604, 28220, 60988, 7740, 40508, 24124, 56892, 15932, 48700, 32316, 65084, + 316, 33084, 16700, 49468, 8508, 41276, 24892, 57660, 4412, 37180, 20796, + 53564, 12604, 45372, 28988, 61756, 2364, 35132, 18748, 51516, 10556, 43324, + 26940, 59708, 6460, 39228, 22844, 55612, 14652, 47420, 31036, 63804, 1340, + 34108, 17724, 50492, 9532, 42300, 25916, 58684, 5436, 38204, 21820, 54588, + 13628, 46396, 30012, 62780, 3388, 36156, 19772, 52540, 11580, 44348, 27964, + 60732, 7484, 40252, 23868, 56636, 15676, 48444, 32060, 64828, 828, 33596, + 17212, 49980, 9020, 41788, 25404, 58172, 4924, 37692, 21308, 54076, 13116, + 45884, 29500, 62268, 2876, 35644, 19260, 52028, 11068, 43836, 27452, 60220, + 6972, 39740, 23356, 56124, 15164, 47932, 31548, 64316, 1852, 34620, 18236, + 51004, 10044, 42812, 26428, 59196, 5948, 38716, 22332, 55100, 14140, 46908, + 30524, 63292, 3900, 36668, 20284, 53052, 12092, 44860, 28476, 61244, 7996, + 40764, 24380, 57148, 16188, 48956, 32572, 65340, 188, 32956, 16572, 49340, + 8380, 41148, 24764, 57532, 4284, 37052, 20668, 53436, 12476, 45244, 28860, + 61628, 2236, 35004, 18620, 51388, 10428, 43196, 26812, 59580, 6332, 39100, + 22716, 55484, 14524, 47292, 30908, 63676, 1212, 33980, 17596, 50364, 9404, + 42172, 25788, 58556, 5308, 38076, 21692, 54460, 13500, 46268, 29884, 62652, + 3260, 36028, 19644, 52412, 11452, 44220, 27836, 60604, 7356, 40124, 23740, + 56508, 15548, 48316, 31932, 64700, 700, 33468, 17084, 49852, 8892, 41660, + 25276, 58044, 4796, 37564, 21180, 53948, 12988, 45756, 29372, 62140, 2748, + 35516, 19132, 51900, 10940, 43708, 27324, 60092, 6844, 39612, 23228, 55996, + 15036, 47804, 31420, 64188, 1724, 34492, 18108, 50876, 9916, 42684, 26300, + 59068, 5820, 38588, 22204, 54972, 14012, 46780, 30396, 63164, 3772, 36540, + 20156, 52924, 11964, 44732, 28348, 61116, 7868, 40636, 24252, 57020, 16060, + 48828, 32444, 65212, 444, 33212, 16828, 49596, 8636, 41404, 25020, 57788, + 4540, 37308, 20924, 53692, 12732, 45500, 29116, 61884, 2492, 35260, 18876, + 51644, 10684, 43452, 27068, 59836, 6588, 39356, 22972, 55740, 14780, 47548, + 31164, 63932, 1468, 34236, 17852, 50620, 9660, 42428, 26044, 58812, 5564, + 38332, 21948, 54716, 13756, 46524, 30140, 62908, 3516, 36284, 19900, 52668, + 11708, 44476, 28092, 60860, 7612, 40380, 23996, 56764, 15804, 48572, 32188, + 64956, 956, 33724, 17340, 50108, 9148, 41916, 25532, 58300, 5052, 37820, + 21436, 54204, 13244, 46012, 29628, 62396, 3004, 35772, 19388, 52156, 11196, + 43964, 27580, 60348, 7100, 39868, 23484, 56252, 15292, 48060, 31676, 64444, + 1980, 34748, 18364, 51132, 10172, 42940, 26556, 59324, 6076, 38844, 22460, + 55228, 14268, 47036, 30652, 63420, 4028, 36796, 20412, 53180, 12220, 44988, + 28604, 61372, 8124, 40892, 24508, 57276, 16316, 49084, 32700, 65468, 124, + 32892, 16508, 49276, 8316, 41084, 24700, 57468, 4220, 36988, 20604, 53372, + 12412, 45180, 28796, 61564, 2172, 34940, 18556, 51324, 10364, 43132, 26748, + 59516, 6268, 39036, 22652, 55420, 14460, 47228, 30844, 63612, 1148, 33916, + 17532, 50300, 9340, 42108, 25724, 58492, 5244, 38012, 21628, 54396, 13436, + 46204, 29820, 62588, 3196, 35964, 19580, 52348, 11388, 44156, 27772, 60540, + 7292, 40060, 23676, 56444, 15484, 48252, 31868, 64636, 636, 33404, 17020, + 49788, 8828, 41596, 25212, 57980, 4732, 37500, 21116, 53884, 12924, 45692, + 29308, 62076, 2684, 35452, 19068, 51836, 10876, 43644, 27260, 60028, 6780, + 39548, 23164, 55932, 14972, 47740, 31356, 64124, 1660, 34428, 18044, 50812, + 9852, 42620, 26236, 59004, 5756, 38524, 22140, 54908, 13948, 46716, 30332, + 63100, 3708, 36476, 20092, 52860, 11900, 44668, 28284, 61052, 7804, 40572, + 24188, 56956, 15996, 48764, 32380, 65148, 380, 33148, 16764, 49532, 8572, + 41340, 24956, 57724, 4476, 37244, 20860, 53628, 12668, 45436, 29052, 61820, + 2428, 35196, 18812, 51580, 10620, 43388, 27004, 59772, 6524, 39292, 22908, + 55676, 14716, 47484, 31100, 63868, 1404, 34172, 17788, 50556, 9596, 42364, + 25980, 58748, 5500, 38268, 21884, 54652, 13692, 46460, 30076, 62844, 3452, + 36220, 19836, 52604, 11644, 44412, 28028, 60796, 7548, 40316, 23932, 56700, + 15740, 48508, 32124, 64892, 892, 33660, 17276, 50044, 9084, 41852, 25468, + 58236, 4988, 37756, 21372, 54140, 13180, 45948, 29564, 62332, 2940, 35708, + 19324, 52092, 11132, 43900, 27516, 60284, 7036, 39804, 23420, 56188, 15228, + 47996, 31612, 64380, 1916, 34684, 18300, 51068, 10108, 42876, 26492, 59260, + 6012, 38780, 22396, 55164, 14204, 46972, 30588, 63356, 3964, 36732, 20348, + 53116, 12156, 44924, 28540, 61308, 8060, 40828, 24444, 57212, 16252, 49020, + 32636, 65404, 252, 33020, 16636, 49404, 8444, 41212, 24828, 57596, 4348, + 37116, 20732, 53500, 12540, 45308, 28924, 61692, 2300, 35068, 18684, 51452, + 10492, 43260, 26876, 59644, 6396, 39164, 22780, 55548, 14588, 47356, 30972, + 63740, 1276, 34044, 17660, 50428, 9468, 42236, 25852, 58620, 5372, 38140, + 21756, 54524, 13564, 46332, 29948, 62716, 3324, 36092, 19708, 52476, 11516, + 44284, 27900, 60668, 7420, 40188, 23804, 56572, 15612, 48380, 31996, 64764, + 764, 33532, 17148, 49916, 8956, 41724, 25340, 58108, 4860, 37628, 21244, + 54012, 13052, 45820, 29436, 62204, 2812, 35580, 19196, 51964, 11004, 43772, + 27388, 60156, 6908, 39676, 23292, 56060, 15100, 47868, 31484, 64252, 1788, + 34556, 18172, 50940, 9980, 42748, 26364, 59132, 5884, 38652, 22268, 55036, + 14076, 46844, 30460, 63228, 3836, 36604, 20220, 52988, 12028, 44796, 28412, + 61180, 7932, 40700, 24316, 57084, 16124, 48892, 32508, 65276, 508, 33276, + 16892, 49660, 8700, 41468, 25084, 57852, 4604, 37372, 20988, 53756, 12796, + 45564, 29180, 61948, 2556, 35324, 18940, 51708, 10748, 43516, 27132, 59900, + 6652, 39420, 23036, 55804, 14844, 47612, 31228, 63996, 1532, 34300, 17916, + 50684, 9724, 42492, 26108, 58876, 5628, 38396, 22012, 54780, 13820, 46588, + 30204, 62972, 3580, 36348, 19964, 52732, 11772, 44540, 28156, 60924, 7676, + 40444, 24060, 56828, 15868, 48636, 32252, 65020, 1020, 33788, 17404, 50172, + 9212, 41980, 25596, 58364, 5116, 37884, 21500, 54268, 13308, 46076, 29692, + 62460, 3068, 35836, 19452, 52220, 11260, 44028, 27644, 60412, 7164, 39932, + 23548, 56316, 15356, 48124, 31740, 64508, 2044, 34812, 18428, 51196, 10236, + 43004, 26620, 59388, 6140, 38908, 22524, 55292, 14332, 47100, 30716, 63484, + 4092, 36860, 20476, 53244, 12284, 45052, 28668, 61436, 8188, 40956, 24572, + 57340, 16380, 49148, 32764, 65532, 2, 32770, 16386, 49154, 8194, 40962, + 24578, 57346, 4098, 36866, 20482, 53250, 12290, 45058, 28674, 61442, 2050, + 34818, 18434, 51202, 10242, 43010, 26626, 59394, 6146, 38914, 22530, 55298, + 14338, 47106, 30722, 63490, 1026, 33794, 17410, 50178, 9218, 41986, 25602, + 58370, 5122, 37890, 21506, 54274, 13314, 46082, 29698, 62466, 3074, 35842, + 19458, 52226, 11266, 44034, 27650, 60418, 7170, 39938, 23554, 56322, 15362, + 48130, 31746, 64514, 514, 33282, 16898, 49666, 8706, 41474, 25090, 57858, + 4610, 37378, 20994, 53762, 12802, 45570, 29186, 61954, 2562, 35330, 18946, + 51714, 10754, 43522, 27138, 59906, 6658, 39426, 23042, 55810, 14850, 47618, + 31234, 64002, 1538, 34306, 17922, 50690, 9730, 42498, 26114, 58882, 5634, + 38402, 22018, 54786, 13826, 46594, 30210, 62978, 3586, 36354, 19970, 52738, + 11778, 44546, 28162, 60930, 7682, 40450, 24066, 56834, 15874, 48642, 32258, + 65026, 258, 33026, 16642, 49410, 8450, 41218, 24834, 57602, 4354, 37122, + 20738, 53506, 12546, 45314, 28930, 61698, 2306, 35074, 18690, 51458, 10498, + 43266, 26882, 59650, 6402, 39170, 22786, 55554, 14594, 47362, 30978, 63746, + 1282, 34050, 17666, 50434, 9474, 42242, 25858, 58626, 5378, 38146, 21762, + 54530, 13570, 46338, 29954, 62722, 3330, 36098, 19714, 52482, 11522, 44290, + 27906, 60674, 7426, 40194, 23810, 56578, 15618, 48386, 32002, 64770, 770, + 33538, 17154, 49922, 8962, 41730, 25346, 58114, 4866, 37634, 21250, 54018, + 13058, 45826, 29442, 62210, 2818, 35586, 19202, 51970, 11010, 43778, 27394, + 60162, 6914, 39682, 23298, 56066, 15106, 47874, 31490, 64258, 1794, 34562, + 18178, 50946, 9986, 42754, 26370, 59138, 5890, 38658, 22274, 55042, 14082, + 46850, 30466, 63234, 3842, 36610, 20226, 52994, 12034, 44802, 28418, 61186, + 7938, 40706, 24322, 57090, 16130, 48898, 32514, 65282, 130, 32898, 16514, + 49282, 8322, 41090, 24706, 57474, 4226, 36994, 20610, 53378, 12418, 45186, + 28802, 61570, 2178, 34946, 18562, 51330, 10370, 43138, 26754, 59522, 6274, + 39042, 22658, 55426, 14466, 47234, 30850, 63618, 1154, 33922, 17538, 50306, + 9346, 42114, 25730, 58498, 5250, 38018, 21634, 54402, 13442, 46210, 29826, + 62594, 3202, 35970, 19586, 52354, 11394, 44162, 27778, 60546, 7298, 40066, + 23682, 56450, 15490, 48258, 31874, 64642, 642, 33410, 17026, 49794, 8834, + 41602, 25218, 57986, 4738, 37506, 21122, 53890, 12930, 45698, 29314, 62082, + 2690, 35458, 19074, 51842, 10882, 43650, 27266, 60034, 6786, 39554, 23170, + 55938, 14978, 47746, 31362, 64130, 1666, 34434, 18050, 50818, 9858, 42626, + 26242, 59010, 5762, 38530, 22146, 54914, 13954, 46722, 30338, 63106, 3714, + 36482, 20098, 52866, 11906, 44674, 28290, 61058, 7810, 40578, 24194, 56962, + 16002, 48770, 32386, 65154, 386, 33154, 16770, 49538, 8578, 41346, 24962, + 57730, 4482, 37250, 20866, 53634, 12674, 45442, 29058, 61826, 2434, 35202, + 18818, 51586, 10626, 43394, 27010, 59778, 6530, 39298, 22914, 55682, 14722, + 47490, 31106, 63874, 1410, 34178, 17794, 50562, 9602, 42370, 25986, 58754, + 5506, 38274, 21890, 54658, 13698, 46466, 30082, 62850, 3458, 36226, 19842, + 52610, 11650, 44418, 28034, 60802, 7554, 40322, 23938, 56706, 15746, 48514, + 32130, 64898, 898, 33666, 17282, 50050, 9090, 41858, 25474, 58242, 4994, + 37762, 21378, 54146, 13186, 45954, 29570, 62338, 2946, 35714, 19330, 52098, + 11138, 43906, 27522, 60290, 7042, 39810, 23426, 56194, 15234, 48002, 31618, + 64386, 1922, 34690, 18306, 51074, 10114, 42882, 26498, 59266, 6018, 38786, + 22402, 55170, 14210, 46978, 30594, 63362, 3970, 36738, 20354, 53122, 12162, + 44930, 28546, 61314, 8066, 40834, 24450, 57218, 16258, 49026, 32642, 65410, + 66, 32834, 16450, 49218, 8258, 41026, 24642, 57410, 4162, 36930, 20546, + 53314, 12354, 45122, 28738, 61506, 2114, 34882, 18498, 51266, 10306, 43074, + 26690, 59458, 6210, 38978, 22594, 55362, 14402, 47170, 30786, 63554, 1090, + 33858, 17474, 50242, 9282, 42050, 25666, 58434, 5186, 37954, 21570, 54338, + 13378, 46146, 29762, 62530, 3138, 35906, 19522, 52290, 11330, 44098, 27714, + 60482, 7234, 40002, 23618, 56386, 15426, 48194, 31810, 64578, 578, 33346, + 16962, 49730, 8770, 41538, 25154, 57922, 4674, 37442, 21058, 53826, 12866, + 45634, 29250, 62018, 2626, 35394, 19010, 51778, 10818, 43586, 27202, 59970, + 6722, 39490, 23106, 55874, 14914, 47682, 31298, 64066, 1602, 34370, 17986, + 50754, 9794, 42562, 26178, 58946, 5698, 38466, 22082, 54850, 13890, 46658, + 30274, 63042, 3650, 36418, 20034, 52802, 11842, 44610, 28226, 60994, 7746, + 40514, 24130, 56898, 15938, 48706, 32322, 65090, 322, 33090, 16706, 49474, + 8514, 41282, 24898, 57666, 4418, 37186, 20802, 53570, 12610, 45378, 28994, + 61762, 2370, 35138, 18754, 51522, 10562, 43330, 26946, 59714, 6466, 39234, + 22850, 55618, 14658, 47426, 31042, 63810, 1346, 34114, 17730, 50498, 9538, + 42306, 25922, 58690, 5442, 38210, 21826, 54594, 13634, 46402, 30018, 62786, + 3394, 36162, 19778, 52546, 11586, 44354, 27970, 60738, 7490, 40258, 23874, + 56642, 15682, 48450, 32066, 64834, 834, 33602, 17218, 49986, 9026, 41794, + 25410, 58178, 4930, 37698, 21314, 54082, 13122, 45890, 29506, 62274, 2882, + 35650, 19266, 52034, 11074, 43842, 27458, 60226, 6978, 39746, 23362, 56130, + 15170, 47938, 31554, 64322, 1858, 34626, 18242, 51010, 10050, 42818, 26434, + 59202, 5954, 38722, 22338, 55106, 14146, 46914, 30530, 63298, 3906, 36674, + 20290, 53058, 12098, 44866, 28482, 61250, 8002, 40770, 24386, 57154, 16194, + 48962, 32578, 65346, 194, 32962, 16578, 49346, 8386, 41154, 24770, 57538, + 4290, 37058, 20674, 53442, 12482, 45250, 28866, 61634, 2242, 35010, 18626, + 51394, 10434, 43202, 26818, 59586, 6338, 39106, 22722, 55490, 14530, 47298, + 30914, 63682, 1218, 33986, 17602, 50370, 9410, 42178, 25794, 58562, 5314, + 38082, 21698, 54466, 13506, 46274, 29890, 62658, 3266, 36034, 19650, 52418, + 11458, 44226, 27842, 60610, 7362, 40130, 23746, 56514, 15554, 48322, 31938, + 64706, 706, 33474, 17090, 49858, 8898, 41666, 25282, 58050, 4802, 37570, + 21186, 53954, 12994, 45762, 29378, 62146, 2754, 35522, 19138, 51906, 10946, + 43714, 27330, 60098, 6850, 39618, 23234, 56002, 15042, 47810, 31426, 64194, + 1730, 34498, 18114, 50882, 9922, 42690, 26306, 59074, 5826, 38594, 22210, + 54978, 14018, 46786, 30402, 63170, 3778, 36546, 20162, 52930, 11970, 44738, + 28354, 61122, 7874, 40642, 24258, 57026, 16066, 48834, 32450, 65218, 450, + 33218, 16834, 49602, 8642, 41410, 25026, 57794, 4546, 37314, 20930, 53698, + 12738, 45506, 29122, 61890, 2498, 35266, 18882, 51650, 10690, 43458, 27074, + 59842, 6594, 39362, 22978, 55746, 14786, 47554, 31170, 63938, 1474, 34242, + 17858, 50626, 9666, 42434, 26050, 58818, 5570, 38338, 21954, 54722, 13762, + 46530, 30146, 62914, 3522, 36290, 19906, 52674, 11714, 44482, 28098, 60866, + 7618, 40386, 24002, 56770, 15810, 48578, 32194, 64962, 962, 33730, 17346, + 50114, 9154, 41922, 25538, 58306, 5058, 37826, 21442, 54210, 13250, 46018, + 29634, 62402, 3010, 35778, 19394, 52162, 11202, 43970, 27586, 60354, 7106, + 39874, 23490, 56258, 15298, 48066, 31682, 64450, 1986, 34754, 18370, 51138, + 10178, 42946, 26562, 59330, 6082, 38850, 22466, 55234, 14274, 47042, 30658, + 63426, 4034, 36802, 20418, 53186, 12226, 44994, 28610, 61378, 8130, 40898, + 24514, 57282, 16322, 49090, 32706, 65474, 34, 32802, 16418, 49186, 8226, + 40994, 24610, 57378, 4130, 36898, 20514, 53282, 12322, 45090, 28706, 61474, + 2082, 34850, 18466, 51234, 10274, 43042, 26658, 59426, 6178, 38946, 22562, + 55330, 14370, 47138, 30754, 63522, 1058, 33826, 17442, 50210, 9250, 42018, + 25634, 58402, 5154, 37922, 21538, 54306, 13346, 46114, 29730, 62498, 3106, + 35874, 19490, 52258, 11298, 44066, 27682, 60450, 7202, 39970, 23586, 56354, + 15394, 48162, 31778, 64546, 546, 33314, 16930, 49698, 8738, 41506, 25122, + 57890, 4642, 37410, 21026, 53794, 12834, 45602, 29218, 61986, 2594, 35362, + 18978, 51746, 10786, 43554, 27170, 59938, 6690, 39458, 23074, 55842, 14882, + 47650, 31266, 64034, 1570, 34338, 17954, 50722, 9762, 42530, 26146, 58914, + 5666, 38434, 22050, 54818, 13858, 46626, 30242, 63010, 3618, 36386, 20002, + 52770, 11810, 44578, 28194, 60962, 7714, 40482, 24098, 56866, 15906, 48674, + 32290, 65058, 290, 33058, 16674, 49442, 8482, 41250, 24866, 57634, 4386, + 37154, 20770, 53538, 12578, 45346, 28962, 61730, 2338, 35106, 18722, 51490, + 10530, 43298, 26914, 59682, 6434, 39202, 22818, 55586, 14626, 47394, 31010, + 63778, 1314, 34082, 17698, 50466, 9506, 42274, 25890, 58658, 5410, 38178, + 21794, 54562, 13602, 46370, 29986, 62754, 3362, 36130, 19746, 52514, 11554, + 44322, 27938, 60706, 7458, 40226, 23842, 56610, 15650, 48418, 32034, 64802, + 802, 33570, 17186, 49954, 8994, 41762, 25378, 58146, 4898, 37666, 21282, + 54050, 13090, 45858, 29474, 62242, 2850, 35618, 19234, 52002, 11042, 43810, + 27426, 60194, 6946, 39714, 23330, 56098, 15138, 47906, 31522, 64290, 1826, + 34594, 18210, 50978, 10018, 42786, 26402, 59170, 5922, 38690, 22306, 55074, + 14114, 46882, 30498, 63266, 3874, 36642, 20258, 53026, 12066, 44834, 28450, + 61218, 7970, 40738, 24354, 57122, 16162, 48930, 32546, 65314, 162, 32930, + 16546, 49314, 8354, 41122, 24738, 57506, 4258, 37026, 20642, 53410, 12450, + 45218, 28834, 61602, 2210, 34978, 18594, 51362, 10402, 43170, 26786, 59554, + 6306, 39074, 22690, 55458, 14498, 47266, 30882, 63650, 1186, 33954, 17570, + 50338, 9378, 42146, 25762, 58530, 5282, 38050, 21666, 54434, 13474, 46242, + 29858, 62626, 3234, 36002, 19618, 52386, 11426, 44194, 27810, 60578, 7330, + 40098, 23714, 56482, 15522, 48290, 31906, 64674, 674, 33442, 17058, 49826, + 8866, 41634, 25250, 58018, 4770, 37538, 21154, 53922, 12962, 45730, 29346, + 62114, 2722, 35490, 19106, 51874, 10914, 43682, 27298, 60066, 6818, 39586, + 23202, 55970, 15010, 47778, 31394, 64162, 1698, 34466, 18082, 50850, 9890, + 42658, 26274, 59042, 5794, 38562, 22178, 54946, 13986, 46754, 30370, 63138, + 3746, 36514, 20130, 52898, 11938, 44706, 28322, 61090, 7842, 40610, 24226, + 56994, 16034, 48802, 32418, 65186, 418, 33186, 16802, 49570, 8610, 41378, + 24994, 57762, 4514, 37282, 20898, 53666, 12706, 45474, 29090, 61858, 2466, + 35234, 18850, 51618, 10658, 43426, 27042, 59810, 6562, 39330, 22946, 55714, + 14754, 47522, 31138, 63906, 1442, 34210, 17826, 50594, 9634, 42402, 26018, + 58786, 5538, 38306, 21922, 54690, 13730, 46498, 30114, 62882, 3490, 36258, + 19874, 52642, 11682, 44450, 28066, 60834, 7586, 40354, 23970, 56738, 15778, + 48546, 32162, 64930, 930, 33698, 17314, 50082, 9122, 41890, 25506, 58274, + 5026, 37794, 21410, 54178, 13218, 45986, 29602, 62370, 2978, 35746, 19362, + 52130, 11170, 43938, 27554, 60322, 7074, 39842, 23458, 56226, 15266, 48034, + 31650, 64418, 1954, 34722, 18338, 51106, 10146, 42914, 26530, 59298, 6050, + 38818, 22434, 55202, 14242, 47010, 30626, 63394, 4002, 36770, 20386, 53154, + 12194, 44962, 28578, 61346, 8098, 40866, 24482, 57250, 16290, 49058, 32674, + 65442, 98, 32866, 16482, 49250, 8290, 41058, 24674, 57442, 4194, 36962, + 20578, 53346, 12386, 45154, 28770, 61538, 2146, 34914, 18530, 51298, 10338, + 43106, 26722, 59490, 6242, 39010, 22626, 55394, 14434, 47202, 30818, 63586, + 1122, 33890, 17506, 50274, 9314, 42082, 25698, 58466, 5218, 37986, 21602, + 54370, 13410, 46178, 29794, 62562, 3170, 35938, 19554, 52322, 11362, 44130, + 27746, 60514, 7266, 40034, 23650, 56418, 15458, 48226, 31842, 64610, 610, + 33378, 16994, 49762, 8802, 41570, 25186, 57954, 4706, 37474, 21090, 53858, + 12898, 45666, 29282, 62050, 2658, 35426, 19042, 51810, 10850, 43618, 27234, + 60002, 6754, 39522, 23138, 55906, 14946, 47714, 31330, 64098, 1634, 34402, + 18018, 50786, 9826, 42594, 26210, 58978, 5730, 38498, 22114, 54882, 13922, + 46690, 30306, 63074, 3682, 36450, 20066, 52834, 11874, 44642, 28258, 61026, + 7778, 40546, 24162, 56930, 15970, 48738, 32354, 65122, 354, 33122, 16738, + 49506, 8546, 41314, 24930, 57698, 4450, 37218, 20834, 53602, 12642, 45410, + 29026, 61794, 2402, 35170, 18786, 51554, 10594, 43362, 26978, 59746, 6498, + 39266, 22882, 55650, 14690, 47458, 31074, 63842, 1378, 34146, 17762, 50530, + 9570, 42338, 25954, 58722, 5474, 38242, 21858, 54626, 13666, 46434, 30050, + 62818, 3426, 36194, 19810, 52578, 11618, 44386, 28002, 60770, 7522, 40290, + 23906, 56674, 15714, 48482, 32098, 64866, 866, 33634, 17250, 50018, 9058, + 41826, 25442, 58210, 4962, 37730, 21346, 54114, 13154, 45922, 29538, 62306, + 2914, 35682, 19298, 52066, 11106, 43874, 27490, 60258, 7010, 39778, 23394, + 56162, 15202, 47970, 31586, 64354, 1890, 34658, 18274, 51042, 10082, 42850, + 26466, 59234, 5986, 38754, 22370, 55138, 14178, 46946, 30562, 63330, 3938, + 36706, 20322, 53090, 12130, 44898, 28514, 61282, 8034, 40802, 24418, 57186, + 16226, 48994, 32610, 65378, 226, 32994, 16610, 49378, 8418, 41186, 24802, + 57570, 4322, 37090, 20706, 53474, 12514, 45282, 28898, 61666, 2274, 35042, + 18658, 51426, 10466, 43234, 26850, 59618, 6370, 39138, 22754, 55522, 14562, + 47330, 30946, 63714, 1250, 34018, 17634, 50402, 9442, 42210, 25826, 58594, + 5346, 38114, 21730, 54498, 13538, 46306, 29922, 62690, 3298, 36066, 19682, + 52450, 11490, 44258, 27874, 60642, 7394, 40162, 23778, 56546, 15586, 48354, + 31970, 64738, 738, 33506, 17122, 49890, 8930, 41698, 25314, 58082, 4834, + 37602, 21218, 53986, 13026, 45794, 29410, 62178, 2786, 35554, 19170, 51938, + 10978, 43746, 27362, 60130, 6882, 39650, 23266, 56034, 15074, 47842, 31458, + 64226, 1762, 34530, 18146, 50914, 9954, 42722, 26338, 59106, 5858, 38626, + 22242, 55010, 14050, 46818, 30434, 63202, 3810, 36578, 20194, 52962, 12002, + 44770, 28386, 61154, 7906, 40674, 24290, 57058, 16098, 48866, 32482, 65250, + 482, 33250, 16866, 49634, 8674, 41442, 25058, 57826, 4578, 37346, 20962, + 53730, 12770, 45538, 29154, 61922, 2530, 35298, 18914, 51682, 10722, 43490, + 27106, 59874, 6626, 39394, 23010, 55778, 14818, 47586, 31202, 63970, 1506, + 34274, 17890, 50658, 9698, 42466, 26082, 58850, 5602, 38370, 21986, 54754, + 13794, 46562, 30178, 62946, 3554, 36322, 19938, 52706, 11746, 44514, 28130, + 60898, 7650, 40418, 24034, 56802, 15842, 48610, 32226, 64994, 994, 33762, + 17378, 50146, 9186, 41954, 25570, 58338, 5090, 37858, 21474, 54242, 13282, + 46050, 29666, 62434, 3042, 35810, 19426, 52194, 11234, 44002, 27618, 60386, + 7138, 39906, 23522, 56290, 15330, 48098, 31714, 64482, 2018, 34786, 18402, + 51170, 10210, 42978, 26594, 59362, 6114, 38882, 22498, 55266, 14306, 47074, + 30690, 63458, 4066, 36834, 20450, 53218, 12258, 45026, 28642, 61410, 8162, + 40930, 24546, 57314, 16354, 49122, 32738, 65506, 18, 32786, 16402, 49170, + 8210, 40978, 24594, 57362, 4114, 36882, 20498, 53266, 12306, 45074, 28690, + 61458, 2066, 34834, 18450, 51218, 10258, 43026, 26642, 59410, 6162, 38930, + 22546, 55314, 14354, 47122, 30738, 63506, 1042, 33810, 17426, 50194, 9234, + 42002, 25618, 58386, 5138, 37906, 21522, 54290, 13330, 46098, 29714, 62482, + 3090, 35858, 19474, 52242, 11282, 44050, 27666, 60434, 7186, 39954, 23570, + 56338, 15378, 48146, 31762, 64530, 530, 33298, 16914, 49682, 8722, 41490, + 25106, 57874, 4626, 37394, 21010, 53778, 12818, 45586, 29202, 61970, 2578, + 35346, 18962, 51730, 10770, 43538, 27154, 59922, 6674, 39442, 23058, 55826, + 14866, 47634, 31250, 64018, 1554, 34322, 17938, 50706, 9746, 42514, 26130, + 58898, 5650, 38418, 22034, 54802, 13842, 46610, 30226, 62994, 3602, 36370, + 19986, 52754, 11794, 44562, 28178, 60946, 7698, 40466, 24082, 56850, 15890, + 48658, 32274, 65042, 274, 33042, 16658, 49426, 8466, 41234, 24850, 57618, + 4370, 37138, 20754, 53522, 12562, 45330, 28946, 61714, 2322, 35090, 18706, + 51474, 10514, 43282, 26898, 59666, 6418, 39186, 22802, 55570, 14610, 47378, + 30994, 63762, 1298, 34066, 17682, 50450, 9490, 42258, 25874, 58642, 5394, + 38162, 21778, 54546, 13586, 46354, 29970, 62738, 3346, 36114, 19730, 52498, + 11538, 44306, 27922, 60690, 7442, 40210, 23826, 56594, 15634, 48402, 32018, + 64786, 786, 33554, 17170, 49938, 8978, 41746, 25362, 58130, 4882, 37650, + 21266, 54034, 13074, 45842, 29458, 62226, 2834, 35602, 19218, 51986, 11026, + 43794, 27410, 60178, 6930, 39698, 23314, 56082, 15122, 47890, 31506, 64274, + 1810, 34578, 18194, 50962, 10002, 42770, 26386, 59154, 5906, 38674, 22290, + 55058, 14098, 46866, 30482, 63250, 3858, 36626, 20242, 53010, 12050, 44818, + 28434, 61202, 7954, 40722, 24338, 57106, 16146, 48914, 32530, 65298, 146, + 32914, 16530, 49298, 8338, 41106, 24722, 57490, 4242, 37010, 20626, 53394, + 12434, 45202, 28818, 61586, 2194, 34962, 18578, 51346, 10386, 43154, 26770, + 59538, 6290, 39058, 22674, 55442, 14482, 47250, 30866, 63634, 1170, 33938, + 17554, 50322, 9362, 42130, 25746, 58514, 5266, 38034, 21650, 54418, 13458, + 46226, 29842, 62610, 3218, 35986, 19602, 52370, 11410, 44178, 27794, 60562, + 7314, 40082, 23698, 56466, 15506, 48274, 31890, 64658, 658, 33426, 17042, + 49810, 8850, 41618, 25234, 58002, 4754, 37522, 21138, 53906, 12946, 45714, + 29330, 62098, 2706, 35474, 19090, 51858, 10898, 43666, 27282, 60050, 6802, + 39570, 23186, 55954, 14994, 47762, 31378, 64146, 1682, 34450, 18066, 50834, + 9874, 42642, 26258, 59026, 5778, 38546, 22162, 54930, 13970, 46738, 30354, + 63122, 3730, 36498, 20114, 52882, 11922, 44690, 28306, 61074, 7826, 40594, + 24210, 56978, 16018, 48786, 32402, 65170, 402, 33170, 16786, 49554, 8594, + 41362, 24978, 57746, 4498, 37266, 20882, 53650, 12690, 45458, 29074, 61842, + 2450, 35218, 18834, 51602, 10642, 43410, 27026, 59794, 6546, 39314, 22930, + 55698, 14738, 47506, 31122, 63890, 1426, 34194, 17810, 50578, 9618, 42386, + 26002, 58770, 5522, 38290, 21906, 54674, 13714, 46482, 30098, 62866, 3474, + 36242, 19858, 52626, 11666, 44434, 28050, 60818, 7570, 40338, 23954, 56722, + 15762, 48530, 32146, 64914, 914, 33682, 17298, 50066, 9106, 41874, 25490, + 58258, 5010, 37778, 21394, 54162, 13202, 45970, 29586, 62354, 2962, 35730, + 19346, 52114, 11154, 43922, 27538, 60306, 7058, 39826, 23442, 56210, 15250, + 48018, 31634, 64402, 1938, 34706, 18322, 51090, 10130, 42898, 26514, 59282, + 6034, 38802, 22418, 55186, 14226, 46994, 30610, 63378, 3986, 36754, 20370, + 53138, 12178, 44946, 28562, 61330, 8082, 40850, 24466, 57234, 16274, 49042, + 32658, 65426, 82, 32850, 16466, 49234, 8274, 41042, 24658, 57426, 4178, + 36946, 20562, 53330, 12370, 45138, 28754, 61522, 2130, 34898, 18514, 51282, + 10322, 43090, 26706, 59474, 6226, 38994, 22610, 55378, 14418, 47186, 30802, + 63570, 1106, 33874, 17490, 50258, 9298, 42066, 25682, 58450, 5202, 37970, + 21586, 54354, 13394, 46162, 29778, 62546, 3154, 35922, 19538, 52306, 11346, + 44114, 27730, 60498, 7250, 40018, 23634, 56402, 15442, 48210, 31826, 64594, + 594, 33362, 16978, 49746, 8786, 41554, 25170, 57938, 4690, 37458, 21074, + 53842, 12882, 45650, 29266, 62034, 2642, 35410, 19026, 51794, 10834, 43602, + 27218, 59986, 6738, 39506, 23122, 55890, 14930, 47698, 31314, 64082, 1618, + 34386, 18002, 50770, 9810, 42578, 26194, 58962, 5714, 38482, 22098, 54866, + 13906, 46674, 30290, 63058, 3666, 36434, 20050, 52818, 11858, 44626, 28242, + 61010, 7762, 40530, 24146, 56914, 15954, 48722, 32338, 65106, 338, 33106, + 16722, 49490, 8530, 41298, 24914, 57682, 4434, 37202, 20818, 53586, 12626, + 45394, 29010, 61778, 2386, 35154, 18770, 51538, 10578, 43346, 26962, 59730, + 6482, 39250, 22866, 55634, 14674, 47442, 31058, 63826, 1362, 34130, 17746, + 50514, 9554, 42322, 25938, 58706, 5458, 38226, 21842, 54610, 13650, 46418, + 30034, 62802, 3410, 36178, 19794, 52562, 11602, 44370, 27986, 60754, 7506, + 40274, 23890, 56658, 15698, 48466, 32082, 64850, 850, 33618, 17234, 50002, + 9042, 41810, 25426, 58194, 4946, 37714, 21330, 54098, 13138, 45906, 29522, + 62290, 2898, 35666, 19282, 52050, 11090, 43858, 27474, 60242, 6994, 39762, + 23378, 56146, 15186, 47954, 31570, 64338, 1874, 34642, 18258, 51026, 10066, + 42834, 26450, 59218, 5970, 38738, 22354, 55122, 14162, 46930, 30546, 63314, + 3922, 36690, 20306, 53074, 12114, 44882, 28498, 61266, 8018, 40786, 24402, + 57170, 16210, 48978, 32594, 65362, 210, 32978, 16594, 49362, 8402, 41170, + 24786, 57554, 4306, 37074, 20690, 53458, 12498, 45266, 28882, 61650, 2258, + 35026, 18642, 51410, 10450, 43218, 26834, 59602, 6354, 39122, 22738, 55506, + 14546, 47314, 30930, 63698, 1234, 34002, 17618, 50386, 9426, 42194, 25810, + 58578, 5330, 38098, 21714, 54482, 13522, 46290, 29906, 62674, 3282, 36050, + 19666, 52434, 11474, 44242, 27858, 60626, 7378, 40146, 23762, 56530, 15570, + 48338, 31954, 64722, 722, 33490, 17106, 49874, 8914, 41682, 25298, 58066, + 4818, 37586, 21202, 53970, 13010, 45778, 29394, 62162, 2770, 35538, 19154, + 51922, 10962, 43730, 27346, 60114, 6866, 39634, 23250, 56018, 15058, 47826, + 31442, 64210, 1746, 34514, 18130, 50898, 9938, 42706, 26322, 59090, 5842, + 38610, 22226, 54994, 14034, 46802, 30418, 63186, 3794, 36562, 20178, 52946, + 11986, 44754, 28370, 61138, 7890, 40658, 24274, 57042, 16082, 48850, 32466, + 65234, 466, 33234, 16850, 49618, 8658, 41426, 25042, 57810, 4562, 37330, + 20946, 53714, 12754, 45522, 29138, 61906, 2514, 35282, 18898, 51666, 10706, + 43474, 27090, 59858, 6610, 39378, 22994, 55762, 14802, 47570, 31186, 63954, + 1490, 34258, 17874, 50642, 9682, 42450, 26066, 58834, 5586, 38354, 21970, + 54738, 13778, 46546, 30162, 62930, 3538, 36306, 19922, 52690, 11730, 44498, + 28114, 60882, 7634, 40402, 24018, 56786, 15826, 48594, 32210, 64978, 978, + 33746, 17362, 50130, 9170, 41938, 25554, 58322, 5074, 37842, 21458, 54226, + 13266, 46034, 29650, 62418, 3026, 35794, 19410, 52178, 11218, 43986, 27602, + 60370, 7122, 39890, 23506, 56274, 15314, 48082, 31698, 64466, 2002, 34770, + 18386, 51154, 10194, 42962, 26578, 59346, 6098, 38866, 22482, 55250, 14290, + 47058, 30674, 63442, 4050, 36818, 20434, 53202, 12242, 45010, 28626, 61394, + 8146, 40914, 24530, 57298, 16338, 49106, 32722, 65490, 50, 32818, 16434, + 49202, 8242, 41010, 24626, 57394, 4146, 36914, 20530, 53298, 12338, 45106, + 28722, 61490, 2098, 34866, 18482, 51250, 10290, 43058, 26674, 59442, 6194, + 38962, 22578, 55346, 14386, 47154, 30770, 63538, 1074, 33842, 17458, 50226, + 9266, 42034, 25650, 58418, 5170, 37938, 21554, 54322, 13362, 46130, 29746, + 62514, 3122, 35890, 19506, 52274, 11314, 44082, 27698, 60466, 7218, 39986, + 23602, 56370, 15410, 48178, 31794, 64562, 562, 33330, 16946, 49714, 8754, + 41522, 25138, 57906, 4658, 37426, 21042, 53810, 12850, 45618, 29234, 62002, + 2610, 35378, 18994, 51762, 10802, 43570, 27186, 59954, 6706, 39474, 23090, + 55858, 14898, 47666, 31282, 64050, 1586, 34354, 17970, 50738, 9778, 42546, + 26162, 58930, 5682, 38450, 22066, 54834, 13874, 46642, 30258, 63026, 3634, + 36402, 20018, 52786, 11826, 44594, 28210, 60978, 7730, 40498, 24114, 56882, + 15922, 48690, 32306, 65074, 306, 33074, 16690, 49458, 8498, 41266, 24882, + 57650, 4402, 37170, 20786, 53554, 12594, 45362, 28978, 61746, 2354, 35122, + 18738, 51506, 10546, 43314, 26930, 59698, 6450, 39218, 22834, 55602, 14642, + 47410, 31026, 63794, 1330, 34098, 17714, 50482, 9522, 42290, 25906, 58674, + 5426, 38194, 21810, 54578, 13618, 46386, 30002, 62770, 3378, 36146, 19762, + 52530, 11570, 44338, 27954, 60722, 7474, 40242, 23858, 56626, 15666, 48434, + 32050, 64818, 818, 33586, 17202, 49970, 9010, 41778, 25394, 58162, 4914, + 37682, 21298, 54066, 13106, 45874, 29490, 62258, 2866, 35634, 19250, 52018, + 11058, 43826, 27442, 60210, 6962, 39730, 23346, 56114, 15154, 47922, 31538, + 64306, 1842, 34610, 18226, 50994, 10034, 42802, 26418, 59186, 5938, 38706, + 22322, 55090, 14130, 46898, 30514, 63282, 3890, 36658, 20274, 53042, 12082, + 44850, 28466, 61234, 7986, 40754, 24370, 57138, 16178, 48946, 32562, 65330, + 178, 32946, 16562, 49330, 8370, 41138, 24754, 57522, 4274, 37042, 20658, + 53426, 12466, 45234, 28850, 61618, 2226, 34994, 18610, 51378, 10418, 43186, + 26802, 59570, 6322, 39090, 22706, 55474, 14514, 47282, 30898, 63666, 1202, + 33970, 17586, 50354, 9394, 42162, 25778, 58546, 5298, 38066, 21682, 54450, + 13490, 46258, 29874, 62642, 3250, 36018, 19634, 52402, 11442, 44210, 27826, + 60594, 7346, 40114, 23730, 56498, 15538, 48306, 31922, 64690, 690, 33458, + 17074, 49842, 8882, 41650, 25266, 58034, 4786, 37554, 21170, 53938, 12978, + 45746, 29362, 62130, 2738, 35506, 19122, 51890, 10930, 43698, 27314, 60082, + 6834, 39602, 23218, 55986, 15026, 47794, 31410, 64178, 1714, 34482, 18098, + 50866, 9906, 42674, 26290, 59058, 5810, 38578, 22194, 54962, 14002, 46770, + 30386, 63154, 3762, 36530, 20146, 52914, 11954, 44722, 28338, 61106, 7858, + 40626, 24242, 57010, 16050, 48818, 32434, 65202, 434, 33202, 16818, 49586, + 8626, 41394, 25010, 57778, 4530, 37298, 20914, 53682, 12722, 45490, 29106, + 61874, 2482, 35250, 18866, 51634, 10674, 43442, 27058, 59826, 6578, 39346, + 22962, 55730, 14770, 47538, 31154, 63922, 1458, 34226, 17842, 50610, 9650, + 42418, 26034, 58802, 5554, 38322, 21938, 54706, 13746, 46514, 30130, 62898, + 3506, 36274, 19890, 52658, 11698, 44466, 28082, 60850, 7602, 40370, 23986, + 56754, 15794, 48562, 32178, 64946, 946, 33714, 17330, 50098, 9138, 41906, + 25522, 58290, 5042, 37810, 21426, 54194, 13234, 46002, 29618, 62386, 2994, + 35762, 19378, 52146, 11186, 43954, 27570, 60338, 7090, 39858, 23474, 56242, + 15282, 48050, 31666, 64434, 1970, 34738, 18354, 51122, 10162, 42930, 26546, + 59314, 6066, 38834, 22450, 55218, 14258, 47026, 30642, 63410, 4018, 36786, + 20402, 53170, 12210, 44978, 28594, 61362, 8114, 40882, 24498, 57266, 16306, + 49074, 32690, 65458, 114, 32882, 16498, 49266, 8306, 41074, 24690, 57458, + 4210, 36978, 20594, 53362, 12402, 45170, 28786, 61554, 2162, 34930, 18546, + 51314, 10354, 43122, 26738, 59506, 6258, 39026, 22642, 55410, 14450, 47218, + 30834, 63602, 1138, 33906, 17522, 50290, 9330, 42098, 25714, 58482, 5234, + 38002, 21618, 54386, 13426, 46194, 29810, 62578, 3186, 35954, 19570, 52338, + 11378, 44146, 27762, 60530, 7282, 40050, 23666, 56434, 15474, 48242, 31858, + 64626, 626, 33394, 17010, 49778, 8818, 41586, 25202, 57970, 4722, 37490, + 21106, 53874, 12914, 45682, 29298, 62066, 2674, 35442, 19058, 51826, 10866, + 43634, 27250, 60018, 6770, 39538, 23154, 55922, 14962, 47730, 31346, 64114, + 1650, 34418, 18034, 50802, 9842, 42610, 26226, 58994, 5746, 38514, 22130, + 54898, 13938, 46706, 30322, 63090, 3698, 36466, 20082, 52850, 11890, 44658, + 28274, 61042, 7794, 40562, 24178, 56946, 15986, 48754, 32370, 65138, 370, + 33138, 16754, 49522, 8562, 41330, 24946, 57714, 4466, 37234, 20850, 53618, + 12658, 45426, 29042, 61810, 2418, 35186, 18802, 51570, 10610, 43378, 26994, + 59762, 6514, 39282, 22898, 55666, 14706, 47474, 31090, 63858, 1394, 34162, + 17778, 50546, 9586, 42354, 25970, 58738, 5490, 38258, 21874, 54642, 13682, + 46450, 30066, 62834, 3442, 36210, 19826, 52594, 11634, 44402, 28018, 60786, + 7538, 40306, 23922, 56690, 15730, 48498, 32114, 64882, 882, 33650, 17266, + 50034, 9074, 41842, 25458, 58226, 4978, 37746, 21362, 54130, 13170, 45938, + 29554, 62322, 2930, 35698, 19314, 52082, 11122, 43890, 27506, 60274, 7026, + 39794, 23410, 56178, 15218, 47986, 31602, 64370, 1906, 34674, 18290, 51058, + 10098, 42866, 26482, 59250, 6002, 38770, 22386, 55154, 14194, 46962, 30578, + 63346, 3954, 36722, 20338, 53106, 12146, 44914, 28530, 61298, 8050, 40818, + 24434, 57202, 16242, 49010, 32626, 65394, 242, 33010, 16626, 49394, 8434, + 41202, 24818, 57586, 4338, 37106, 20722, 53490, 12530, 45298, 28914, 61682, + 2290, 35058, 18674, 51442, 10482, 43250, 26866, 59634, 6386, 39154, 22770, + 55538, 14578, 47346, 30962, 63730, 1266, 34034, 17650, 50418, 9458, 42226, + 25842, 58610, 5362, 38130, 21746, 54514, 13554, 46322, 29938, 62706, 3314, + 36082, 19698, 52466, 11506, 44274, 27890, 60658, 7410, 40178, 23794, 56562, + 15602, 48370, 31986, 64754, 754, 33522, 17138, 49906, 8946, 41714, 25330, + 58098, 4850, 37618, 21234, 54002, 13042, 45810, 29426, 62194, 2802, 35570, + 19186, 51954, 10994, 43762, 27378, 60146, 6898, 39666, 23282, 56050, 15090, + 47858, 31474, 64242, 1778, 34546, 18162, 50930, 9970, 42738, 26354, 59122, + 5874, 38642, 22258, 55026, 14066, 46834, 30450, 63218, 3826, 36594, 20210, + 52978, 12018, 44786, 28402, 61170, 7922, 40690, 24306, 57074, 16114, 48882, + 32498, 65266, 498, 33266, 16882, 49650, 8690, 41458, 25074, 57842, 4594, + 37362, 20978, 53746, 12786, 45554, 29170, 61938, 2546, 35314, 18930, 51698, + 10738, 43506, 27122, 59890, 6642, 39410, 23026, 55794, 14834, 47602, 31218, + 63986, 1522, 34290, 17906, 50674, 9714, 42482, 26098, 58866, 5618, 38386, + 22002, 54770, 13810, 46578, 30194, 62962, 3570, 36338, 19954, 52722, 11762, + 44530, 28146, 60914, 7666, 40434, 24050, 56818, 15858, 48626, 32242, 65010, + 1010, 33778, 17394, 50162, 9202, 41970, 25586, 58354, 5106, 37874, 21490, + 54258, 13298, 46066, 29682, 62450, 3058, 35826, 19442, 52210, 11250, 44018, + 27634, 60402, 7154, 39922, 23538, 56306, 15346, 48114, 31730, 64498, 2034, + 34802, 18418, 51186, 10226, 42994, 26610, 59378, 6130, 38898, 22514, 55282, + 14322, 47090, 30706, 63474, 4082, 36850, 20466, 53234, 12274, 45042, 28658, + 61426, 8178, 40946, 24562, 57330, 16370, 49138, 32754, 65522, 10, 32778, + 16394, 49162, 8202, 40970, 24586, 57354, 4106, 36874, 20490, 53258, 12298, + 45066, 28682, 61450, 2058, 34826, 18442, 51210, 10250, 43018, 26634, 59402, + 6154, 38922, 22538, 55306, 14346, 47114, 30730, 63498, 1034, 33802, 17418, + 50186, 9226, 41994, 25610, 58378, 5130, 37898, 21514, 54282, 13322, 46090, + 29706, 62474, 3082, 35850, 19466, 52234, 11274, 44042, 27658, 60426, 7178, + 39946, 23562, 56330, 15370, 48138, 31754, 64522, 522, 33290, 16906, 49674, + 8714, 41482, 25098, 57866, 4618, 37386, 21002, 53770, 12810, 45578, 29194, + 61962, 2570, 35338, 18954, 51722, 10762, 43530, 27146, 59914, 6666, 39434, + 23050, 55818, 14858, 47626, 31242, 64010, 1546, 34314, 17930, 50698, 9738, + 42506, 26122, 58890, 5642, 38410, 22026, 54794, 13834, 46602, 30218, 62986, + 3594, 36362, 19978, 52746, 11786, 44554, 28170, 60938, 7690, 40458, 24074, + 56842, 15882, 48650, 32266, 65034, 266, 33034, 16650, 49418, 8458, 41226, + 24842, 57610, 4362, 37130, 20746, 53514, 12554, 45322, 28938, 61706, 2314, + 35082, 18698, 51466, 10506, 43274, 26890, 59658, 6410, 39178, 22794, 55562, + 14602, 47370, 30986, 63754, 1290, 34058, 17674, 50442, 9482, 42250, 25866, + 58634, 5386, 38154, 21770, 54538, 13578, 46346, 29962, 62730, 3338, 36106, + 19722, 52490, 11530, 44298, 27914, 60682, 7434, 40202, 23818, 56586, 15626, + 48394, 32010, 64778, 778, 33546, 17162, 49930, 8970, 41738, 25354, 58122, + 4874, 37642, 21258, 54026, 13066, 45834, 29450, 62218, 2826, 35594, 19210, + 51978, 11018, 43786, 27402, 60170, 6922, 39690, 23306, 56074, 15114, 47882, + 31498, 64266, 1802, 34570, 18186, 50954, 9994, 42762, 26378, 59146, 5898, + 38666, 22282, 55050, 14090, 46858, 30474, 63242, 3850, 36618, 20234, 53002, + 12042, 44810, 28426, 61194, 7946, 40714, 24330, 57098, 16138, 48906, 32522, + 65290, 138, 32906, 16522, 49290, 8330, 41098, 24714, 57482, 4234, 37002, + 20618, 53386, 12426, 45194, 28810, 61578, 2186, 34954, 18570, 51338, 10378, + 43146, 26762, 59530, 6282, 39050, 22666, 55434, 14474, 47242, 30858, 63626, + 1162, 33930, 17546, 50314, 9354, 42122, 25738, 58506, 5258, 38026, 21642, + 54410, 13450, 46218, 29834, 62602, 3210, 35978, 19594, 52362, 11402, 44170, + 27786, 60554, 7306, 40074, 23690, 56458, 15498, 48266, 31882, 64650, 650, + 33418, 17034, 49802, 8842, 41610, 25226, 57994, 4746, 37514, 21130, 53898, + 12938, 45706, 29322, 62090, 2698, 35466, 19082, 51850, 10890, 43658, 27274, + 60042, 6794, 39562, 23178, 55946, 14986, 47754, 31370, 64138, 1674, 34442, + 18058, 50826, 9866, 42634, 26250, 59018, 5770, 38538, 22154, 54922, 13962, + 46730, 30346, 63114, 3722, 36490, 20106, 52874, 11914, 44682, 28298, 61066, + 7818, 40586, 24202, 56970, 16010, 48778, 32394, 65162, 394, 33162, 16778, + 49546, 8586, 41354, 24970, 57738, 4490, 37258, 20874, 53642, 12682, 45450, + 29066, 61834, 2442, 35210, 18826, 51594, 10634, 43402, 27018, 59786, 6538, + 39306, 22922, 55690, 14730, 47498, 31114, 63882, 1418, 34186, 17802, 50570, + 9610, 42378, 25994, 58762, 5514, 38282, 21898, 54666, 13706, 46474, 30090, + 62858, 3466, 36234, 19850, 52618, 11658, 44426, 28042, 60810, 7562, 40330, + 23946, 56714, 15754, 48522, 32138, 64906, 906, 33674, 17290, 50058, 9098, + 41866, 25482, 58250, 5002, 37770, 21386, 54154, 13194, 45962, 29578, 62346, + 2954, 35722, 19338, 52106, 11146, 43914, 27530, 60298, 7050, 39818, 23434, + 56202, 15242, 48010, 31626, 64394, 1930, 34698, 18314, 51082, 10122, 42890, + 26506, 59274, 6026, 38794, 22410, 55178, 14218, 46986, 30602, 63370, 3978, + 36746, 20362, 53130, 12170, 44938, 28554, 61322, 8074, 40842, 24458, 57226, + 16266, 49034, 32650, 65418, 74, 32842, 16458, 49226, 8266, 41034, 24650, + 57418, 4170, 36938, 20554, 53322, 12362, 45130, 28746, 61514, 2122, 34890, + 18506, 51274, 10314, 43082, 26698, 59466, 6218, 38986, 22602, 55370, 14410, + 47178, 30794, 63562, 1098, 33866, 17482, 50250, 9290, 42058, 25674, 58442, + 5194, 37962, 21578, 54346, 13386, 46154, 29770, 62538, 3146, 35914, 19530, + 52298, 11338, 44106, 27722, 60490, 7242, 40010, 23626, 56394, 15434, 48202, + 31818, 64586, 586, 33354, 16970, 49738, 8778, 41546, 25162, 57930, 4682, + 37450, 21066, 53834, 12874, 45642, 29258, 62026, 2634, 35402, 19018, 51786, + 10826, 43594, 27210, 59978, 6730, 39498, 23114, 55882, 14922, 47690, 31306, + 64074, 1610, 34378, 17994, 50762, 9802, 42570, 26186, 58954, 5706, 38474, + 22090, 54858, 13898, 46666, 30282, 63050, 3658, 36426, 20042, 52810, 11850, + 44618, 28234, 61002, 7754, 40522, 24138, 56906, 15946, 48714, 32330, 65098, + 330, 33098, 16714, 49482, 8522, 41290, 24906, 57674, 4426, 37194, 20810, + 53578, 12618, 45386, 29002, 61770, 2378, 35146, 18762, 51530, 10570, 43338, + 26954, 59722, 6474, 39242, 22858, 55626, 14666, 47434, 31050, 63818, 1354, + 34122, 17738, 50506, 9546, 42314, 25930, 58698, 5450, 38218, 21834, 54602, + 13642, 46410, 30026, 62794, 3402, 36170, 19786, 52554, 11594, 44362, 27978, + 60746, 7498, 40266, 23882, 56650, 15690, 48458, 32074, 64842, 842, 33610, + 17226, 49994, 9034, 41802, 25418, 58186, 4938, 37706, 21322, 54090, 13130, + 45898, 29514, 62282, 2890, 35658, 19274, 52042, 11082, 43850, 27466, 60234, + 6986, 39754, 23370, 56138, 15178, 47946, 31562, 64330, 1866, 34634, 18250, + 51018, 10058, 42826, 26442, 59210, 5962, 38730, 22346, 55114, 14154, 46922, + 30538, 63306, 3914, 36682, 20298, 53066, 12106, 44874, 28490, 61258, 8010, + 40778, 24394, 57162, 16202, 48970, 32586, 65354, 202, 32970, 16586, 49354, + 8394, 41162, 24778, 57546, 4298, 37066, 20682, 53450, 12490, 45258, 28874, + 61642, 2250, 35018, 18634, 51402, 10442, 43210, 26826, 59594, 6346, 39114, + 22730, 55498, 14538, 47306, 30922, 63690, 1226, 33994, 17610, 50378, 9418, + 42186, 25802, 58570, 5322, 38090, 21706, 54474, 13514, 46282, 29898, 62666, + 3274, 36042, 19658, 52426, 11466, 44234, 27850, 60618, 7370, 40138, 23754, + 56522, 15562, 48330, 31946, 64714, 714, 33482, 17098, 49866, 8906, 41674, + 25290, 58058, 4810, 37578, 21194, 53962, 13002, 45770, 29386, 62154, 2762, + 35530, 19146, 51914, 10954, 43722, 27338, 60106, 6858, 39626, 23242, 56010, + 15050, 47818, 31434, 64202, 1738, 34506, 18122, 50890, 9930, 42698, 26314, + 59082, 5834, 38602, 22218, 54986, 14026, 46794, 30410, 63178, 3786, 36554, + 20170, 52938, 11978, 44746, 28362, 61130, 7882, 40650, 24266, 57034, 16074, + 48842, 32458, 65226, 458, 33226, 16842, 49610, 8650, 41418, 25034, 57802, + 4554, 37322, 20938, 53706, 12746, 45514, 29130, 61898, 2506, 35274, 18890, + 51658, 10698, 43466, 27082, 59850, 6602, 39370, 22986, 55754, 14794, 47562, + 31178, 63946, 1482, 34250, 17866, 50634, 9674, 42442, 26058, 58826, 5578, + 38346, 21962, 54730, 13770, 46538, 30154, 62922, 3530, 36298, 19914, 52682, + 11722, 44490, 28106, 60874, 7626, 40394, 24010, 56778, 15818, 48586, 32202, + 64970, 970, 33738, 17354, 50122, 9162, 41930, 25546, 58314, 5066, 37834, + 21450, 54218, 13258, 46026, 29642, 62410, 3018, 35786, 19402, 52170, 11210, + 43978, 27594, 60362, 7114, 39882, 23498, 56266, 15306, 48074, 31690, 64458, + 1994, 34762, 18378, 51146, 10186, 42954, 26570, 59338, 6090, 38858, 22474, + 55242, 14282, 47050, 30666, 63434, 4042, 36810, 20426, 53194, 12234, 45002, + 28618, 61386, 8138, 40906, 24522, 57290, 16330, 49098, 32714, 65482, 42, + 32810, 16426, 49194, 8234, 41002, 24618, 57386, 4138, 36906, 20522, 53290, + 12330, 45098, 28714, 61482, 2090, 34858, 18474, 51242, 10282, 43050, 26666, + 59434, 6186, 38954, 22570, 55338, 14378, 47146, 30762, 63530, 1066, 33834, + 17450, 50218, 9258, 42026, 25642, 58410, 5162, 37930, 21546, 54314, 13354, + 46122, 29738, 62506, 3114, 35882, 19498, 52266, 11306, 44074, 27690, 60458, + 7210, 39978, 23594, 56362, 15402, 48170, 31786, 64554, 554, 33322, 16938, + 49706, 8746, 41514, 25130, 57898, 4650, 37418, 21034, 53802, 12842, 45610, + 29226, 61994, 2602, 35370, 18986, 51754, 10794, 43562, 27178, 59946, 6698, + 39466, 23082, 55850, 14890, 47658, 31274, 64042, 1578, 34346, 17962, 50730, + 9770, 42538, 26154, 58922, 5674, 38442, 22058, 54826, 13866, 46634, 30250, + 63018, 3626, 36394, 20010, 52778, 11818, 44586, 28202, 60970, 7722, 40490, + 24106, 56874, 15914, 48682, 32298, 65066, 298, 33066, 16682, 49450, 8490, + 41258, 24874, 57642, 4394, 37162, 20778, 53546, 12586, 45354, 28970, 61738, + 2346, 35114, 18730, 51498, 10538, 43306, 26922, 59690, 6442, 39210, 22826, + 55594, 14634, 47402, 31018, 63786, 1322, 34090, 17706, 50474, 9514, 42282, + 25898, 58666, 5418, 38186, 21802, 54570, 13610, 46378, 29994, 62762, 3370, + 36138, 19754, 52522, 11562, 44330, 27946, 60714, 7466, 40234, 23850, 56618, + 15658, 48426, 32042, 64810, 810, 33578, 17194, 49962, 9002, 41770, 25386, + 58154, 4906, 37674, 21290, 54058, 13098, 45866, 29482, 62250, 2858, 35626, + 19242, 52010, 11050, 43818, 27434, 60202, 6954, 39722, 23338, 56106, 15146, + 47914, 31530, 64298, 1834, 34602, 18218, 50986, 10026, 42794, 26410, 59178, + 5930, 38698, 22314, 55082, 14122, 46890, 30506, 63274, 3882, 36650, 20266, + 53034, 12074, 44842, 28458, 61226, 7978, 40746, 24362, 57130, 16170, 48938, + 32554, 65322, 170, 32938, 16554, 49322, 8362, 41130, 24746, 57514, 4266, + 37034, 20650, 53418, 12458, 45226, 28842, 61610, 2218, 34986, 18602, 51370, + 10410, 43178, 26794, 59562, 6314, 39082, 22698, 55466, 14506, 47274, 30890, + 63658, 1194, 33962, 17578, 50346, 9386, 42154, 25770, 58538, 5290, 38058, + 21674, 54442, 13482, 46250, 29866, 62634, 3242, 36010, 19626, 52394, 11434, + 44202, 27818, 60586, 7338, 40106, 23722, 56490, 15530, 48298, 31914, 64682, + 682, 33450, 17066, 49834, 8874, 41642, 25258, 58026, 4778, 37546, 21162, + 53930, 12970, 45738, 29354, 62122, 2730, 35498, 19114, 51882, 10922, 43690, + 27306, 60074, 6826, 39594, 23210, 55978, 15018, 47786, 31402, 64170, 1706, + 34474, 18090, 50858, 9898, 42666, 26282, 59050, 5802, 38570, 22186, 54954, + 13994, 46762, 30378, 63146, 3754, 36522, 20138, 52906, 11946, 44714, 28330, + 61098, 7850, 40618, 24234, 57002, 16042, 48810, 32426, 65194, 426, 33194, + 16810, 49578, 8618, 41386, 25002, 57770, 4522, 37290, 20906, 53674, 12714, + 45482, 29098, 61866, 2474, 35242, 18858, 51626, 10666, 43434, 27050, 59818, + 6570, 39338, 22954, 55722, 14762, 47530, 31146, 63914, 1450, 34218, 17834, + 50602, 9642, 42410, 26026, 58794, 5546, 38314, 21930, 54698, 13738, 46506, + 30122, 62890, 3498, 36266, 19882, 52650, 11690, 44458, 28074, 60842, 7594, + 40362, 23978, 56746, 15786, 48554, 32170, 64938, 938, 33706, 17322, 50090, + 9130, 41898, 25514, 58282, 5034, 37802, 21418, 54186, 13226, 45994, 29610, + 62378, 2986, 35754, 19370, 52138, 11178, 43946, 27562, 60330, 7082, 39850, + 23466, 56234, 15274, 48042, 31658, 64426, 1962, 34730, 18346, 51114, 10154, + 42922, 26538, 59306, 6058, 38826, 22442, 55210, 14250, 47018, 30634, 63402, + 4010, 36778, 20394, 53162, 12202, 44970, 28586, 61354, 8106, 40874, 24490, + 57258, 16298, 49066, 32682, 65450, 106, 32874, 16490, 49258, 8298, 41066, + 24682, 57450, 4202, 36970, 20586, 53354, 12394, 45162, 28778, 61546, 2154, + 34922, 18538, 51306, 10346, 43114, 26730, 59498, 6250, 39018, 22634, 55402, + 14442, 47210, 30826, 63594, 1130, 33898, 17514, 50282, 9322, 42090, 25706, + 58474, 5226, 37994, 21610, 54378, 13418, 46186, 29802, 62570, 3178, 35946, + 19562, 52330, 11370, 44138, 27754, 60522, 7274, 40042, 23658, 56426, 15466, + 48234, 31850, 64618, 618, 33386, 17002, 49770, 8810, 41578, 25194, 57962, + 4714, 37482, 21098, 53866, 12906, 45674, 29290, 62058, 2666, 35434, 19050, + 51818, 10858, 43626, 27242, 60010, 6762, 39530, 23146, 55914, 14954, 47722, + 31338, 64106, 1642, 34410, 18026, 50794, 9834, 42602, 26218, 58986, 5738, + 38506, 22122, 54890, 13930, 46698, 30314, 63082, 3690, 36458, 20074, 52842, + 11882, 44650, 28266, 61034, 7786, 40554, 24170, 56938, 15978, 48746, 32362, + 65130, 362, 33130, 16746, 49514, 8554, 41322, 24938, 57706, 4458, 37226, + 20842, 53610, 12650, 45418, 29034, 61802, 2410, 35178, 18794, 51562, 10602, + 43370, 26986, 59754, 6506, 39274, 22890, 55658, 14698, 47466, 31082, 63850, + 1386, 34154, 17770, 50538, 9578, 42346, 25962, 58730, 5482, 38250, 21866, + 54634, 13674, 46442, 30058, 62826, 3434, 36202, 19818, 52586, 11626, 44394, + 28010, 60778, 7530, 40298, 23914, 56682, 15722, 48490, 32106, 64874, 874, + 33642, 17258, 50026, 9066, 41834, 25450, 58218, 4970, 37738, 21354, 54122, + 13162, 45930, 29546, 62314, 2922, 35690, 19306, 52074, 11114, 43882, 27498, + 60266, 7018, 39786, 23402, 56170, 15210, 47978, 31594, 64362, 1898, 34666, + 18282, 51050, 10090, 42858, 26474, 59242, 5994, 38762, 22378, 55146, 14186, + 46954, 30570, 63338, 3946, 36714, 20330, 53098, 12138, 44906, 28522, 61290, + 8042, 40810, 24426, 57194, 16234, 49002, 32618, 65386, 234, 33002, 16618, + 49386, 8426, 41194, 24810, 57578, 4330, 37098, 20714, 53482, 12522, 45290, + 28906, 61674, 2282, 35050, 18666, 51434, 10474, 43242, 26858, 59626, 6378, + 39146, 22762, 55530, 14570, 47338, 30954, 63722, 1258, 34026, 17642, 50410, + 9450, 42218, 25834, 58602, 5354, 38122, 21738, 54506, 13546, 46314, 29930, + 62698, 3306, 36074, 19690, 52458, 11498, 44266, 27882, 60650, 7402, 40170, + 23786, 56554, 15594, 48362, 31978, 64746, 746, 33514, 17130, 49898, 8938, + 41706, 25322, 58090, 4842, 37610, 21226, 53994, 13034, 45802, 29418, 62186, + 2794, 35562, 19178, 51946, 10986, 43754, 27370, 60138, 6890, 39658, 23274, + 56042, 15082, 47850, 31466, 64234, 1770, 34538, 18154, 50922, 9962, 42730, + 26346, 59114, 5866, 38634, 22250, 55018, 14058, 46826, 30442, 63210, 3818, + 36586, 20202, 52970, 12010, 44778, 28394, 61162, 7914, 40682, 24298, 57066, + 16106, 48874, 32490, 65258, 490, 33258, 16874, 49642, 8682, 41450, 25066, + 57834, 4586, 37354, 20970, 53738, 12778, 45546, 29162, 61930, 2538, 35306, + 18922, 51690, 10730, 43498, 27114, 59882, 6634, 39402, 23018, 55786, 14826, + 47594, 31210, 63978, 1514, 34282, 17898, 50666, 9706, 42474, 26090, 58858, + 5610, 38378, 21994, 54762, 13802, 46570, 30186, 62954, 3562, 36330, 19946, + 52714, 11754, 44522, 28138, 60906, 7658, 40426, 24042, 56810, 15850, 48618, + 32234, 65002, 1002, 33770, 17386, 50154, 9194, 41962, 25578, 58346, 5098, + 37866, 21482, 54250, 13290, 46058, 29674, 62442, 3050, 35818, 19434, 52202, + 11242, 44010, 27626, 60394, 7146, 39914, 23530, 56298, 15338, 48106, 31722, + 64490, 2026, 34794, 18410, 51178, 10218, 42986, 26602, 59370, 6122, 38890, + 22506, 55274, 14314, 47082, 30698, 63466, 4074, 36842, 20458, 53226, 12266, + 45034, 28650, 61418, 8170, 40938, 24554, 57322, 16362, 49130, 32746, 65514, + 26, 32794, 16410, 49178, 8218, 40986, 24602, 57370, 4122, 36890, 20506, + 53274, 12314, 45082, 28698, 61466, 2074, 34842, 18458, 51226, 10266, 43034, + 26650, 59418, 6170, 38938, 22554, 55322, 14362, 47130, 30746, 63514, 1050, + 33818, 17434, 50202, 9242, 42010, 25626, 58394, 5146, 37914, 21530, 54298, + 13338, 46106, 29722, 62490, 3098, 35866, 19482, 52250, 11290, 44058, 27674, + 60442, 7194, 39962, 23578, 56346, 15386, 48154, 31770, 64538, 538, 33306, + 16922, 49690, 8730, 41498, 25114, 57882, 4634, 37402, 21018, 53786, 12826, + 45594, 29210, 61978, 2586, 35354, 18970, 51738, 10778, 43546, 27162, 59930, + 6682, 39450, 23066, 55834, 14874, 47642, 31258, 64026, 1562, 34330, 17946, + 50714, 9754, 42522, 26138, 58906, 5658, 38426, 22042, 54810, 13850, 46618, + 30234, 63002, 3610, 36378, 19994, 52762, 11802, 44570, 28186, 60954, 7706, + 40474, 24090, 56858, 15898, 48666, 32282, 65050, 282, 33050, 16666, 49434, + 8474, 41242, 24858, 57626, 4378, 37146, 20762, 53530, 12570, 45338, 28954, + 61722, 2330, 35098, 18714, 51482, 10522, 43290, 26906, 59674, 6426, 39194, + 22810, 55578, 14618, 47386, 31002, 63770, 1306, 34074, 17690, 50458, 9498, + 42266, 25882, 58650, 5402, 38170, 21786, 54554, 13594, 46362, 29978, 62746, + 3354, 36122, 19738, 52506, 11546, 44314, 27930, 60698, 7450, 40218, 23834, + 56602, 15642, 48410, 32026, 64794, 794, 33562, 17178, 49946, 8986, 41754, + 25370, 58138, 4890, 37658, 21274, 54042, 13082, 45850, 29466, 62234, 2842, + 35610, 19226, 51994, 11034, 43802, 27418, 60186, 6938, 39706, 23322, 56090, + 15130, 47898, 31514, 64282, 1818, 34586, 18202, 50970, 10010, 42778, 26394, + 59162, 5914, 38682, 22298, 55066, 14106, 46874, 30490, 63258, 3866, 36634, + 20250, 53018, 12058, 44826, 28442, 61210, 7962, 40730, 24346, 57114, 16154, + 48922, 32538, 65306, 154, 32922, 16538, 49306, 8346, 41114, 24730, 57498, + 4250, 37018, 20634, 53402, 12442, 45210, 28826, 61594, 2202, 34970, 18586, + 51354, 10394, 43162, 26778, 59546, 6298, 39066, 22682, 55450, 14490, 47258, + 30874, 63642, 1178, 33946, 17562, 50330, 9370, 42138, 25754, 58522, 5274, + 38042, 21658, 54426, 13466, 46234, 29850, 62618, 3226, 35994, 19610, 52378, + 11418, 44186, 27802, 60570, 7322, 40090, 23706, 56474, 15514, 48282, 31898, + 64666, 666, 33434, 17050, 49818, 8858, 41626, 25242, 58010, 4762, 37530, + 21146, 53914, 12954, 45722, 29338, 62106, 2714, 35482, 19098, 51866, 10906, + 43674, 27290, 60058, 6810, 39578, 23194, 55962, 15002, 47770, 31386, 64154, + 1690, 34458, 18074, 50842, 9882, 42650, 26266, 59034, 5786, 38554, 22170, + 54938, 13978, 46746, 30362, 63130, 3738, 36506, 20122, 52890, 11930, 44698, + 28314, 61082, 7834, 40602, 24218, 56986, 16026, 48794, 32410, 65178, 410, + 33178, 16794, 49562, 8602, 41370, 24986, 57754, 4506, 37274, 20890, 53658, + 12698, 45466, 29082, 61850, 2458, 35226, 18842, 51610, 10650, 43418, 27034, + 59802, 6554, 39322, 22938, 55706, 14746, 47514, 31130, 63898, 1434, 34202, + 17818, 50586, 9626, 42394, 26010, 58778, 5530, 38298, 21914, 54682, 13722, + 46490, 30106, 62874, 3482, 36250, 19866, 52634, 11674, 44442, 28058, 60826, + 7578, 40346, 23962, 56730, 15770, 48538, 32154, 64922, 922, 33690, 17306, + 50074, 9114, 41882, 25498, 58266, 5018, 37786, 21402, 54170, 13210, 45978, + 29594, 62362, 2970, 35738, 19354, 52122, 11162, 43930, 27546, 60314, 7066, + 39834, 23450, 56218, 15258, 48026, 31642, 64410, 1946, 34714, 18330, 51098, + 10138, 42906, 26522, 59290, 6042, 38810, 22426, 55194, 14234, 47002, 30618, + 63386, 3994, 36762, 20378, 53146, 12186, 44954, 28570, 61338, 8090, 40858, + 24474, 57242, 16282, 49050, 32666, 65434, 90, 32858, 16474, 49242, 8282, + 41050, 24666, 57434, 4186, 36954, 20570, 53338, 12378, 45146, 28762, 61530, + 2138, 34906, 18522, 51290, 10330, 43098, 26714, 59482, 6234, 39002, 22618, + 55386, 14426, 47194, 30810, 63578, 1114, 33882, 17498, 50266, 9306, 42074, + 25690, 58458, 5210, 37978, 21594, 54362, 13402, 46170, 29786, 62554, 3162, + 35930, 19546, 52314, 11354, 44122, 27738, 60506, 7258, 40026, 23642, 56410, + 15450, 48218, 31834, 64602, 602, 33370, 16986, 49754, 8794, 41562, 25178, + 57946, 4698, 37466, 21082, 53850, 12890, 45658, 29274, 62042, 2650, 35418, + 19034, 51802, 10842, 43610, 27226, 59994, 6746, 39514, 23130, 55898, 14938, + 47706, 31322, 64090, 1626, 34394, 18010, 50778, 9818, 42586, 26202, 58970, + 5722, 38490, 22106, 54874, 13914, 46682, 30298, 63066, 3674, 36442, 20058, + 52826, 11866, 44634, 28250, 61018, 7770, 40538, 24154, 56922, 15962, 48730, + 32346, 65114, 346, 33114, 16730, 49498, 8538, 41306, 24922, 57690, 4442, + 37210, 20826, 53594, 12634, 45402, 29018, 61786, 2394, 35162, 18778, 51546, + 10586, 43354, 26970, 59738, 6490, 39258, 22874, 55642, 14682, 47450, 31066, + 63834, 1370, 34138, 17754, 50522, 9562, 42330, 25946, 58714, 5466, 38234, + 21850, 54618, 13658, 46426, 30042, 62810, 3418, 36186, 19802, 52570, 11610, + 44378, 27994, 60762, 7514, 40282, 23898, 56666, 15706, 48474, 32090, 64858, + 858, 33626, 17242, 50010, 9050, 41818, 25434, 58202, 4954, 37722, 21338, + 54106, 13146, 45914, 29530, 62298, 2906, 35674, 19290, 52058, 11098, 43866, + 27482, 60250, 7002, 39770, 23386, 56154, 15194, 47962, 31578, 64346, 1882, + 34650, 18266, 51034, 10074, 42842, 26458, 59226, 5978, 38746, 22362, 55130, + 14170, 46938, 30554, 63322, 3930, 36698, 20314, 53082, 12122, 44890, 28506, + 61274, 8026, 40794, 24410, 57178, 16218, 48986, 32602, 65370, 218, 32986, + 16602, 49370, 8410, 41178, 24794, 57562, 4314, 37082, 20698, 53466, 12506, + 45274, 28890, 61658, 2266, 35034, 18650, 51418, 10458, 43226, 26842, 59610, + 6362, 39130, 22746, 55514, 14554, 47322, 30938, 63706, 1242, 34010, 17626, + 50394, 9434, 42202, 25818, 58586, 5338, 38106, 21722, 54490, 13530, 46298, + 29914, 62682, 3290, 36058, 19674, 52442, 11482, 44250, 27866, 60634, 7386, + 40154, 23770, 56538, 15578, 48346, 31962, 64730, 730, 33498, 17114, 49882, + 8922, 41690, 25306, 58074, 4826, 37594, 21210, 53978, 13018, 45786, 29402, + 62170, 2778, 35546, 19162, 51930, 10970, 43738, 27354, 60122, 6874, 39642, + 23258, 56026, 15066, 47834, 31450, 64218, 1754, 34522, 18138, 50906, 9946, + 42714, 26330, 59098, 5850, 38618, 22234, 55002, 14042, 46810, 30426, 63194, + 3802, 36570, 20186, 52954, 11994, 44762, 28378, 61146, 7898, 40666, 24282, + 57050, 16090, 48858, 32474, 65242, 474, 33242, 16858, 49626, 8666, 41434, + 25050, 57818, 4570, 37338, 20954, 53722, 12762, 45530, 29146, 61914, 2522, + 35290, 18906, 51674, 10714, 43482, 27098, 59866, 6618, 39386, 23002, 55770, + 14810, 47578, 31194, 63962, 1498, 34266, 17882, 50650, 9690, 42458, 26074, + 58842, 5594, 38362, 21978, 54746, 13786, 46554, 30170, 62938, 3546, 36314, + 19930, 52698, 11738, 44506, 28122, 60890, 7642, 40410, 24026, 56794, 15834, + 48602, 32218, 64986, 986, 33754, 17370, 50138, 9178, 41946, 25562, 58330, + 5082, 37850, 21466, 54234, 13274, 46042, 29658, 62426, 3034, 35802, 19418, + 52186, 11226, 43994, 27610, 60378, 7130, 39898, 23514, 56282, 15322, 48090, + 31706, 64474, 2010, 34778, 18394, 51162, 10202, 42970, 26586, 59354, 6106, + 38874, 22490, 55258, 14298, 47066, 30682, 63450, 4058, 36826, 20442, 53210, + 12250, 45018, 28634, 61402, 8154, 40922, 24538, 57306, 16346, 49114, 32730, + 65498, 58, 32826, 16442, 49210, 8250, 41018, 24634, 57402, 4154, 36922, + 20538, 53306, 12346, 45114, 28730, 61498, 2106, 34874, 18490, 51258, 10298, + 43066, 26682, 59450, 6202, 38970, 22586, 55354, 14394, 47162, 30778, 63546, + 1082, 33850, 17466, 50234, 9274, 42042, 25658, 58426, 5178, 37946, 21562, + 54330, 13370, 46138, 29754, 62522, 3130, 35898, 19514, 52282, 11322, 44090, + 27706, 60474, 7226, 39994, 23610, 56378, 15418, 48186, 31802, 64570, 570, + 33338, 16954, 49722, 8762, 41530, 25146, 57914, 4666, 37434, 21050, 53818, + 12858, 45626, 29242, 62010, 2618, 35386, 19002, 51770, 10810, 43578, 27194, + 59962, 6714, 39482, 23098, 55866, 14906, 47674, 31290, 64058, 1594, 34362, + 17978, 50746, 9786, 42554, 26170, 58938, 5690, 38458, 22074, 54842, 13882, + 46650, 30266, 63034, 3642, 36410, 20026, 52794, 11834, 44602, 28218, 60986, + 7738, 40506, 24122, 56890, 15930, 48698, 32314, 65082, 314, 33082, 16698, + 49466, 8506, 41274, 24890, 57658, 4410, 37178, 20794, 53562, 12602, 45370, + 28986, 61754, 2362, 35130, 18746, 51514, 10554, 43322, 26938, 59706, 6458, + 39226, 22842, 55610, 14650, 47418, 31034, 63802, 1338, 34106, 17722, 50490, + 9530, 42298, 25914, 58682, 5434, 38202, 21818, 54586, 13626, 46394, 30010, + 62778, 3386, 36154, 19770, 52538, 11578, 44346, 27962, 60730, 7482, 40250, + 23866, 56634, 15674, 48442, 32058, 64826, 826, 33594, 17210, 49978, 9018, + 41786, 25402, 58170, 4922, 37690, 21306, 54074, 13114, 45882, 29498, 62266, + 2874, 35642, 19258, 52026, 11066, 43834, 27450, 60218, 6970, 39738, 23354, + 56122, 15162, 47930, 31546, 64314, 1850, 34618, 18234, 51002, 10042, 42810, + 26426, 59194, 5946, 38714, 22330, 55098, 14138, 46906, 30522, 63290, 3898, + 36666, 20282, 53050, 12090, 44858, 28474, 61242, 7994, 40762, 24378, 57146, + 16186, 48954, 32570, 65338, 186, 32954, 16570, 49338, 8378, 41146, 24762, + 57530, 4282, 37050, 20666, 53434, 12474, 45242, 28858, 61626, 2234, 35002, + 18618, 51386, 10426, 43194, 26810, 59578, 6330, 39098, 22714, 55482, 14522, + 47290, 30906, 63674, 1210, 33978, 17594, 50362, 9402, 42170, 25786, 58554, + 5306, 38074, 21690, 54458, 13498, 46266, 29882, 62650, 3258, 36026, 19642, + 52410, 11450, 44218, 27834, 60602, 7354, 40122, 23738, 56506, 15546, 48314, + 31930, 64698, 698, 33466, 17082, 49850, 8890, 41658, 25274, 58042, 4794, + 37562, 21178, 53946, 12986, 45754, 29370, 62138, 2746, 35514, 19130, 51898, + 10938, 43706, 27322, 60090, 6842, 39610, 23226, 55994, 15034, 47802, 31418, + 64186, 1722, 34490, 18106, 50874, 9914, 42682, 26298, 59066, 5818, 38586, + 22202, 54970, 14010, 46778, 30394, 63162, 3770, 36538, 20154, 52922, 11962, + 44730, 28346, 61114, 7866, 40634, 24250, 57018, 16058, 48826, 32442, 65210, + 442, 33210, 16826, 49594, 8634, 41402, 25018, 57786, 4538, 37306, 20922, + 53690, 12730, 45498, 29114, 61882, 2490, 35258, 18874, 51642, 10682, 43450, + 27066, 59834, 6586, 39354, 22970, 55738, 14778, 47546, 31162, 63930, 1466, + 34234, 17850, 50618, 9658, 42426, 26042, 58810, 5562, 38330, 21946, 54714, + 13754, 46522, 30138, 62906, 3514, 36282, 19898, 52666, 11706, 44474, 28090, + 60858, 7610, 40378, 23994, 56762, 15802, 48570, 32186, 64954, 954, 33722, + 17338, 50106, 9146, 41914, 25530, 58298, 5050, 37818, 21434, 54202, 13242, + 46010, 29626, 62394, 3002, 35770, 19386, 52154, 11194, 43962, 27578, 60346, + 7098, 39866, 23482, 56250, 15290, 48058, 31674, 64442, 1978, 34746, 18362, + 51130, 10170, 42938, 26554, 59322, 6074, 38842, 22458, 55226, 14266, 47034, + 30650, 63418, 4026, 36794, 20410, 53178, 12218, 44986, 28602, 61370, 8122, + 40890, 24506, 57274, 16314, 49082, 32698, 65466, 122, 32890, 16506, 49274, + 8314, 41082, 24698, 57466, 4218, 36986, 20602, 53370, 12410, 45178, 28794, + 61562, 2170, 34938, 18554, 51322, 10362, 43130, 26746, 59514, 6266, 39034, + 22650, 55418, 14458, 47226, 30842, 63610, 1146, 33914, 17530, 50298, 9338, + 42106, 25722, 58490, 5242, 38010, 21626, 54394, 13434, 46202, 29818, 62586, + 3194, 35962, 19578, 52346, 11386, 44154, 27770, 60538, 7290, 40058, 23674, + 56442, 15482, 48250, 31866, 64634, 634, 33402, 17018, 49786, 8826, 41594, + 25210, 57978, 4730, 37498, 21114, 53882, 12922, 45690, 29306, 62074, 2682, + 35450, 19066, 51834, 10874, 43642, 27258, 60026, 6778, 39546, 23162, 55930, + 14970, 47738, 31354, 64122, 1658, 34426, 18042, 50810, 9850, 42618, 26234, + 59002, 5754, 38522, 22138, 54906, 13946, 46714, 30330, 63098, 3706, 36474, + 20090, 52858, 11898, 44666, 28282, 61050, 7802, 40570, 24186, 56954, 15994, + 48762, 32378, 65146, 378, 33146, 16762, 49530, 8570, 41338, 24954, 57722, + 4474, 37242, 20858, 53626, 12666, 45434, 29050, 61818, 2426, 35194, 18810, + 51578, 10618, 43386, 27002, 59770, 6522, 39290, 22906, 55674, 14714, 47482, + 31098, 63866, 1402, 34170, 17786, 50554, 9594, 42362, 25978, 58746, 5498, + 38266, 21882, 54650, 13690, 46458, 30074, 62842, 3450, 36218, 19834, 52602, + 11642, 44410, 28026, 60794, 7546, 40314, 23930, 56698, 15738, 48506, 32122, + 64890, 890, 33658, 17274, 50042, 9082, 41850, 25466, 58234, 4986, 37754, + 21370, 54138, 13178, 45946, 29562, 62330, 2938, 35706, 19322, 52090, 11130, + 43898, 27514, 60282, 7034, 39802, 23418, 56186, 15226, 47994, 31610, 64378, + 1914, 34682, 18298, 51066, 10106, 42874, 26490, 59258, 6010, 38778, 22394, + 55162, 14202, 46970, 30586, 63354, 3962, 36730, 20346, 53114, 12154, 44922, + 28538, 61306, 8058, 40826, 24442, 57210, 16250, 49018, 32634, 65402, 250, + 33018, 16634, 49402, 8442, 41210, 24826, 57594, 4346, 37114, 20730, 53498, + 12538, 45306, 28922, 61690, 2298, 35066, 18682, 51450, 10490, 43258, 26874, + 59642, 6394, 39162, 22778, 55546, 14586, 47354, 30970, 63738, 1274, 34042, + 17658, 50426, 9466, 42234, 25850, 58618, 5370, 38138, 21754, 54522, 13562, + 46330, 29946, 62714, 3322, 36090, 19706, 52474, 11514, 44282, 27898, 60666, + 7418, 40186, 23802, 56570, 15610, 48378, 31994, 64762, 762, 33530, 17146, + 49914, 8954, 41722, 25338, 58106, 4858, 37626, 21242, 54010, 13050, 45818, + 29434, 62202, 2810, 35578, 19194, 51962, 11002, 43770, 27386, 60154, 6906, + 39674, 23290, 56058, 15098, 47866, 31482, 64250, 1786, 34554, 18170, 50938, + 9978, 42746, 26362, 59130, 5882, 38650, 22266, 55034, 14074, 46842, 30458, + 63226, 3834, 36602, 20218, 52986, 12026, 44794, 28410, 61178, 7930, 40698, + 24314, 57082, 16122, 48890, 32506, 65274, 506, 33274, 16890, 49658, 8698, + 41466, 25082, 57850, 4602, 37370, 20986, 53754, 12794, 45562, 29178, 61946, + 2554, 35322, 18938, 51706, 10746, 43514, 27130, 59898, 6650, 39418, 23034, + 55802, 14842, 47610, 31226, 63994, 1530, 34298, 17914, 50682, 9722, 42490, + 26106, 58874, 5626, 38394, 22010, 54778, 13818, 46586, 30202, 62970, 3578, + 36346, 19962, 52730, 11770, 44538, 28154, 60922, 7674, 40442, 24058, 56826, + 15866, 48634, 32250, 65018, 1018, 33786, 17402, 50170, 9210, 41978, 25594, + 58362, 5114, 37882, 21498, 54266, 13306, 46074, 29690, 62458, 3066, 35834, + 19450, 52218, 11258, 44026, 27642, 60410, 7162, 39930, 23546, 56314, 15354, + 48122, 31738, 64506, 2042, 34810, 18426, 51194, 10234, 43002, 26618, 59386, + 6138, 38906, 22522, 55290, 14330, 47098, 30714, 63482, 4090, 36858, 20474, + 53242, 12282, 45050, 28666, 61434, 8186, 40954, 24570, 57338, 16378, 49146, + 32762, 65530, 6, 32774, 16390, 49158, 8198, 40966, 24582, 57350, 4102, + 36870, 20486, 53254, 12294, 45062, 28678, 61446, 2054, 34822, 18438, 51206, + 10246, 43014, 26630, 59398, 6150, 38918, 22534, 55302, 14342, 47110, 30726, + 63494, 1030, 33798, 17414, 50182, 9222, 41990, 25606, 58374, 5126, 37894, + 21510, 54278, 13318, 46086, 29702, 62470, 3078, 35846, 19462, 52230, 11270, + 44038, 27654, 60422, 7174, 39942, 23558, 56326, 15366, 48134, 31750, 64518, + 518, 33286, 16902, 49670, 8710, 41478, 25094, 57862, 4614, 37382, 20998, + 53766, 12806, 45574, 29190, 61958, 2566, 35334, 18950, 51718, 10758, 43526, + 27142, 59910, 6662, 39430, 23046, 55814, 14854, 47622, 31238, 64006, 1542, + 34310, 17926, 50694, 9734, 42502, 26118, 58886, 5638, 38406, 22022, 54790, + 13830, 46598, 30214, 62982, 3590, 36358, 19974, 52742, 11782, 44550, 28166, + 60934, 7686, 40454, 24070, 56838, 15878, 48646, 32262, 65030, 262, 33030, + 16646, 49414, 8454, 41222, 24838, 57606, 4358, 37126, 20742, 53510, 12550, + 45318, 28934, 61702, 2310, 35078, 18694, 51462, 10502, 43270, 26886, 59654, + 6406, 39174, 22790, 55558, 14598, 47366, 30982, 63750, 1286, 34054, 17670, + 50438, 9478, 42246, 25862, 58630, 5382, 38150, 21766, 54534, 13574, 46342, + 29958, 62726, 3334, 36102, 19718, 52486, 11526, 44294, 27910, 60678, 7430, + 40198, 23814, 56582, 15622, 48390, 32006, 64774, 774, 33542, 17158, 49926, + 8966, 41734, 25350, 58118, 4870, 37638, 21254, 54022, 13062, 45830, 29446, + 62214, 2822, 35590, 19206, 51974, 11014, 43782, 27398, 60166, 6918, 39686, + 23302, 56070, 15110, 47878, 31494, 64262, 1798, 34566, 18182, 50950, 9990, + 42758, 26374, 59142, 5894, 38662, 22278, 55046, 14086, 46854, 30470, 63238, + 3846, 36614, 20230, 52998, 12038, 44806, 28422, 61190, 7942, 40710, 24326, + 57094, 16134, 48902, 32518, 65286, 134, 32902, 16518, 49286, 8326, 41094, + 24710, 57478, 4230, 36998, 20614, 53382, 12422, 45190, 28806, 61574, 2182, + 34950, 18566, 51334, 10374, 43142, 26758, 59526, 6278, 39046, 22662, 55430, + 14470, 47238, 30854, 63622, 1158, 33926, 17542, 50310, 9350, 42118, 25734, + 58502, 5254, 38022, 21638, 54406, 13446, 46214, 29830, 62598, 3206, 35974, + 19590, 52358, 11398, 44166, 27782, 60550, 7302, 40070, 23686, 56454, 15494, + 48262, 31878, 64646, 646, 33414, 17030, 49798, 8838, 41606, 25222, 57990, + 4742, 37510, 21126, 53894, 12934, 45702, 29318, 62086, 2694, 35462, 19078, + 51846, 10886, 43654, 27270, 60038, 6790, 39558, 23174, 55942, 14982, 47750, + 31366, 64134, 1670, 34438, 18054, 50822, 9862, 42630, 26246, 59014, 5766, + 38534, 22150, 54918, 13958, 46726, 30342, 63110, 3718, 36486, 20102, 52870, + 11910, 44678, 28294, 61062, 7814, 40582, 24198, 56966, 16006, 48774, 32390, + 65158, 390, 33158, 16774, 49542, 8582, 41350, 24966, 57734, 4486, 37254, + 20870, 53638, 12678, 45446, 29062, 61830, 2438, 35206, 18822, 51590, 10630, + 43398, 27014, 59782, 6534, 39302, 22918, 55686, 14726, 47494, 31110, 63878, + 1414, 34182, 17798, 50566, 9606, 42374, 25990, 58758, 5510, 38278, 21894, + 54662, 13702, 46470, 30086, 62854, 3462, 36230, 19846, 52614, 11654, 44422, + 28038, 60806, 7558, 40326, 23942, 56710, 15750, 48518, 32134, 64902, 902, + 33670, 17286, 50054, 9094, 41862, 25478, 58246, 4998, 37766, 21382, 54150, + 13190, 45958, 29574, 62342, 2950, 35718, 19334, 52102, 11142, 43910, 27526, + 60294, 7046, 39814, 23430, 56198, 15238, 48006, 31622, 64390, 1926, 34694, + 18310, 51078, 10118, 42886, 26502, 59270, 6022, 38790, 22406, 55174, 14214, + 46982, 30598, 63366, 3974, 36742, 20358, 53126, 12166, 44934, 28550, 61318, + 8070, 40838, 24454, 57222, 16262, 49030, 32646, 65414, 70, 32838, 16454, + 49222, 8262, 41030, 24646, 57414, 4166, 36934, 20550, 53318, 12358, 45126, + 28742, 61510, 2118, 34886, 18502, 51270, 10310, 43078, 26694, 59462, 6214, + 38982, 22598, 55366, 14406, 47174, 30790, 63558, 1094, 33862, 17478, 50246, + 9286, 42054, 25670, 58438, 5190, 37958, 21574, 54342, 13382, 46150, 29766, + 62534, 3142, 35910, 19526, 52294, 11334, 44102, 27718, 60486, 7238, 40006, + 23622, 56390, 15430, 48198, 31814, 64582, 582, 33350, 16966, 49734, 8774, + 41542, 25158, 57926, 4678, 37446, 21062, 53830, 12870, 45638, 29254, 62022, + 2630, 35398, 19014, 51782, 10822, 43590, 27206, 59974, 6726, 39494, 23110, + 55878, 14918, 47686, 31302, 64070, 1606, 34374, 17990, 50758, 9798, 42566, + 26182, 58950, 5702, 38470, 22086, 54854, 13894, 46662, 30278, 63046, 3654, + 36422, 20038, 52806, 11846, 44614, 28230, 60998, 7750, 40518, 24134, 56902, + 15942, 48710, 32326, 65094, 326, 33094, 16710, 49478, 8518, 41286, 24902, + 57670, 4422, 37190, 20806, 53574, 12614, 45382, 28998, 61766, 2374, 35142, + 18758, 51526, 10566, 43334, 26950, 59718, 6470, 39238, 22854, 55622, 14662, + 47430, 31046, 63814, 1350, 34118, 17734, 50502, 9542, 42310, 25926, 58694, + 5446, 38214, 21830, 54598, 13638, 46406, 30022, 62790, 3398, 36166, 19782, + 52550, 11590, 44358, 27974, 60742, 7494, 40262, 23878, 56646, 15686, 48454, + 32070, 64838, 838, 33606, 17222, 49990, 9030, 41798, 25414, 58182, 4934, + 37702, 21318, 54086, 13126, 45894, 29510, 62278, 2886, 35654, 19270, 52038, + 11078, 43846, 27462, 60230, 6982, 39750, 23366, 56134, 15174, 47942, 31558, + 64326, 1862, 34630, 18246, 51014, 10054, 42822, 26438, 59206, 5958, 38726, + 22342, 55110, 14150, 46918, 30534, 63302, 3910, 36678, 20294, 53062, 12102, + 44870, 28486, 61254, 8006, 40774, 24390, 57158, 16198, 48966, 32582, 65350, + 198, 32966, 16582, 49350, 8390, 41158, 24774, 57542, 4294, 37062, 20678, + 53446, 12486, 45254, 28870, 61638, 2246, 35014, 18630, 51398, 10438, 43206, + 26822, 59590, 6342, 39110, 22726, 55494, 14534, 47302, 30918, 63686, 1222, + 33990, 17606, 50374, 9414, 42182, 25798, 58566, 5318, 38086, 21702, 54470, + 13510, 46278, 29894, 62662, 3270, 36038, 19654, 52422, 11462, 44230, 27846, + 60614, 7366, 40134, 23750, 56518, 15558, 48326, 31942, 64710, 710, 33478, + 17094, 49862, 8902, 41670, 25286, 58054, 4806, 37574, 21190, 53958, 12998, + 45766, 29382, 62150, 2758, 35526, 19142, 51910, 10950, 43718, 27334, 60102, + 6854, 39622, 23238, 56006, 15046, 47814, 31430, 64198, 1734, 34502, 18118, + 50886, 9926, 42694, 26310, 59078, 5830, 38598, 22214, 54982, 14022, 46790, + 30406, 63174, 3782, 36550, 20166, 52934, 11974, 44742, 28358, 61126, 7878, + 40646, 24262, 57030, 16070, 48838, 32454, 65222, 454, 33222, 16838, 49606, + 8646, 41414, 25030, 57798, 4550, 37318, 20934, 53702, 12742, 45510, 29126, + 61894, 2502, 35270, 18886, 51654, 10694, 43462, 27078, 59846, 6598, 39366, + 22982, 55750, 14790, 47558, 31174, 63942, 1478, 34246, 17862, 50630, 9670, + 42438, 26054, 58822, 5574, 38342, 21958, 54726, 13766, 46534, 30150, 62918, + 3526, 36294, 19910, 52678, 11718, 44486, 28102, 60870, 7622, 40390, 24006, + 56774, 15814, 48582, 32198, 64966, 966, 33734, 17350, 50118, 9158, 41926, + 25542, 58310, 5062, 37830, 21446, 54214, 13254, 46022, 29638, 62406, 3014, + 35782, 19398, 52166, 11206, 43974, 27590, 60358, 7110, 39878, 23494, 56262, + 15302, 48070, 31686, 64454, 1990, 34758, 18374, 51142, 10182, 42950, 26566, + 59334, 6086, 38854, 22470, 55238, 14278, 47046, 30662, 63430, 4038, 36806, + 20422, 53190, 12230, 44998, 28614, 61382, 8134, 40902, 24518, 57286, 16326, + 49094, 32710, 65478, 38, 32806, 16422, 49190, 8230, 40998, 24614, 57382, + 4134, 36902, 20518, 53286, 12326, 45094, 28710, 61478, 2086, 34854, 18470, + 51238, 10278, 43046, 26662, 59430, 6182, 38950, 22566, 55334, 14374, 47142, + 30758, 63526, 1062, 33830, 17446, 50214, 9254, 42022, 25638, 58406, 5158, + 37926, 21542, 54310, 13350, 46118, 29734, 62502, 3110, 35878, 19494, 52262, + 11302, 44070, 27686, 60454, 7206, 39974, 23590, 56358, 15398, 48166, 31782, + 64550, 550, 33318, 16934, 49702, 8742, 41510, 25126, 57894, 4646, 37414, + 21030, 53798, 12838, 45606, 29222, 61990, 2598, 35366, 18982, 51750, 10790, + 43558, 27174, 59942, 6694, 39462, 23078, 55846, 14886, 47654, 31270, 64038, + 1574, 34342, 17958, 50726, 9766, 42534, 26150, 58918, 5670, 38438, 22054, + 54822, 13862, 46630, 30246, 63014, 3622, 36390, 20006, 52774, 11814, 44582, + 28198, 60966, 7718, 40486, 24102, 56870, 15910, 48678, 32294, 65062, 294, + 33062, 16678, 49446, 8486, 41254, 24870, 57638, 4390, 37158, 20774, 53542, + 12582, 45350, 28966, 61734, 2342, 35110, 18726, 51494, 10534, 43302, 26918, + 59686, 6438, 39206, 22822, 55590, 14630, 47398, 31014, 63782, 1318, 34086, + 17702, 50470, 9510, 42278, 25894, 58662, 5414, 38182, 21798, 54566, 13606, + 46374, 29990, 62758, 3366, 36134, 19750, 52518, 11558, 44326, 27942, 60710, + 7462, 40230, 23846, 56614, 15654, 48422, 32038, 64806, 806, 33574, 17190, + 49958, 8998, 41766, 25382, 58150, 4902, 37670, 21286, 54054, 13094, 45862, + 29478, 62246, 2854, 35622, 19238, 52006, 11046, 43814, 27430, 60198, 6950, + 39718, 23334, 56102, 15142, 47910, 31526, 64294, 1830, 34598, 18214, 50982, + 10022, 42790, 26406, 59174, 5926, 38694, 22310, 55078, 14118, 46886, 30502, + 63270, 3878, 36646, 20262, 53030, 12070, 44838, 28454, 61222, 7974, 40742, + 24358, 57126, 16166, 48934, 32550, 65318, 166, 32934, 16550, 49318, 8358, + 41126, 24742, 57510, 4262, 37030, 20646, 53414, 12454, 45222, 28838, 61606, + 2214, 34982, 18598, 51366, 10406, 43174, 26790, 59558, 6310, 39078, 22694, + 55462, 14502, 47270, 30886, 63654, 1190, 33958, 17574, 50342, 9382, 42150, + 25766, 58534, 5286, 38054, 21670, 54438, 13478, 46246, 29862, 62630, 3238, + 36006, 19622, 52390, 11430, 44198, 27814, 60582, 7334, 40102, 23718, 56486, + 15526, 48294, 31910, 64678, 678, 33446, 17062, 49830, 8870, 41638, 25254, + 58022, 4774, 37542, 21158, 53926, 12966, 45734, 29350, 62118, 2726, 35494, + 19110, 51878, 10918, 43686, 27302, 60070, 6822, 39590, 23206, 55974, 15014, + 47782, 31398, 64166, 1702, 34470, 18086, 50854, 9894, 42662, 26278, 59046, + 5798, 38566, 22182, 54950, 13990, 46758, 30374, 63142, 3750, 36518, 20134, + 52902, 11942, 44710, 28326, 61094, 7846, 40614, 24230, 56998, 16038, 48806, + 32422, 65190, 422, 33190, 16806, 49574, 8614, 41382, 24998, 57766, 4518, + 37286, 20902, 53670, 12710, 45478, 29094, 61862, 2470, 35238, 18854, 51622, + 10662, 43430, 27046, 59814, 6566, 39334, 22950, 55718, 14758, 47526, 31142, + 63910, 1446, 34214, 17830, 50598, 9638, 42406, 26022, 58790, 5542, 38310, + 21926, 54694, 13734, 46502, 30118, 62886, 3494, 36262, 19878, 52646, 11686, + 44454, 28070, 60838, 7590, 40358, 23974, 56742, 15782, 48550, 32166, 64934, + 934, 33702, 17318, 50086, 9126, 41894, 25510, 58278, 5030, 37798, 21414, + 54182, 13222, 45990, 29606, 62374, 2982, 35750, 19366, 52134, 11174, 43942, + 27558, 60326, 7078, 39846, 23462, 56230, 15270, 48038, 31654, 64422, 1958, + 34726, 18342, 51110, 10150, 42918, 26534, 59302, 6054, 38822, 22438, 55206, + 14246, 47014, 30630, 63398, 4006, 36774, 20390, 53158, 12198, 44966, 28582, + 61350, 8102, 40870, 24486, 57254, 16294, 49062, 32678, 65446, 102, 32870, + 16486, 49254, 8294, 41062, 24678, 57446, 4198, 36966, 20582, 53350, 12390, + 45158, 28774, 61542, 2150, 34918, 18534, 51302, 10342, 43110, 26726, 59494, + 6246, 39014, 22630, 55398, 14438, 47206, 30822, 63590, 1126, 33894, 17510, + 50278, 9318, 42086, 25702, 58470, 5222, 37990, 21606, 54374, 13414, 46182, + 29798, 62566, 3174, 35942, 19558, 52326, 11366, 44134, 27750, 60518, 7270, + 40038, 23654, 56422, 15462, 48230, 31846, 64614, 614, 33382, 16998, 49766, + 8806, 41574, 25190, 57958, 4710, 37478, 21094, 53862, 12902, 45670, 29286, + 62054, 2662, 35430, 19046, 51814, 10854, 43622, 27238, 60006, 6758, 39526, + 23142, 55910, 14950, 47718, 31334, 64102, 1638, 34406, 18022, 50790, 9830, + 42598, 26214, 58982, 5734, 38502, 22118, 54886, 13926, 46694, 30310, 63078, + 3686, 36454, 20070, 52838, 11878, 44646, 28262, 61030, 7782, 40550, 24166, + 56934, 15974, 48742, 32358, 65126, 358, 33126, 16742, 49510, 8550, 41318, + 24934, 57702, 4454, 37222, 20838, 53606, 12646, 45414, 29030, 61798, 2406, + 35174, 18790, 51558, 10598, 43366, 26982, 59750, 6502, 39270, 22886, 55654, + 14694, 47462, 31078, 63846, 1382, 34150, 17766, 50534, 9574, 42342, 25958, + 58726, 5478, 38246, 21862, 54630, 13670, 46438, 30054, 62822, 3430, 36198, + 19814, 52582, 11622, 44390, 28006, 60774, 7526, 40294, 23910, 56678, 15718, + 48486, 32102, 64870, 870, 33638, 17254, 50022, 9062, 41830, 25446, 58214, + 4966, 37734, 21350, 54118, 13158, 45926, 29542, 62310, 2918, 35686, 19302, + 52070, 11110, 43878, 27494, 60262, 7014, 39782, 23398, 56166, 15206, 47974, + 31590, 64358, 1894, 34662, 18278, 51046, 10086, 42854, 26470, 59238, 5990, + 38758, 22374, 55142, 14182, 46950, 30566, 63334, 3942, 36710, 20326, 53094, + 12134, 44902, 28518, 61286, 8038, 40806, 24422, 57190, 16230, 48998, 32614, + 65382, 230, 32998, 16614, 49382, 8422, 41190, 24806, 57574, 4326, 37094, + 20710, 53478, 12518, 45286, 28902, 61670, 2278, 35046, 18662, 51430, 10470, + 43238, 26854, 59622, 6374, 39142, 22758, 55526, 14566, 47334, 30950, 63718, + 1254, 34022, 17638, 50406, 9446, 42214, 25830, 58598, 5350, 38118, 21734, + 54502, 13542, 46310, 29926, 62694, 3302, 36070, 19686, 52454, 11494, 44262, + 27878, 60646, 7398, 40166, 23782, 56550, 15590, 48358, 31974, 64742, 742, + 33510, 17126, 49894, 8934, 41702, 25318, 58086, 4838, 37606, 21222, 53990, + 13030, 45798, 29414, 62182, 2790, 35558, 19174, 51942, 10982, 43750, 27366, + 60134, 6886, 39654, 23270, 56038, 15078, 47846, 31462, 64230, 1766, 34534, + 18150, 50918, 9958, 42726, 26342, 59110, 5862, 38630, 22246, 55014, 14054, + 46822, 30438, 63206, 3814, 36582, 20198, 52966, 12006, 44774, 28390, 61158, + 7910, 40678, 24294, 57062, 16102, 48870, 32486, 65254, 486, 33254, 16870, + 49638, 8678, 41446, 25062, 57830, 4582, 37350, 20966, 53734, 12774, 45542, + 29158, 61926, 2534, 35302, 18918, 51686, 10726, 43494, 27110, 59878, 6630, + 39398, 23014, 55782, 14822, 47590, 31206, 63974, 1510, 34278, 17894, 50662, + 9702, 42470, 26086, 58854, 5606, 38374, 21990, 54758, 13798, 46566, 30182, + 62950, 3558, 36326, 19942, 52710, 11750, 44518, 28134, 60902, 7654, 40422, + 24038, 56806, 15846, 48614, 32230, 64998, 998, 33766, 17382, 50150, 9190, + 41958, 25574, 58342, 5094, 37862, 21478, 54246, 13286, 46054, 29670, 62438, + 3046, 35814, 19430, 52198, 11238, 44006, 27622, 60390, 7142, 39910, 23526, + 56294, 15334, 48102, 31718, 64486, 2022, 34790, 18406, 51174, 10214, 42982, + 26598, 59366, 6118, 38886, 22502, 55270, 14310, 47078, 30694, 63462, 4070, + 36838, 20454, 53222, 12262, 45030, 28646, 61414, 8166, 40934, 24550, 57318, + 16358, 49126, 32742, 65510, 22, 32790, 16406, 49174, 8214, 40982, 24598, + 57366, 4118, 36886, 20502, 53270, 12310, 45078, 28694, 61462, 2070, 34838, + 18454, 51222, 10262, 43030, 26646, 59414, 6166, 38934, 22550, 55318, 14358, + 47126, 30742, 63510, 1046, 33814, 17430, 50198, 9238, 42006, 25622, 58390, + 5142, 37910, 21526, 54294, 13334, 46102, 29718, 62486, 3094, 35862, 19478, + 52246, 11286, 44054, 27670, 60438, 7190, 39958, 23574, 56342, 15382, 48150, + 31766, 64534, 534, 33302, 16918, 49686, 8726, 41494, 25110, 57878, 4630, + 37398, 21014, 53782, 12822, 45590, 29206, 61974, 2582, 35350, 18966, 51734, + 10774, 43542, 27158, 59926, 6678, 39446, 23062, 55830, 14870, 47638, 31254, + 64022, 1558, 34326, 17942, 50710, 9750, 42518, 26134, 58902, 5654, 38422, + 22038, 54806, 13846, 46614, 30230, 62998, 3606, 36374, 19990, 52758, 11798, + 44566, 28182, 60950, 7702, 40470, 24086, 56854, 15894, 48662, 32278, 65046, + 278, 33046, 16662, 49430, 8470, 41238, 24854, 57622, 4374, 37142, 20758, + 53526, 12566, 45334, 28950, 61718, 2326, 35094, 18710, 51478, 10518, 43286, + 26902, 59670, 6422, 39190, 22806, 55574, 14614, 47382, 30998, 63766, 1302, + 34070, 17686, 50454, 9494, 42262, 25878, 58646, 5398, 38166, 21782, 54550, + 13590, 46358, 29974, 62742, 3350, 36118, 19734, 52502, 11542, 44310, 27926, + 60694, 7446, 40214, 23830, 56598, 15638, 48406, 32022, 64790, 790, 33558, + 17174, 49942, 8982, 41750, 25366, 58134, 4886, 37654, 21270, 54038, 13078, + 45846, 29462, 62230, 2838, 35606, 19222, 51990, 11030, 43798, 27414, 60182, + 6934, 39702, 23318, 56086, 15126, 47894, 31510, 64278, 1814, 34582, 18198, + 50966, 10006, 42774, 26390, 59158, 5910, 38678, 22294, 55062, 14102, 46870, + 30486, 63254, 3862, 36630, 20246, 53014, 12054, 44822, 28438, 61206, 7958, + 40726, 24342, 57110, 16150, 48918, 32534, 65302, 150, 32918, 16534, 49302, + 8342, 41110, 24726, 57494, 4246, 37014, 20630, 53398, 12438, 45206, 28822, + 61590, 2198, 34966, 18582, 51350, 10390, 43158, 26774, 59542, 6294, 39062, + 22678, 55446, 14486, 47254, 30870, 63638, 1174, 33942, 17558, 50326, 9366, + 42134, 25750, 58518, 5270, 38038, 21654, 54422, 13462, 46230, 29846, 62614, + 3222, 35990, 19606, 52374, 11414, 44182, 27798, 60566, 7318, 40086, 23702, + 56470, 15510, 48278, 31894, 64662, 662, 33430, 17046, 49814, 8854, 41622, + 25238, 58006, 4758, 37526, 21142, 53910, 12950, 45718, 29334, 62102, 2710, + 35478, 19094, 51862, 10902, 43670, 27286, 60054, 6806, 39574, 23190, 55958, + 14998, 47766, 31382, 64150, 1686, 34454, 18070, 50838, 9878, 42646, 26262, + 59030, 5782, 38550, 22166, 54934, 13974, 46742, 30358, 63126, 3734, 36502, + 20118, 52886, 11926, 44694, 28310, 61078, 7830, 40598, 24214, 56982, 16022, + 48790, 32406, 65174, 406, 33174, 16790, 49558, 8598, 41366, 24982, 57750, + 4502, 37270, 20886, 53654, 12694, 45462, 29078, 61846, 2454, 35222, 18838, + 51606, 10646, 43414, 27030, 59798, 6550, 39318, 22934, 55702, 14742, 47510, + 31126, 63894, 1430, 34198, 17814, 50582, 9622, 42390, 26006, 58774, 5526, + 38294, 21910, 54678, 13718, 46486, 30102, 62870, 3478, 36246, 19862, 52630, + 11670, 44438, 28054, 60822, 7574, 40342, 23958, 56726, 15766, 48534, 32150, + 64918, 918, 33686, 17302, 50070, 9110, 41878, 25494, 58262, 5014, 37782, + 21398, 54166, 13206, 45974, 29590, 62358, 2966, 35734, 19350, 52118, 11158, + 43926, 27542, 60310, 7062, 39830, 23446, 56214, 15254, 48022, 31638, 64406, + 1942, 34710, 18326, 51094, 10134, 42902, 26518, 59286, 6038, 38806, 22422, + 55190, 14230, 46998, 30614, 63382, 3990, 36758, 20374, 53142, 12182, 44950, + 28566, 61334, 8086, 40854, 24470, 57238, 16278, 49046, 32662, 65430, 86, + 32854, 16470, 49238, 8278, 41046, 24662, 57430, 4182, 36950, 20566, 53334, + 12374, 45142, 28758, 61526, 2134, 34902, 18518, 51286, 10326, 43094, 26710, + 59478, 6230, 38998, 22614, 55382, 14422, 47190, 30806, 63574, 1110, 33878, + 17494, 50262, 9302, 42070, 25686, 58454, 5206, 37974, 21590, 54358, 13398, + 46166, 29782, 62550, 3158, 35926, 19542, 52310, 11350, 44118, 27734, 60502, + 7254, 40022, 23638, 56406, 15446, 48214, 31830, 64598, 598, 33366, 16982, + 49750, 8790, 41558, 25174, 57942, 4694, 37462, 21078, 53846, 12886, 45654, + 29270, 62038, 2646, 35414, 19030, 51798, 10838, 43606, 27222, 59990, 6742, + 39510, 23126, 55894, 14934, 47702, 31318, 64086, 1622, 34390, 18006, 50774, + 9814, 42582, 26198, 58966, 5718, 38486, 22102, 54870, 13910, 46678, 30294, + 63062, 3670, 36438, 20054, 52822, 11862, 44630, 28246, 61014, 7766, 40534, + 24150, 56918, 15958, 48726, 32342, 65110, 342, 33110, 16726, 49494, 8534, + 41302, 24918, 57686, 4438, 37206, 20822, 53590, 12630, 45398, 29014, 61782, + 2390, 35158, 18774, 51542, 10582, 43350, 26966, 59734, 6486, 39254, 22870, + 55638, 14678, 47446, 31062, 63830, 1366, 34134, 17750, 50518, 9558, 42326, + 25942, 58710, 5462, 38230, 21846, 54614, 13654, 46422, 30038, 62806, 3414, + 36182, 19798, 52566, 11606, 44374, 27990, 60758, 7510, 40278, 23894, 56662, + 15702, 48470, 32086, 64854, 854, 33622, 17238, 50006, 9046, 41814, 25430, + 58198, 4950, 37718, 21334, 54102, 13142, 45910, 29526, 62294, 2902, 35670, + 19286, 52054, 11094, 43862, 27478, 60246, 6998, 39766, 23382, 56150, 15190, + 47958, 31574, 64342, 1878, 34646, 18262, 51030, 10070, 42838, 26454, 59222, + 5974, 38742, 22358, 55126, 14166, 46934, 30550, 63318, 3926, 36694, 20310, + 53078, 12118, 44886, 28502, 61270, 8022, 40790, 24406, 57174, 16214, 48982, + 32598, 65366, 214, 32982, 16598, 49366, 8406, 41174, 24790, 57558, 4310, + 37078, 20694, 53462, 12502, 45270, 28886, 61654, 2262, 35030, 18646, 51414, + 10454, 43222, 26838, 59606, 6358, 39126, 22742, 55510, 14550, 47318, 30934, + 63702, 1238, 34006, 17622, 50390, 9430, 42198, 25814, 58582, 5334, 38102, + 21718, 54486, 13526, 46294, 29910, 62678, 3286, 36054, 19670, 52438, 11478, + 44246, 27862, 60630, 7382, 40150, 23766, 56534, 15574, 48342, 31958, 64726, + 726, 33494, 17110, 49878, 8918, 41686, 25302, 58070, 4822, 37590, 21206, + 53974, 13014, 45782, 29398, 62166, 2774, 35542, 19158, 51926, 10966, 43734, + 27350, 60118, 6870, 39638, 23254, 56022, 15062, 47830, 31446, 64214, 1750, + 34518, 18134, 50902, 9942, 42710, 26326, 59094, 5846, 38614, 22230, 54998, + 14038, 46806, 30422, 63190, 3798, 36566, 20182, 52950, 11990, 44758, 28374, + 61142, 7894, 40662, 24278, 57046, 16086, 48854, 32470, 65238, 470, 33238, + 16854, 49622, 8662, 41430, 25046, 57814, 4566, 37334, 20950, 53718, 12758, + 45526, 29142, 61910, 2518, 35286, 18902, 51670, 10710, 43478, 27094, 59862, + 6614, 39382, 22998, 55766, 14806, 47574, 31190, 63958, 1494, 34262, 17878, + 50646, 9686, 42454, 26070, 58838, 5590, 38358, 21974, 54742, 13782, 46550, + 30166, 62934, 3542, 36310, 19926, 52694, 11734, 44502, 28118, 60886, 7638, + 40406, 24022, 56790, 15830, 48598, 32214, 64982, 982, 33750, 17366, 50134, + 9174, 41942, 25558, 58326, 5078, 37846, 21462, 54230, 13270, 46038, 29654, + 62422, 3030, 35798, 19414, 52182, 11222, 43990, 27606, 60374, 7126, 39894, + 23510, 56278, 15318, 48086, 31702, 64470, 2006, 34774, 18390, 51158, 10198, + 42966, 26582, 59350, 6102, 38870, 22486, 55254, 14294, 47062, 30678, 63446, + 4054, 36822, 20438, 53206, 12246, 45014, 28630, 61398, 8150, 40918, 24534, + 57302, 16342, 49110, 32726, 65494, 54, 32822, 16438, 49206, 8246, 41014, + 24630, 57398, 4150, 36918, 20534, 53302, 12342, 45110, 28726, 61494, 2102, + 34870, 18486, 51254, 10294, 43062, 26678, 59446, 6198, 38966, 22582, 55350, + 14390, 47158, 30774, 63542, 1078, 33846, 17462, 50230, 9270, 42038, 25654, + 58422, 5174, 37942, 21558, 54326, 13366, 46134, 29750, 62518, 3126, 35894, + 19510, 52278, 11318, 44086, 27702, 60470, 7222, 39990, 23606, 56374, 15414, + 48182, 31798, 64566, 566, 33334, 16950, 49718, 8758, 41526, 25142, 57910, + 4662, 37430, 21046, 53814, 12854, 45622, 29238, 62006, 2614, 35382, 18998, + 51766, 10806, 43574, 27190, 59958, 6710, 39478, 23094, 55862, 14902, 47670, + 31286, 64054, 1590, 34358, 17974, 50742, 9782, 42550, 26166, 58934, 5686, + 38454, 22070, 54838, 13878, 46646, 30262, 63030, 3638, 36406, 20022, 52790, + 11830, 44598, 28214, 60982, 7734, 40502, 24118, 56886, 15926, 48694, 32310, + 65078, 310, 33078, 16694, 49462, 8502, 41270, 24886, 57654, 4406, 37174, + 20790, 53558, 12598, 45366, 28982, 61750, 2358, 35126, 18742, 51510, 10550, + 43318, 26934, 59702, 6454, 39222, 22838, 55606, 14646, 47414, 31030, 63798, + 1334, 34102, 17718, 50486, 9526, 42294, 25910, 58678, 5430, 38198, 21814, + 54582, 13622, 46390, 30006, 62774, 3382, 36150, 19766, 52534, 11574, 44342, + 27958, 60726, 7478, 40246, 23862, 56630, 15670, 48438, 32054, 64822, 822, + 33590, 17206, 49974, 9014, 41782, 25398, 58166, 4918, 37686, 21302, 54070, + 13110, 45878, 29494, 62262, 2870, 35638, 19254, 52022, 11062, 43830, 27446, + 60214, 6966, 39734, 23350, 56118, 15158, 47926, 31542, 64310, 1846, 34614, + 18230, 50998, 10038, 42806, 26422, 59190, 5942, 38710, 22326, 55094, 14134, + 46902, 30518, 63286, 3894, 36662, 20278, 53046, 12086, 44854, 28470, 61238, + 7990, 40758, 24374, 57142, 16182, 48950, 32566, 65334, 182, 32950, 16566, + 49334, 8374, 41142, 24758, 57526, 4278, 37046, 20662, 53430, 12470, 45238, + 28854, 61622, 2230, 34998, 18614, 51382, 10422, 43190, 26806, 59574, 6326, + 39094, 22710, 55478, 14518, 47286, 30902, 63670, 1206, 33974, 17590, 50358, + 9398, 42166, 25782, 58550, 5302, 38070, 21686, 54454, 13494, 46262, 29878, + 62646, 3254, 36022, 19638, 52406, 11446, 44214, 27830, 60598, 7350, 40118, + 23734, 56502, 15542, 48310, 31926, 64694, 694, 33462, 17078, 49846, 8886, + 41654, 25270, 58038, 4790, 37558, 21174, 53942, 12982, 45750, 29366, 62134, + 2742, 35510, 19126, 51894, 10934, 43702, 27318, 60086, 6838, 39606, 23222, + 55990, 15030, 47798, 31414, 64182, 1718, 34486, 18102, 50870, 9910, 42678, + 26294, 59062, 5814, 38582, 22198, 54966, 14006, 46774, 30390, 63158, 3766, + 36534, 20150, 52918, 11958, 44726, 28342, 61110, 7862, 40630, 24246, 57014, + 16054, 48822, 32438, 65206, 438, 33206, 16822, 49590, 8630, 41398, 25014, + 57782, 4534, 37302, 20918, 53686, 12726, 45494, 29110, 61878, 2486, 35254, + 18870, 51638, 10678, 43446, 27062, 59830, 6582, 39350, 22966, 55734, 14774, + 47542, 31158, 63926, 1462, 34230, 17846, 50614, 9654, 42422, 26038, 58806, + 5558, 38326, 21942, 54710, 13750, 46518, 30134, 62902, 3510, 36278, 19894, + 52662, 11702, 44470, 28086, 60854, 7606, 40374, 23990, 56758, 15798, 48566, + 32182, 64950, 950, 33718, 17334, 50102, 9142, 41910, 25526, 58294, 5046, + 37814, 21430, 54198, 13238, 46006, 29622, 62390, 2998, 35766, 19382, 52150, + 11190, 43958, 27574, 60342, 7094, 39862, 23478, 56246, 15286, 48054, 31670, + 64438, 1974, 34742, 18358, 51126, 10166, 42934, 26550, 59318, 6070, 38838, + 22454, 55222, 14262, 47030, 30646, 63414, 4022, 36790, 20406, 53174, 12214, + 44982, 28598, 61366, 8118, 40886, 24502, 57270, 16310, 49078, 32694, 65462, + 118, 32886, 16502, 49270, 8310, 41078, 24694, 57462, 4214, 36982, 20598, + 53366, 12406, 45174, 28790, 61558, 2166, 34934, 18550, 51318, 10358, 43126, + 26742, 59510, 6262, 39030, 22646, 55414, 14454, 47222, 30838, 63606, 1142, + 33910, 17526, 50294, 9334, 42102, 25718, 58486, 5238, 38006, 21622, 54390, + 13430, 46198, 29814, 62582, 3190, 35958, 19574, 52342, 11382, 44150, 27766, + 60534, 7286, 40054, 23670, 56438, 15478, 48246, 31862, 64630, 630, 33398, + 17014, 49782, 8822, 41590, 25206, 57974, 4726, 37494, 21110, 53878, 12918, + 45686, 29302, 62070, 2678, 35446, 19062, 51830, 10870, 43638, 27254, 60022, + 6774, 39542, 23158, 55926, 14966, 47734, 31350, 64118, 1654, 34422, 18038, + 50806, 9846, 42614, 26230, 58998, 5750, 38518, 22134, 54902, 13942, 46710, + 30326, 63094, 3702, 36470, 20086, 52854, 11894, 44662, 28278, 61046, 7798, + 40566, 24182, 56950, 15990, 48758, 32374, 65142, 374, 33142, 16758, 49526, + 8566, 41334, 24950, 57718, 4470, 37238, 20854, 53622, 12662, 45430, 29046, + 61814, 2422, 35190, 18806, 51574, 10614, 43382, 26998, 59766, 6518, 39286, + 22902, 55670, 14710, 47478, 31094, 63862, 1398, 34166, 17782, 50550, 9590, + 42358, 25974, 58742, 5494, 38262, 21878, 54646, 13686, 46454, 30070, 62838, + 3446, 36214, 19830, 52598, 11638, 44406, 28022, 60790, 7542, 40310, 23926, + 56694, 15734, 48502, 32118, 64886, 886, 33654, 17270, 50038, 9078, 41846, + 25462, 58230, 4982, 37750, 21366, 54134, 13174, 45942, 29558, 62326, 2934, + 35702, 19318, 52086, 11126, 43894, 27510, 60278, 7030, 39798, 23414, 56182, + 15222, 47990, 31606, 64374, 1910, 34678, 18294, 51062, 10102, 42870, 26486, + 59254, 6006, 38774, 22390, 55158, 14198, 46966, 30582, 63350, 3958, 36726, + 20342, 53110, 12150, 44918, 28534, 61302, 8054, 40822, 24438, 57206, 16246, + 49014, 32630, 65398, 246, 33014, 16630, 49398, 8438, 41206, 24822, 57590, + 4342, 37110, 20726, 53494, 12534, 45302, 28918, 61686, 2294, 35062, 18678, + 51446, 10486, 43254, 26870, 59638, 6390, 39158, 22774, 55542, 14582, 47350, + 30966, 63734, 1270, 34038, 17654, 50422, 9462, 42230, 25846, 58614, 5366, + 38134, 21750, 54518, 13558, 46326, 29942, 62710, 3318, 36086, 19702, 52470, + 11510, 44278, 27894, 60662, 7414, 40182, 23798, 56566, 15606, 48374, 31990, + 64758, 758, 33526, 17142, 49910, 8950, 41718, 25334, 58102, 4854, 37622, + 21238, 54006, 13046, 45814, 29430, 62198, 2806, 35574, 19190, 51958, 10998, + 43766, 27382, 60150, 6902, 39670, 23286, 56054, 15094, 47862, 31478, 64246, + 1782, 34550, 18166, 50934, 9974, 42742, 26358, 59126, 5878, 38646, 22262, + 55030, 14070, 46838, 30454, 63222, 3830, 36598, 20214, 52982, 12022, 44790, + 28406, 61174, 7926, 40694, 24310, 57078, 16118, 48886, 32502, 65270, 502, + 33270, 16886, 49654, 8694, 41462, 25078, 57846, 4598, 37366, 20982, 53750, + 12790, 45558, 29174, 61942, 2550, 35318, 18934, 51702, 10742, 43510, 27126, + 59894, 6646, 39414, 23030, 55798, 14838, 47606, 31222, 63990, 1526, 34294, + 17910, 50678, 9718, 42486, 26102, 58870, 5622, 38390, 22006, 54774, 13814, + 46582, 30198, 62966, 3574, 36342, 19958, 52726, 11766, 44534, 28150, 60918, + 7670, 40438, 24054, 56822, 15862, 48630, 32246, 65014, 1014, 33782, 17398, + 50166, 9206, 41974, 25590, 58358, 5110, 37878, 21494, 54262, 13302, 46070, + 29686, 62454, 3062, 35830, 19446, 52214, 11254, 44022, 27638, 60406, 7158, + 39926, 23542, 56310, 15350, 48118, 31734, 64502, 2038, 34806, 18422, 51190, + 10230, 42998, 26614, 59382, 6134, 38902, 22518, 55286, 14326, 47094, 30710, + 63478, 4086, 36854, 20470, 53238, 12278, 45046, 28662, 61430, 8182, 40950, + 24566, 57334, 16374, 49142, 32758, 65526, 14, 32782, 16398, 49166, 8206, + 40974, 24590, 57358, 4110, 36878, 20494, 53262, 12302, 45070, 28686, 61454, + 2062, 34830, 18446, 51214, 10254, 43022, 26638, 59406, 6158, 38926, 22542, + 55310, 14350, 47118, 30734, 63502, 1038, 33806, 17422, 50190, 9230, 41998, + 25614, 58382, 5134, 37902, 21518, 54286, 13326, 46094, 29710, 62478, 3086, + 35854, 19470, 52238, 11278, 44046, 27662, 60430, 7182, 39950, 23566, 56334, + 15374, 48142, 31758, 64526, 526, 33294, 16910, 49678, 8718, 41486, 25102, + 57870, 4622, 37390, 21006, 53774, 12814, 45582, 29198, 61966, 2574, 35342, + 18958, 51726, 10766, 43534, 27150, 59918, 6670, 39438, 23054, 55822, 14862, + 47630, 31246, 64014, 1550, 34318, 17934, 50702, 9742, 42510, 26126, 58894, + 5646, 38414, 22030, 54798, 13838, 46606, 30222, 62990, 3598, 36366, 19982, + 52750, 11790, 44558, 28174, 60942, 7694, 40462, 24078, 56846, 15886, 48654, + 32270, 65038, 270, 33038, 16654, 49422, 8462, 41230, 24846, 57614, 4366, + 37134, 20750, 53518, 12558, 45326, 28942, 61710, 2318, 35086, 18702, 51470, + 10510, 43278, 26894, 59662, 6414, 39182, 22798, 55566, 14606, 47374, 30990, + 63758, 1294, 34062, 17678, 50446, 9486, 42254, 25870, 58638, 5390, 38158, + 21774, 54542, 13582, 46350, 29966, 62734, 3342, 36110, 19726, 52494, 11534, + 44302, 27918, 60686, 7438, 40206, 23822, 56590, 15630, 48398, 32014, 64782, + 782, 33550, 17166, 49934, 8974, 41742, 25358, 58126, 4878, 37646, 21262, + 54030, 13070, 45838, 29454, 62222, 2830, 35598, 19214, 51982, 11022, 43790, + 27406, 60174, 6926, 39694, 23310, 56078, 15118, 47886, 31502, 64270, 1806, + 34574, 18190, 50958, 9998, 42766, 26382, 59150, 5902, 38670, 22286, 55054, + 14094, 46862, 30478, 63246, 3854, 36622, 20238, 53006, 12046, 44814, 28430, + 61198, 7950, 40718, 24334, 57102, 16142, 48910, 32526, 65294, 142, 32910, + 16526, 49294, 8334, 41102, 24718, 57486, 4238, 37006, 20622, 53390, 12430, + 45198, 28814, 61582, 2190, 34958, 18574, 51342, 10382, 43150, 26766, 59534, + 6286, 39054, 22670, 55438, 14478, 47246, 30862, 63630, 1166, 33934, 17550, + 50318, 9358, 42126, 25742, 58510, 5262, 38030, 21646, 54414, 13454, 46222, + 29838, 62606, 3214, 35982, 19598, 52366, 11406, 44174, 27790, 60558, 7310, + 40078, 23694, 56462, 15502, 48270, 31886, 64654, 654, 33422, 17038, 49806, + 8846, 41614, 25230, 57998, 4750, 37518, 21134, 53902, 12942, 45710, 29326, + 62094, 2702, 35470, 19086, 51854, 10894, 43662, 27278, 60046, 6798, 39566, + 23182, 55950, 14990, 47758, 31374, 64142, 1678, 34446, 18062, 50830, 9870, + 42638, 26254, 59022, 5774, 38542, 22158, 54926, 13966, 46734, 30350, 63118, + 3726, 36494, 20110, 52878, 11918, 44686, 28302, 61070, 7822, 40590, 24206, + 56974, 16014, 48782, 32398, 65166, 398, 33166, 16782, 49550, 8590, 41358, + 24974, 57742, 4494, 37262, 20878, 53646, 12686, 45454, 29070, 61838, 2446, + 35214, 18830, 51598, 10638, 43406, 27022, 59790, 6542, 39310, 22926, 55694, + 14734, 47502, 31118, 63886, 1422, 34190, 17806, 50574, 9614, 42382, 25998, + 58766, 5518, 38286, 21902, 54670, 13710, 46478, 30094, 62862, 3470, 36238, + 19854, 52622, 11662, 44430, 28046, 60814, 7566, 40334, 23950, 56718, 15758, + 48526, 32142, 64910, 910, 33678, 17294, 50062, 9102, 41870, 25486, 58254, + 5006, 37774, 21390, 54158, 13198, 45966, 29582, 62350, 2958, 35726, 19342, + 52110, 11150, 43918, 27534, 60302, 7054, 39822, 23438, 56206, 15246, 48014, + 31630, 64398, 1934, 34702, 18318, 51086, 10126, 42894, 26510, 59278, 6030, + 38798, 22414, 55182, 14222, 46990, 30606, 63374, 3982, 36750, 20366, 53134, + 12174, 44942, 28558, 61326, 8078, 40846, 24462, 57230, 16270, 49038, 32654, + 65422, 78, 32846, 16462, 49230, 8270, 41038, 24654, 57422, 4174, 36942, + 20558, 53326, 12366, 45134, 28750, 61518, 2126, 34894, 18510, 51278, 10318, + 43086, 26702, 59470, 6222, 38990, 22606, 55374, 14414, 47182, 30798, 63566, + 1102, 33870, 17486, 50254, 9294, 42062, 25678, 58446, 5198, 37966, 21582, + 54350, 13390, 46158, 29774, 62542, 3150, 35918, 19534, 52302, 11342, 44110, + 27726, 60494, 7246, 40014, 23630, 56398, 15438, 48206, 31822, 64590, 590, + 33358, 16974, 49742, 8782, 41550, 25166, 57934, 4686, 37454, 21070, 53838, + 12878, 45646, 29262, 62030, 2638, 35406, 19022, 51790, 10830, 43598, 27214, + 59982, 6734, 39502, 23118, 55886, 14926, 47694, 31310, 64078, 1614, 34382, + 17998, 50766, 9806, 42574, 26190, 58958, 5710, 38478, 22094, 54862, 13902, + 46670, 30286, 63054, 3662, 36430, 20046, 52814, 11854, 44622, 28238, 61006, + 7758, 40526, 24142, 56910, 15950, 48718, 32334, 65102, 334, 33102, 16718, + 49486, 8526, 41294, 24910, 57678, 4430, 37198, 20814, 53582, 12622, 45390, + 29006, 61774, 2382, 35150, 18766, 51534, 10574, 43342, 26958, 59726, 6478, + 39246, 22862, 55630, 14670, 47438, 31054, 63822, 1358, 34126, 17742, 50510, + 9550, 42318, 25934, 58702, 5454, 38222, 21838, 54606, 13646, 46414, 30030, + 62798, 3406, 36174, 19790, 52558, 11598, 44366, 27982, 60750, 7502, 40270, + 23886, 56654, 15694, 48462, 32078, 64846, 846, 33614, 17230, 49998, 9038, + 41806, 25422, 58190, 4942, 37710, 21326, 54094, 13134, 45902, 29518, 62286, + 2894, 35662, 19278, 52046, 11086, 43854, 27470, 60238, 6990, 39758, 23374, + 56142, 15182, 47950, 31566, 64334, 1870, 34638, 18254, 51022, 10062, 42830, + 26446, 59214, 5966, 38734, 22350, 55118, 14158, 46926, 30542, 63310, 3918, + 36686, 20302, 53070, 12110, 44878, 28494, 61262, 8014, 40782, 24398, 57166, + 16206, 48974, 32590, 65358, 206, 32974, 16590, 49358, 8398, 41166, 24782, + 57550, 4302, 37070, 20686, 53454, 12494, 45262, 28878, 61646, 2254, 35022, + 18638, 51406, 10446, 43214, 26830, 59598, 6350, 39118, 22734, 55502, 14542, + 47310, 30926, 63694, 1230, 33998, 17614, 50382, 9422, 42190, 25806, 58574, + 5326, 38094, 21710, 54478, 13518, 46286, 29902, 62670, 3278, 36046, 19662, + 52430, 11470, 44238, 27854, 60622, 7374, 40142, 23758, 56526, 15566, 48334, + 31950, 64718, 718, 33486, 17102, 49870, 8910, 41678, 25294, 58062, 4814, + 37582, 21198, 53966, 13006, 45774, 29390, 62158, 2766, 35534, 19150, 51918, + 10958, 43726, 27342, 60110, 6862, 39630, 23246, 56014, 15054, 47822, 31438, + 64206, 1742, 34510, 18126, 50894, 9934, 42702, 26318, 59086, 5838, 38606, + 22222, 54990, 14030, 46798, 30414, 63182, 3790, 36558, 20174, 52942, 11982, + 44750, 28366, 61134, 7886, 40654, 24270, 57038, 16078, 48846, 32462, 65230, + 462, 33230, 16846, 49614, 8654, 41422, 25038, 57806, 4558, 37326, 20942, + 53710, 12750, 45518, 29134, 61902, 2510, 35278, 18894, 51662, 10702, 43470, + 27086, 59854, 6606, 39374, 22990, 55758, 14798, 47566, 31182, 63950, 1486, + 34254, 17870, 50638, 9678, 42446, 26062, 58830, 5582, 38350, 21966, 54734, + 13774, 46542, 30158, 62926, 3534, 36302, 19918, 52686, 11726, 44494, 28110, + 60878, 7630, 40398, 24014, 56782, 15822, 48590, 32206, 64974, 974, 33742, + 17358, 50126, 9166, 41934, 25550, 58318, 5070, 37838, 21454, 54222, 13262, + 46030, 29646, 62414, 3022, 35790, 19406, 52174, 11214, 43982, 27598, 60366, + 7118, 39886, 23502, 56270, 15310, 48078, 31694, 64462, 1998, 34766, 18382, + 51150, 10190, 42958, 26574, 59342, 6094, 38862, 22478, 55246, 14286, 47054, + 30670, 63438, 4046, 36814, 20430, 53198, 12238, 45006, 28622, 61390, 8142, + 40910, 24526, 57294, 16334, 49102, 32718, 65486, 46, 32814, 16430, 49198, + 8238, 41006, 24622, 57390, 4142, 36910, 20526, 53294, 12334, 45102, 28718, + 61486, 2094, 34862, 18478, 51246, 10286, 43054, 26670, 59438, 6190, 38958, + 22574, 55342, 14382, 47150, 30766, 63534, 1070, 33838, 17454, 50222, 9262, + 42030, 25646, 58414, 5166, 37934, 21550, 54318, 13358, 46126, 29742, 62510, + 3118, 35886, 19502, 52270, 11310, 44078, 27694, 60462, 7214, 39982, 23598, + 56366, 15406, 48174, 31790, 64558, 558, 33326, 16942, 49710, 8750, 41518, + 25134, 57902, 4654, 37422, 21038, 53806, 12846, 45614, 29230, 61998, 2606, + 35374, 18990, 51758, 10798, 43566, 27182, 59950, 6702, 39470, 23086, 55854, + 14894, 47662, 31278, 64046, 1582, 34350, 17966, 50734, 9774, 42542, 26158, + 58926, 5678, 38446, 22062, 54830, 13870, 46638, 30254, 63022, 3630, 36398, + 20014, 52782, 11822, 44590, 28206, 60974, 7726, 40494, 24110, 56878, 15918, + 48686, 32302, 65070, 302, 33070, 16686, 49454, 8494, 41262, 24878, 57646, + 4398, 37166, 20782, 53550, 12590, 45358, 28974, 61742, 2350, 35118, 18734, + 51502, 10542, 43310, 26926, 59694, 6446, 39214, 22830, 55598, 14638, 47406, + 31022, 63790, 1326, 34094, 17710, 50478, 9518, 42286, 25902, 58670, 5422, + 38190, 21806, 54574, 13614, 46382, 29998, 62766, 3374, 36142, 19758, 52526, + 11566, 44334, 27950, 60718, 7470, 40238, 23854, 56622, 15662, 48430, 32046, + 64814, 814, 33582, 17198, 49966, 9006, 41774, 25390, 58158, 4910, 37678, + 21294, 54062, 13102, 45870, 29486, 62254, 2862, 35630, 19246, 52014, 11054, + 43822, 27438, 60206, 6958, 39726, 23342, 56110, 15150, 47918, 31534, 64302, + 1838, 34606, 18222, 50990, 10030, 42798, 26414, 59182, 5934, 38702, 22318, + 55086, 14126, 46894, 30510, 63278, 3886, 36654, 20270, 53038, 12078, 44846, + 28462, 61230, 7982, 40750, 24366, 57134, 16174, 48942, 32558, 65326, 174, + 32942, 16558, 49326, 8366, 41134, 24750, 57518, 4270, 37038, 20654, 53422, + 12462, 45230, 28846, 61614, 2222, 34990, 18606, 51374, 10414, 43182, 26798, + 59566, 6318, 39086, 22702, 55470, 14510, 47278, 30894, 63662, 1198, 33966, + 17582, 50350, 9390, 42158, 25774, 58542, 5294, 38062, 21678, 54446, 13486, + 46254, 29870, 62638, 3246, 36014, 19630, 52398, 11438, 44206, 27822, 60590, + 7342, 40110, 23726, 56494, 15534, 48302, 31918, 64686, 686, 33454, 17070, + 49838, 8878, 41646, 25262, 58030, 4782, 37550, 21166, 53934, 12974, 45742, + 29358, 62126, 2734, 35502, 19118, 51886, 10926, 43694, 27310, 60078, 6830, + 39598, 23214, 55982, 15022, 47790, 31406, 64174, 1710, 34478, 18094, 50862, + 9902, 42670, 26286, 59054, 5806, 38574, 22190, 54958, 13998, 46766, 30382, + 63150, 3758, 36526, 20142, 52910, 11950, 44718, 28334, 61102, 7854, 40622, + 24238, 57006, 16046, 48814, 32430, 65198, 430, 33198, 16814, 49582, 8622, + 41390, 25006, 57774, 4526, 37294, 20910, 53678, 12718, 45486, 29102, 61870, + 2478, 35246, 18862, 51630, 10670, 43438, 27054, 59822, 6574, 39342, 22958, + 55726, 14766, 47534, 31150, 63918, 1454, 34222, 17838, 50606, 9646, 42414, + 26030, 58798, 5550, 38318, 21934, 54702, 13742, 46510, 30126, 62894, 3502, + 36270, 19886, 52654, 11694, 44462, 28078, 60846, 7598, 40366, 23982, 56750, + 15790, 48558, 32174, 64942, 942, 33710, 17326, 50094, 9134, 41902, 25518, + 58286, 5038, 37806, 21422, 54190, 13230, 45998, 29614, 62382, 2990, 35758, + 19374, 52142, 11182, 43950, 27566, 60334, 7086, 39854, 23470, 56238, 15278, + 48046, 31662, 64430, 1966, 34734, 18350, 51118, 10158, 42926, 26542, 59310, + 6062, 38830, 22446, 55214, 14254, 47022, 30638, 63406, 4014, 36782, 20398, + 53166, 12206, 44974, 28590, 61358, 8110, 40878, 24494, 57262, 16302, 49070, + 32686, 65454, 110, 32878, 16494, 49262, 8302, 41070, 24686, 57454, 4206, + 36974, 20590, 53358, 12398, 45166, 28782, 61550, 2158, 34926, 18542, 51310, + 10350, 43118, 26734, 59502, 6254, 39022, 22638, 55406, 14446, 47214, 30830, + 63598, 1134, 33902, 17518, 50286, 9326, 42094, 25710, 58478, 5230, 37998, + 21614, 54382, 13422, 46190, 29806, 62574, 3182, 35950, 19566, 52334, 11374, + 44142, 27758, 60526, 7278, 40046, 23662, 56430, 15470, 48238, 31854, 64622, + 622, 33390, 17006, 49774, 8814, 41582, 25198, 57966, 4718, 37486, 21102, + 53870, 12910, 45678, 29294, 62062, 2670, 35438, 19054, 51822, 10862, 43630, + 27246, 60014, 6766, 39534, 23150, 55918, 14958, 47726, 31342, 64110, 1646, + 34414, 18030, 50798, 9838, 42606, 26222, 58990, 5742, 38510, 22126, 54894, + 13934, 46702, 30318, 63086, 3694, 36462, 20078, 52846, 11886, 44654, 28270, + 61038, 7790, 40558, 24174, 56942, 15982, 48750, 32366, 65134, 366, 33134, + 16750, 49518, 8558, 41326, 24942, 57710, 4462, 37230, 20846, 53614, 12654, + 45422, 29038, 61806, 2414, 35182, 18798, 51566, 10606, 43374, 26990, 59758, + 6510, 39278, 22894, 55662, 14702, 47470, 31086, 63854, 1390, 34158, 17774, + 50542, 9582, 42350, 25966, 58734, 5486, 38254, 21870, 54638, 13678, 46446, + 30062, 62830, 3438, 36206, 19822, 52590, 11630, 44398, 28014, 60782, 7534, + 40302, 23918, 56686, 15726, 48494, 32110, 64878, 878, 33646, 17262, 50030, + 9070, 41838, 25454, 58222, 4974, 37742, 21358, 54126, 13166, 45934, 29550, + 62318, 2926, 35694, 19310, 52078, 11118, 43886, 27502, 60270, 7022, 39790, + 23406, 56174, 15214, 47982, 31598, 64366, 1902, 34670, 18286, 51054, 10094, + 42862, 26478, 59246, 5998, 38766, 22382, 55150, 14190, 46958, 30574, 63342, + 3950, 36718, 20334, 53102, 12142, 44910, 28526, 61294, 8046, 40814, 24430, + 57198, 16238, 49006, 32622, 65390, 238, 33006, 16622, 49390, 8430, 41198, + 24814, 57582, 4334, 37102, 20718, 53486, 12526, 45294, 28910, 61678, 2286, + 35054, 18670, 51438, 10478, 43246, 26862, 59630, 6382, 39150, 22766, 55534, + 14574, 47342, 30958, 63726, 1262, 34030, 17646, 50414, 9454, 42222, 25838, + 58606, 5358, 38126, 21742, 54510, 13550, 46318, 29934, 62702, 3310, 36078, + 19694, 52462, 11502, 44270, 27886, 60654, 7406, 40174, 23790, 56558, 15598, + 48366, 31982, 64750, 750, 33518, 17134, 49902, 8942, 41710, 25326, 58094, + 4846, 37614, 21230, 53998, 13038, 45806, 29422, 62190, 2798, 35566, 19182, + 51950, 10990, 43758, 27374, 60142, 6894, 39662, 23278, 56046, 15086, 47854, + 31470, 64238, 1774, 34542, 18158, 50926, 9966, 42734, 26350, 59118, 5870, + 38638, 22254, 55022, 14062, 46830, 30446, 63214, 3822, 36590, 20206, 52974, + 12014, 44782, 28398, 61166, 7918, 40686, 24302, 57070, 16110, 48878, 32494, + 65262, 494, 33262, 16878, 49646, 8686, 41454, 25070, 57838, 4590, 37358, + 20974, 53742, 12782, 45550, 29166, 61934, 2542, 35310, 18926, 51694, 10734, + 43502, 27118, 59886, 6638, 39406, 23022, 55790, 14830, 47598, 31214, 63982, + 1518, 34286, 17902, 50670, 9710, 42478, 26094, 58862, 5614, 38382, 21998, + 54766, 13806, 46574, 30190, 62958, 3566, 36334, 19950, 52718, 11758, 44526, + 28142, 60910, 7662, 40430, 24046, 56814, 15854, 48622, 32238, 65006, 1006, + 33774, 17390, 50158, 9198, 41966, 25582, 58350, 5102, 37870, 21486, 54254, + 13294, 46062, 29678, 62446, 3054, 35822, 19438, 52206, 11246, 44014, 27630, + 60398, 7150, 39918, 23534, 56302, 15342, 48110, 31726, 64494, 2030, 34798, + 18414, 51182, 10222, 42990, 26606, 59374, 6126, 38894, 22510, 55278, 14318, + 47086, 30702, 63470, 4078, 36846, 20462, 53230, 12270, 45038, 28654, 61422, + 8174, 40942, 24558, 57326, 16366, 49134, 32750, 65518, 30, 32798, 16414, + 49182, 8222, 40990, 24606, 57374, 4126, 36894, 20510, 53278, 12318, 45086, + 28702, 61470, 2078, 34846, 18462, 51230, 10270, 43038, 26654, 59422, 6174, + 38942, 22558, 55326, 14366, 47134, 30750, 63518, 1054, 33822, 17438, 50206, + 9246, 42014, 25630, 58398, 5150, 37918, 21534, 54302, 13342, 46110, 29726, + 62494, 3102, 35870, 19486, 52254, 11294, 44062, 27678, 60446, 7198, 39966, + 23582, 56350, 15390, 48158, 31774, 64542, 542, 33310, 16926, 49694, 8734, + 41502, 25118, 57886, 4638, 37406, 21022, 53790, 12830, 45598, 29214, 61982, + 2590, 35358, 18974, 51742, 10782, 43550, 27166, 59934, 6686, 39454, 23070, + 55838, 14878, 47646, 31262, 64030, 1566, 34334, 17950, 50718, 9758, 42526, + 26142, 58910, 5662, 38430, 22046, 54814, 13854, 46622, 30238, 63006, 3614, + 36382, 19998, 52766, 11806, 44574, 28190, 60958, 7710, 40478, 24094, 56862, + 15902, 48670, 32286, 65054, 286, 33054, 16670, 49438, 8478, 41246, 24862, + 57630, 4382, 37150, 20766, 53534, 12574, 45342, 28958, 61726, 2334, 35102, + 18718, 51486, 10526, 43294, 26910, 59678, 6430, 39198, 22814, 55582, 14622, + 47390, 31006, 63774, 1310, 34078, 17694, 50462, 9502, 42270, 25886, 58654, + 5406, 38174, 21790, 54558, 13598, 46366, 29982, 62750, 3358, 36126, 19742, + 52510, 11550, 44318, 27934, 60702, 7454, 40222, 23838, 56606, 15646, 48414, + 32030, 64798, 798, 33566, 17182, 49950, 8990, 41758, 25374, 58142, 4894, + 37662, 21278, 54046, 13086, 45854, 29470, 62238, 2846, 35614, 19230, 51998, + 11038, 43806, 27422, 60190, 6942, 39710, 23326, 56094, 15134, 47902, 31518, + 64286, 1822, 34590, 18206, 50974, 10014, 42782, 26398, 59166, 5918, 38686, + 22302, 55070, 14110, 46878, 30494, 63262, 3870, 36638, 20254, 53022, 12062, + 44830, 28446, 61214, 7966, 40734, 24350, 57118, 16158, 48926, 32542, 65310, + 158, 32926, 16542, 49310, 8350, 41118, 24734, 57502, 4254, 37022, 20638, + 53406, 12446, 45214, 28830, 61598, 2206, 34974, 18590, 51358, 10398, 43166, + 26782, 59550, 6302, 39070, 22686, 55454, 14494, 47262, 30878, 63646, 1182, + 33950, 17566, 50334, 9374, 42142, 25758, 58526, 5278, 38046, 21662, 54430, + 13470, 46238, 29854, 62622, 3230, 35998, 19614, 52382, 11422, 44190, 27806, + 60574, 7326, 40094, 23710, 56478, 15518, 48286, 31902, 64670, 670, 33438, + 17054, 49822, 8862, 41630, 25246, 58014, 4766, 37534, 21150, 53918, 12958, + 45726, 29342, 62110, 2718, 35486, 19102, 51870, 10910, 43678, 27294, 60062, + 6814, 39582, 23198, 55966, 15006, 47774, 31390, 64158, 1694, 34462, 18078, + 50846, 9886, 42654, 26270, 59038, 5790, 38558, 22174, 54942, 13982, 46750, + 30366, 63134, 3742, 36510, 20126, 52894, 11934, 44702, 28318, 61086, 7838, + 40606, 24222, 56990, 16030, 48798, 32414, 65182, 414, 33182, 16798, 49566, + 8606, 41374, 24990, 57758, 4510, 37278, 20894, 53662, 12702, 45470, 29086, + 61854, 2462, 35230, 18846, 51614, 10654, 43422, 27038, 59806, 6558, 39326, + 22942, 55710, 14750, 47518, 31134, 63902, 1438, 34206, 17822, 50590, 9630, + 42398, 26014, 58782, 5534, 38302, 21918, 54686, 13726, 46494, 30110, 62878, + 3486, 36254, 19870, 52638, 11678, 44446, 28062, 60830, 7582, 40350, 23966, + 56734, 15774, 48542, 32158, 64926, 926, 33694, 17310, 50078, 9118, 41886, + 25502, 58270, 5022, 37790, 21406, 54174, 13214, 45982, 29598, 62366, 2974, + 35742, 19358, 52126, 11166, 43934, 27550, 60318, 7070, 39838, 23454, 56222, + 15262, 48030, 31646, 64414, 1950, 34718, 18334, 51102, 10142, 42910, 26526, + 59294, 6046, 38814, 22430, 55198, 14238, 47006, 30622, 63390, 3998, 36766, + 20382, 53150, 12190, 44958, 28574, 61342, 8094, 40862, 24478, 57246, 16286, + 49054, 32670, 65438, 94, 32862, 16478, 49246, 8286, 41054, 24670, 57438, + 4190, 36958, 20574, 53342, 12382, 45150, 28766, 61534, 2142, 34910, 18526, + 51294, 10334, 43102, 26718, 59486, 6238, 39006, 22622, 55390, 14430, 47198, + 30814, 63582, 1118, 33886, 17502, 50270, 9310, 42078, 25694, 58462, 5214, + 37982, 21598, 54366, 13406, 46174, 29790, 62558, 3166, 35934, 19550, 52318, + 11358, 44126, 27742, 60510, 7262, 40030, 23646, 56414, 15454, 48222, 31838, + 64606, 606, 33374, 16990, 49758, 8798, 41566, 25182, 57950, 4702, 37470, + 21086, 53854, 12894, 45662, 29278, 62046, 2654, 35422, 19038, 51806, 10846, + 43614, 27230, 59998, 6750, 39518, 23134, 55902, 14942, 47710, 31326, 64094, + 1630, 34398, 18014, 50782, 9822, 42590, 26206, 58974, 5726, 38494, 22110, + 54878, 13918, 46686, 30302, 63070, 3678, 36446, 20062, 52830, 11870, 44638, + 28254, 61022, 7774, 40542, 24158, 56926, 15966, 48734, 32350, 65118, 350, + 33118, 16734, 49502, 8542, 41310, 24926, 57694, 4446, 37214, 20830, 53598, + 12638, 45406, 29022, 61790, 2398, 35166, 18782, 51550, 10590, 43358, 26974, + 59742, 6494, 39262, 22878, 55646, 14686, 47454, 31070, 63838, 1374, 34142, + 17758, 50526, 9566, 42334, 25950, 58718, 5470, 38238, 21854, 54622, 13662, + 46430, 30046, 62814, 3422, 36190, 19806, 52574, 11614, 44382, 27998, 60766, + 7518, 40286, 23902, 56670, 15710, 48478, 32094, 64862, 862, 33630, 17246, + 50014, 9054, 41822, 25438, 58206, 4958, 37726, 21342, 54110, 13150, 45918, + 29534, 62302, 2910, 35678, 19294, 52062, 11102, 43870, 27486, 60254, 7006, + 39774, 23390, 56158, 15198, 47966, 31582, 64350, 1886, 34654, 18270, 51038, + 10078, 42846, 26462, 59230, 5982, 38750, 22366, 55134, 14174, 46942, 30558, + 63326, 3934, 36702, 20318, 53086, 12126, 44894, 28510, 61278, 8030, 40798, + 24414, 57182, 16222, 48990, 32606, 65374, 222, 32990, 16606, 49374, 8414, + 41182, 24798, 57566, 4318, 37086, 20702, 53470, 12510, 45278, 28894, 61662, + 2270, 35038, 18654, 51422, 10462, 43230, 26846, 59614, 6366, 39134, 22750, + 55518, 14558, 47326, 30942, 63710, 1246, 34014, 17630, 50398, 9438, 42206, + 25822, 58590, 5342, 38110, 21726, 54494, 13534, 46302, 29918, 62686, 3294, + 36062, 19678, 52446, 11486, 44254, 27870, 60638, 7390, 40158, 23774, 56542, + 15582, 48350, 31966, 64734, 734, 33502, 17118, 49886, 8926, 41694, 25310, + 58078, 4830, 37598, 21214, 53982, 13022, 45790, 29406, 62174, 2782, 35550, + 19166, 51934, 10974, 43742, 27358, 60126, 6878, 39646, 23262, 56030, 15070, + 47838, 31454, 64222, 1758, 34526, 18142, 50910, 9950, 42718, 26334, 59102, + 5854, 38622, 22238, 55006, 14046, 46814, 30430, 63198, 3806, 36574, 20190, + 52958, 11998, 44766, 28382, 61150, 7902, 40670, 24286, 57054, 16094, 48862, + 32478, 65246, 478, 33246, 16862, 49630, 8670, 41438, 25054, 57822, 4574, + 37342, 20958, 53726, 12766, 45534, 29150, 61918, 2526, 35294, 18910, 51678, + 10718, 43486, 27102, 59870, 6622, 39390, 23006, 55774, 14814, 47582, 31198, + 63966, 1502, 34270, 17886, 50654, 9694, 42462, 26078, 58846, 5598, 38366, + 21982, 54750, 13790, 46558, 30174, 62942, 3550, 36318, 19934, 52702, 11742, + 44510, 28126, 60894, 7646, 40414, 24030, 56798, 15838, 48606, 32222, 64990, + 990, 33758, 17374, 50142, 9182, 41950, 25566, 58334, 5086, 37854, 21470, + 54238, 13278, 46046, 29662, 62430, 3038, 35806, 19422, 52190, 11230, 43998, + 27614, 60382, 7134, 39902, 23518, 56286, 15326, 48094, 31710, 64478, 2014, + 34782, 18398, 51166, 10206, 42974, 26590, 59358, 6110, 38878, 22494, 55262, + 14302, 47070, 30686, 63454, 4062, 36830, 20446, 53214, 12254, 45022, 28638, + 61406, 8158, 40926, 24542, 57310, 16350, 49118, 32734, 65502, 62, 32830, + 16446, 49214, 8254, 41022, 24638, 57406, 4158, 36926, 20542, 53310, 12350, + 45118, 28734, 61502, 2110, 34878, 18494, 51262, 10302, 43070, 26686, 59454, + 6206, 38974, 22590, 55358, 14398, 47166, 30782, 63550, 1086, 33854, 17470, + 50238, 9278, 42046, 25662, 58430, 5182, 37950, 21566, 54334, 13374, 46142, + 29758, 62526, 3134, 35902, 19518, 52286, 11326, 44094, 27710, 60478, 7230, + 39998, 23614, 56382, 15422, 48190, 31806, 64574, 574, 33342, 16958, 49726, + 8766, 41534, 25150, 57918, 4670, 37438, 21054, 53822, 12862, 45630, 29246, + 62014, 2622, 35390, 19006, 51774, 10814, 43582, 27198, 59966, 6718, 39486, + 23102, 55870, 14910, 47678, 31294, 64062, 1598, 34366, 17982, 50750, 9790, + 42558, 26174, 58942, 5694, 38462, 22078, 54846, 13886, 46654, 30270, 63038, + 3646, 36414, 20030, 52798, 11838, 44606, 28222, 60990, 7742, 40510, 24126, + 56894, 15934, 48702, 32318, 65086, 318, 33086, 16702, 49470, 8510, 41278, + 24894, 57662, 4414, 37182, 20798, 53566, 12606, 45374, 28990, 61758, 2366, + 35134, 18750, 51518, 10558, 43326, 26942, 59710, 6462, 39230, 22846, 55614, + 14654, 47422, 31038, 63806, 1342, 34110, 17726, 50494, 9534, 42302, 25918, + 58686, 5438, 38206, 21822, 54590, 13630, 46398, 30014, 62782, 3390, 36158, + 19774, 52542, 11582, 44350, 27966, 60734, 7486, 40254, 23870, 56638, 15678, + 48446, 32062, 64830, 830, 33598, 17214, 49982, 9022, 41790, 25406, 58174, + 4926, 37694, 21310, 54078, 13118, 45886, 29502, 62270, 2878, 35646, 19262, + 52030, 11070, 43838, 27454, 60222, 6974, 39742, 23358, 56126, 15166, 47934, + 31550, 64318, 1854, 34622, 18238, 51006, 10046, 42814, 26430, 59198, 5950, + 38718, 22334, 55102, 14142, 46910, 30526, 63294, 3902, 36670, 20286, 53054, + 12094, 44862, 28478, 61246, 7998, 40766, 24382, 57150, 16190, 48958, 32574, + 65342, 190, 32958, 16574, 49342, 8382, 41150, 24766, 57534, 4286, 37054, + 20670, 53438, 12478, 45246, 28862, 61630, 2238, 35006, 18622, 51390, 10430, + 43198, 26814, 59582, 6334, 39102, 22718, 55486, 14526, 47294, 30910, 63678, + 1214, 33982, 17598, 50366, 9406, 42174, 25790, 58558, 5310, 38078, 21694, + 54462, 13502, 46270, 29886, 62654, 3262, 36030, 19646, 52414, 11454, 44222, + 27838, 60606, 7358, 40126, 23742, 56510, 15550, 48318, 31934, 64702, 702, + 33470, 17086, 49854, 8894, 41662, 25278, 58046, 4798, 37566, 21182, 53950, + 12990, 45758, 29374, 62142, 2750, 35518, 19134, 51902, 10942, 43710, 27326, + 60094, 6846, 39614, 23230, 55998, 15038, 47806, 31422, 64190, 1726, 34494, + 18110, 50878, 9918, 42686, 26302, 59070, 5822, 38590, 22206, 54974, 14014, + 46782, 30398, 63166, 3774, 36542, 20158, 52926, 11966, 44734, 28350, 61118, + 7870, 40638, 24254, 57022, 16062, 48830, 32446, 65214, 446, 33214, 16830, + 49598, 8638, 41406, 25022, 57790, 4542, 37310, 20926, 53694, 12734, 45502, + 29118, 61886, 2494, 35262, 18878, 51646, 10686, 43454, 27070, 59838, 6590, + 39358, 22974, 55742, 14782, 47550, 31166, 63934, 1470, 34238, 17854, 50622, + 9662, 42430, 26046, 58814, 5566, 38334, 21950, 54718, 13758, 46526, 30142, + 62910, 3518, 36286, 19902, 52670, 11710, 44478, 28094, 60862, 7614, 40382, + 23998, 56766, 15806, 48574, 32190, 64958, 958, 33726, 17342, 50110, 9150, + 41918, 25534, 58302, 5054, 37822, 21438, 54206, 13246, 46014, 29630, 62398, + 3006, 35774, 19390, 52158, 11198, 43966, 27582, 60350, 7102, 39870, 23486, + 56254, 15294, 48062, 31678, 64446, 1982, 34750, 18366, 51134, 10174, 42942, + 26558, 59326, 6078, 38846, 22462, 55230, 14270, 47038, 30654, 63422, 4030, + 36798, 20414, 53182, 12222, 44990, 28606, 61374, 8126, 40894, 24510, 57278, + 16318, 49086, 32702, 65470, 126, 32894, 16510, 49278, 8318, 41086, 24702, + 57470, 4222, 36990, 20606, 53374, 12414, 45182, 28798, 61566, 2174, 34942, + 18558, 51326, 10366, 43134, 26750, 59518, 6270, 39038, 22654, 55422, 14462, + 47230, 30846, 63614, 1150, 33918, 17534, 50302, 9342, 42110, 25726, 58494, + 5246, 38014, 21630, 54398, 13438, 46206, 29822, 62590, 3198, 35966, 19582, + 52350, 11390, 44158, 27774, 60542, 7294, 40062, 23678, 56446, 15486, 48254, + 31870, 64638, 638, 33406, 17022, 49790, 8830, 41598, 25214, 57982, 4734, + 37502, 21118, 53886, 12926, 45694, 29310, 62078, 2686, 35454, 19070, 51838, + 10878, 43646, 27262, 60030, 6782, 39550, 23166, 55934, 14974, 47742, 31358, + 64126, 1662, 34430, 18046, 50814, 9854, 42622, 26238, 59006, 5758, 38526, + 22142, 54910, 13950, 46718, 30334, 63102, 3710, 36478, 20094, 52862, 11902, + 44670, 28286, 61054, 7806, 40574, 24190, 56958, 15998, 48766, 32382, 65150, + 382, 33150, 16766, 49534, 8574, 41342, 24958, 57726, 4478, 37246, 20862, + 53630, 12670, 45438, 29054, 61822, 2430, 35198, 18814, 51582, 10622, 43390, + 27006, 59774, 6526, 39294, 22910, 55678, 14718, 47486, 31102, 63870, 1406, + 34174, 17790, 50558, 9598, 42366, 25982, 58750, 5502, 38270, 21886, 54654, + 13694, 46462, 30078, 62846, 3454, 36222, 19838, 52606, 11646, 44414, 28030, + 60798, 7550, 40318, 23934, 56702, 15742, 48510, 32126, 64894, 894, 33662, + 17278, 50046, 9086, 41854, 25470, 58238, 4990, 37758, 21374, 54142, 13182, + 45950, 29566, 62334, 2942, 35710, 19326, 52094, 11134, 43902, 27518, 60286, + 7038, 39806, 23422, 56190, 15230, 47998, 31614, 64382, 1918, 34686, 18302, + 51070, 10110, 42878, 26494, 59262, 6014, 38782, 22398, 55166, 14206, 46974, + 30590, 63358, 3966, 36734, 20350, 53118, 12158, 44926, 28542, 61310, 8062, + 40830, 24446, 57214, 16254, 49022, 32638, 65406, 254, 33022, 16638, 49406, + 8446, 41214, 24830, 57598, 4350, 37118, 20734, 53502, 12542, 45310, 28926, + 61694, 2302, 35070, 18686, 51454, 10494, 43262, 26878, 59646, 6398, 39166, + 22782, 55550, 14590, 47358, 30974, 63742, 1278, 34046, 17662, 50430, 9470, + 42238, 25854, 58622, 5374, 38142, 21758, 54526, 13566, 46334, 29950, 62718, + 3326, 36094, 19710, 52478, 11518, 44286, 27902, 60670, 7422, 40190, 23806, + 56574, 15614, 48382, 31998, 64766, 766, 33534, 17150, 49918, 8958, 41726, + 25342, 58110, 4862, 37630, 21246, 54014, 13054, 45822, 29438, 62206, 2814, + 35582, 19198, 51966, 11006, 43774, 27390, 60158, 6910, 39678, 23294, 56062, + 15102, 47870, 31486, 64254, 1790, 34558, 18174, 50942, 9982, 42750, 26366, + 59134, 5886, 38654, 22270, 55038, 14078, 46846, 30462, 63230, 3838, 36606, + 20222, 52990, 12030, 44798, 28414, 61182, 7934, 40702, 24318, 57086, 16126, + 48894, 32510, 65278, 510, 33278, 16894, 49662, 8702, 41470, 25086, 57854, + 4606, 37374, 20990, 53758, 12798, 45566, 29182, 61950, 2558, 35326, 18942, + 51710, 10750, 43518, 27134, 59902, 6654, 39422, 23038, 55806, 14846, 47614, + 31230, 63998, 1534, 34302, 17918, 50686, 9726, 42494, 26110, 58878, 5630, + 38398, 22014, 54782, 13822, 46590, 30206, 62974, 3582, 36350, 19966, 52734, + 11774, 44542, 28158, 60926, 7678, 40446, 24062, 56830, 15870, 48638, 32254, + 65022, 1022, 33790, 17406, 50174, 9214, 41982, 25598, 58366, 5118, 37886, + 21502, 54270, 13310, 46078, 29694, 62462, 3070, 35838, 19454, 52222, 11262, + 44030, 27646, 60414, 7166, 39934, 23550, 56318, 15358, 48126, 31742, 64510, + 2046, 34814, 18430, 51198, 10238, 43006, 26622, 59390, 6142, 38910, 22526, + 55294, 14334, 47102, 30718, 63486, 4094, 36862, 20478, 53246, 12286, 45054, + 28670, 61438, 8190, 40958, 24574, 57342, 16382, 49150, 32766, 65534, 1, + 32769, 16385, 49153, 8193, 40961, 24577, 57345, 4097, 36865, 20481, 53249, + 12289, 45057, 28673, 61441, 2049, 34817, 18433, 51201, 10241, 43009, 26625, + 59393, 6145, 38913, 22529, 55297, 14337, 47105, 30721, 63489, 1025, 33793, + 17409, 50177, 9217, 41985, 25601, 58369, 5121, 37889, 21505, 54273, 13313, + 46081, 29697, 62465, 3073, 35841, 19457, 52225, 11265, 44033, 27649, 60417, + 7169, 39937, 23553, 56321, 15361, 48129, 31745, 64513, 513, 33281, 16897, + 49665, 8705, 41473, 25089, 57857, 4609, 37377, 20993, 53761, 12801, 45569, + 29185, 61953, 2561, 35329, 18945, 51713, 10753, 43521, 27137, 59905, 6657, + 39425, 23041, 55809, 14849, 47617, 31233, 64001, 1537, 34305, 17921, 50689, + 9729, 42497, 26113, 58881, 5633, 38401, 22017, 54785, 13825, 46593, 30209, + 62977, 3585, 36353, 19969, 52737, 11777, 44545, 28161, 60929, 7681, 40449, + 24065, 56833, 15873, 48641, 32257, 65025, 257, 33025, 16641, 49409, 8449, + 41217, 24833, 57601, 4353, 37121, 20737, 53505, 12545, 45313, 28929, 61697, + 2305, 35073, 18689, 51457, 10497, 43265, 26881, 59649, 6401, 39169, 22785, + 55553, 14593, 47361, 30977, 63745, 1281, 34049, 17665, 50433, 9473, 42241, + 25857, 58625, 5377, 38145, 21761, 54529, 13569, 46337, 29953, 62721, 3329, + 36097, 19713, 52481, 11521, 44289, 27905, 60673, 7425, 40193, 23809, 56577, + 15617, 48385, 32001, 64769, 769, 33537, 17153, 49921, 8961, 41729, 25345, + 58113, 4865, 37633, 21249, 54017, 13057, 45825, 29441, 62209, 2817, 35585, + 19201, 51969, 11009, 43777, 27393, 60161, 6913, 39681, 23297, 56065, 15105, + 47873, 31489, 64257, 1793, 34561, 18177, 50945, 9985, 42753, 26369, 59137, + 5889, 38657, 22273, 55041, 14081, 46849, 30465, 63233, 3841, 36609, 20225, + 52993, 12033, 44801, 28417, 61185, 7937, 40705, 24321, 57089, 16129, 48897, + 32513, 65281, 129, 32897, 16513, 49281, 8321, 41089, 24705, 57473, 4225, + 36993, 20609, 53377, 12417, 45185, 28801, 61569, 2177, 34945, 18561, 51329, + 10369, 43137, 26753, 59521, 6273, 39041, 22657, 55425, 14465, 47233, 30849, + 63617, 1153, 33921, 17537, 50305, 9345, 42113, 25729, 58497, 5249, 38017, + 21633, 54401, 13441, 46209, 29825, 62593, 3201, 35969, 19585, 52353, 11393, + 44161, 27777, 60545, 7297, 40065, 23681, 56449, 15489, 48257, 31873, 64641, + 641, 33409, 17025, 49793, 8833, 41601, 25217, 57985, 4737, 37505, 21121, + 53889, 12929, 45697, 29313, 62081, 2689, 35457, 19073, 51841, 10881, 43649, + 27265, 60033, 6785, 39553, 23169, 55937, 14977, 47745, 31361, 64129, 1665, + 34433, 18049, 50817, 9857, 42625, 26241, 59009, 5761, 38529, 22145, 54913, + 13953, 46721, 30337, 63105, 3713, 36481, 20097, 52865, 11905, 44673, 28289, + 61057, 7809, 40577, 24193, 56961, 16001, 48769, 32385, 65153, 385, 33153, + 16769, 49537, 8577, 41345, 24961, 57729, 4481, 37249, 20865, 53633, 12673, + 45441, 29057, 61825, 2433, 35201, 18817, 51585, 10625, 43393, 27009, 59777, + 6529, 39297, 22913, 55681, 14721, 47489, 31105, 63873, 1409, 34177, 17793, + 50561, 9601, 42369, 25985, 58753, 5505, 38273, 21889, 54657, 13697, 46465, + 30081, 62849, 3457, 36225, 19841, 52609, 11649, 44417, 28033, 60801, 7553, + 40321, 23937, 56705, 15745, 48513, 32129, 64897, 897, 33665, 17281, 50049, + 9089, 41857, 25473, 58241, 4993, 37761, 21377, 54145, 13185, 45953, 29569, + 62337, 2945, 35713, 19329, 52097, 11137, 43905, 27521, 60289, 7041, 39809, + 23425, 56193, 15233, 48001, 31617, 64385, 1921, 34689, 18305, 51073, 10113, + 42881, 26497, 59265, 6017, 38785, 22401, 55169, 14209, 46977, 30593, 63361, + 3969, 36737, 20353, 53121, 12161, 44929, 28545, 61313, 8065, 40833, 24449, + 57217, 16257, 49025, 32641, 65409, 65, 32833, 16449, 49217, 8257, 41025, + 24641, 57409, 4161, 36929, 20545, 53313, 12353, 45121, 28737, 61505, 2113, + 34881, 18497, 51265, 10305, 43073, 26689, 59457, 6209, 38977, 22593, 55361, + 14401, 47169, 30785, 63553, 1089, 33857, 17473, 50241, 9281, 42049, 25665, + 58433, 5185, 37953, 21569, 54337, 13377, 46145, 29761, 62529, 3137, 35905, + 19521, 52289, 11329, 44097, 27713, 60481, 7233, 40001, 23617, 56385, 15425, + 48193, 31809, 64577, 577, 33345, 16961, 49729, 8769, 41537, 25153, 57921, + 4673, 37441, 21057, 53825, 12865, 45633, 29249, 62017, 2625, 35393, 19009, + 51777, 10817, 43585, 27201, 59969, 6721, 39489, 23105, 55873, 14913, 47681, + 31297, 64065, 1601, 34369, 17985, 50753, 9793, 42561, 26177, 58945, 5697, + 38465, 22081, 54849, 13889, 46657, 30273, 63041, 3649, 36417, 20033, 52801, + 11841, 44609, 28225, 60993, 7745, 40513, 24129, 56897, 15937, 48705, 32321, + 65089, 321, 33089, 16705, 49473, 8513, 41281, 24897, 57665, 4417, 37185, + 20801, 53569, 12609, 45377, 28993, 61761, 2369, 35137, 18753, 51521, 10561, + 43329, 26945, 59713, 6465, 39233, 22849, 55617, 14657, 47425, 31041, 63809, + 1345, 34113, 17729, 50497, 9537, 42305, 25921, 58689, 5441, 38209, 21825, + 54593, 13633, 46401, 30017, 62785, 3393, 36161, 19777, 52545, 11585, 44353, + 27969, 60737, 7489, 40257, 23873, 56641, 15681, 48449, 32065, 64833, 833, + 33601, 17217, 49985, 9025, 41793, 25409, 58177, 4929, 37697, 21313, 54081, + 13121, 45889, 29505, 62273, 2881, 35649, 19265, 52033, 11073, 43841, 27457, + 60225, 6977, 39745, 23361, 56129, 15169, 47937, 31553, 64321, 1857, 34625, + 18241, 51009, 10049, 42817, 26433, 59201, 5953, 38721, 22337, 55105, 14145, + 46913, 30529, 63297, 3905, 36673, 20289, 53057, 12097, 44865, 28481, 61249, + 8001, 40769, 24385, 57153, 16193, 48961, 32577, 65345, 193, 32961, 16577, + 49345, 8385, 41153, 24769, 57537, 4289, 37057, 20673, 53441, 12481, 45249, + 28865, 61633, 2241, 35009, 18625, 51393, 10433, 43201, 26817, 59585, 6337, + 39105, 22721, 55489, 14529, 47297, 30913, 63681, 1217, 33985, 17601, 50369, + 9409, 42177, 25793, 58561, 5313, 38081, 21697, 54465, 13505, 46273, 29889, + 62657, 3265, 36033, 19649, 52417, 11457, 44225, 27841, 60609, 7361, 40129, + 23745, 56513, 15553, 48321, 31937, 64705, 705, 33473, 17089, 49857, 8897, + 41665, 25281, 58049, 4801, 37569, 21185, 53953, 12993, 45761, 29377, 62145, + 2753, 35521, 19137, 51905, 10945, 43713, 27329, 60097, 6849, 39617, 23233, + 56001, 15041, 47809, 31425, 64193, 1729, 34497, 18113, 50881, 9921, 42689, + 26305, 59073, 5825, 38593, 22209, 54977, 14017, 46785, 30401, 63169, 3777, + 36545, 20161, 52929, 11969, 44737, 28353, 61121, 7873, 40641, 24257, 57025, + 16065, 48833, 32449, 65217, 449, 33217, 16833, 49601, 8641, 41409, 25025, + 57793, 4545, 37313, 20929, 53697, 12737, 45505, 29121, 61889, 2497, 35265, + 18881, 51649, 10689, 43457, 27073, 59841, 6593, 39361, 22977, 55745, 14785, + 47553, 31169, 63937, 1473, 34241, 17857, 50625, 9665, 42433, 26049, 58817, + 5569, 38337, 21953, 54721, 13761, 46529, 30145, 62913, 3521, 36289, 19905, + 52673, 11713, 44481, 28097, 60865, 7617, 40385, 24001, 56769, 15809, 48577, + 32193, 64961, 961, 33729, 17345, 50113, 9153, 41921, 25537, 58305, 5057, + 37825, 21441, 54209, 13249, 46017, 29633, 62401, 3009, 35777, 19393, 52161, + 11201, 43969, 27585, 60353, 7105, 39873, 23489, 56257, 15297, 48065, 31681, + 64449, 1985, 34753, 18369, 51137, 10177, 42945, 26561, 59329, 6081, 38849, + 22465, 55233, 14273, 47041, 30657, 63425, 4033, 36801, 20417, 53185, 12225, + 44993, 28609, 61377, 8129, 40897, 24513, 57281, 16321, 49089, 32705, 65473, + 33, 32801, 16417, 49185, 8225, 40993, 24609, 57377, 4129, 36897, 20513, + 53281, 12321, 45089, 28705, 61473, 2081, 34849, 18465, 51233, 10273, 43041, + 26657, 59425, 6177, 38945, 22561, 55329, 14369, 47137, 30753, 63521, 1057, + 33825, 17441, 50209, 9249, 42017, 25633, 58401, 5153, 37921, 21537, 54305, + 13345, 46113, 29729, 62497, 3105, 35873, 19489, 52257, 11297, 44065, 27681, + 60449, 7201, 39969, 23585, 56353, 15393, 48161, 31777, 64545, 545, 33313, + 16929, 49697, 8737, 41505, 25121, 57889, 4641, 37409, 21025, 53793, 12833, + 45601, 29217, 61985, 2593, 35361, 18977, 51745, 10785, 43553, 27169, 59937, + 6689, 39457, 23073, 55841, 14881, 47649, 31265, 64033, 1569, 34337, 17953, + 50721, 9761, 42529, 26145, 58913, 5665, 38433, 22049, 54817, 13857, 46625, + 30241, 63009, 3617, 36385, 20001, 52769, 11809, 44577, 28193, 60961, 7713, + 40481, 24097, 56865, 15905, 48673, 32289, 65057, 289, 33057, 16673, 49441, + 8481, 41249, 24865, 57633, 4385, 37153, 20769, 53537, 12577, 45345, 28961, + 61729, 2337, 35105, 18721, 51489, 10529, 43297, 26913, 59681, 6433, 39201, + 22817, 55585, 14625, 47393, 31009, 63777, 1313, 34081, 17697, 50465, 9505, + 42273, 25889, 58657, 5409, 38177, 21793, 54561, 13601, 46369, 29985, 62753, + 3361, 36129, 19745, 52513, 11553, 44321, 27937, 60705, 7457, 40225, 23841, + 56609, 15649, 48417, 32033, 64801, 801, 33569, 17185, 49953, 8993, 41761, + 25377, 58145, 4897, 37665, 21281, 54049, 13089, 45857, 29473, 62241, 2849, + 35617, 19233, 52001, 11041, 43809, 27425, 60193, 6945, 39713, 23329, 56097, + 15137, 47905, 31521, 64289, 1825, 34593, 18209, 50977, 10017, 42785, 26401, + 59169, 5921, 38689, 22305, 55073, 14113, 46881, 30497, 63265, 3873, 36641, + 20257, 53025, 12065, 44833, 28449, 61217, 7969, 40737, 24353, 57121, 16161, + 48929, 32545, 65313, 161, 32929, 16545, 49313, 8353, 41121, 24737, 57505, + 4257, 37025, 20641, 53409, 12449, 45217, 28833, 61601, 2209, 34977, 18593, + 51361, 10401, 43169, 26785, 59553, 6305, 39073, 22689, 55457, 14497, 47265, + 30881, 63649, 1185, 33953, 17569, 50337, 9377, 42145, 25761, 58529, 5281, + 38049, 21665, 54433, 13473, 46241, 29857, 62625, 3233, 36001, 19617, 52385, + 11425, 44193, 27809, 60577, 7329, 40097, 23713, 56481, 15521, 48289, 31905, + 64673, 673, 33441, 17057, 49825, 8865, 41633, 25249, 58017, 4769, 37537, + 21153, 53921, 12961, 45729, 29345, 62113, 2721, 35489, 19105, 51873, 10913, + 43681, 27297, 60065, 6817, 39585, 23201, 55969, 15009, 47777, 31393, 64161, + 1697, 34465, 18081, 50849, 9889, 42657, 26273, 59041, 5793, 38561, 22177, + 54945, 13985, 46753, 30369, 63137, 3745, 36513, 20129, 52897, 11937, 44705, + 28321, 61089, 7841, 40609, 24225, 56993, 16033, 48801, 32417, 65185, 417, + 33185, 16801, 49569, 8609, 41377, 24993, 57761, 4513, 37281, 20897, 53665, + 12705, 45473, 29089, 61857, 2465, 35233, 18849, 51617, 10657, 43425, 27041, + 59809, 6561, 39329, 22945, 55713, 14753, 47521, 31137, 63905, 1441, 34209, + 17825, 50593, 9633, 42401, 26017, 58785, 5537, 38305, 21921, 54689, 13729, + 46497, 30113, 62881, 3489, 36257, 19873, 52641, 11681, 44449, 28065, 60833, + 7585, 40353, 23969, 56737, 15777, 48545, 32161, 64929, 929, 33697, 17313, + 50081, 9121, 41889, 25505, 58273, 5025, 37793, 21409, 54177, 13217, 45985, + 29601, 62369, 2977, 35745, 19361, 52129, 11169, 43937, 27553, 60321, 7073, + 39841, 23457, 56225, 15265, 48033, 31649, 64417, 1953, 34721, 18337, 51105, + 10145, 42913, 26529, 59297, 6049, 38817, 22433, 55201, 14241, 47009, 30625, + 63393, 4001, 36769, 20385, 53153, 12193, 44961, 28577, 61345, 8097, 40865, + 24481, 57249, 16289, 49057, 32673, 65441, 97, 32865, 16481, 49249, 8289, + 41057, 24673, 57441, 4193, 36961, 20577, 53345, 12385, 45153, 28769, 61537, + 2145, 34913, 18529, 51297, 10337, 43105, 26721, 59489, 6241, 39009, 22625, + 55393, 14433, 47201, 30817, 63585, 1121, 33889, 17505, 50273, 9313, 42081, + 25697, 58465, 5217, 37985, 21601, 54369, 13409, 46177, 29793, 62561, 3169, + 35937, 19553, 52321, 11361, 44129, 27745, 60513, 7265, 40033, 23649, 56417, + 15457, 48225, 31841, 64609, 609, 33377, 16993, 49761, 8801, 41569, 25185, + 57953, 4705, 37473, 21089, 53857, 12897, 45665, 29281, 62049, 2657, 35425, + 19041, 51809, 10849, 43617, 27233, 60001, 6753, 39521, 23137, 55905, 14945, + 47713, 31329, 64097, 1633, 34401, 18017, 50785, 9825, 42593, 26209, 58977, + 5729, 38497, 22113, 54881, 13921, 46689, 30305, 63073, 3681, 36449, 20065, + 52833, 11873, 44641, 28257, 61025, 7777, 40545, 24161, 56929, 15969, 48737, + 32353, 65121, 353, 33121, 16737, 49505, 8545, 41313, 24929, 57697, 4449, + 37217, 20833, 53601, 12641, 45409, 29025, 61793, 2401, 35169, 18785, 51553, + 10593, 43361, 26977, 59745, 6497, 39265, 22881, 55649, 14689, 47457, 31073, + 63841, 1377, 34145, 17761, 50529, 9569, 42337, 25953, 58721, 5473, 38241, + 21857, 54625, 13665, 46433, 30049, 62817, 3425, 36193, 19809, 52577, 11617, + 44385, 28001, 60769, 7521, 40289, 23905, 56673, 15713, 48481, 32097, 64865, + 865, 33633, 17249, 50017, 9057, 41825, 25441, 58209, 4961, 37729, 21345, + 54113, 13153, 45921, 29537, 62305, 2913, 35681, 19297, 52065, 11105, 43873, + 27489, 60257, 7009, 39777, 23393, 56161, 15201, 47969, 31585, 64353, 1889, + 34657, 18273, 51041, 10081, 42849, 26465, 59233, 5985, 38753, 22369, 55137, + 14177, 46945, 30561, 63329, 3937, 36705, 20321, 53089, 12129, 44897, 28513, + 61281, 8033, 40801, 24417, 57185, 16225, 48993, 32609, 65377, 225, 32993, + 16609, 49377, 8417, 41185, 24801, 57569, 4321, 37089, 20705, 53473, 12513, + 45281, 28897, 61665, 2273, 35041, 18657, 51425, 10465, 43233, 26849, 59617, + 6369, 39137, 22753, 55521, 14561, 47329, 30945, 63713, 1249, 34017, 17633, + 50401, 9441, 42209, 25825, 58593, 5345, 38113, 21729, 54497, 13537, 46305, + 29921, 62689, 3297, 36065, 19681, 52449, 11489, 44257, 27873, 60641, 7393, + 40161, 23777, 56545, 15585, 48353, 31969, 64737, 737, 33505, 17121, 49889, + 8929, 41697, 25313, 58081, 4833, 37601, 21217, 53985, 13025, 45793, 29409, + 62177, 2785, 35553, 19169, 51937, 10977, 43745, 27361, 60129, 6881, 39649, + 23265, 56033, 15073, 47841, 31457, 64225, 1761, 34529, 18145, 50913, 9953, + 42721, 26337, 59105, 5857, 38625, 22241, 55009, 14049, 46817, 30433, 63201, + 3809, 36577, 20193, 52961, 12001, 44769, 28385, 61153, 7905, 40673, 24289, + 57057, 16097, 48865, 32481, 65249, 481, 33249, 16865, 49633, 8673, 41441, + 25057, 57825, 4577, 37345, 20961, 53729, 12769, 45537, 29153, 61921, 2529, + 35297, 18913, 51681, 10721, 43489, 27105, 59873, 6625, 39393, 23009, 55777, + 14817, 47585, 31201, 63969, 1505, 34273, 17889, 50657, 9697, 42465, 26081, + 58849, 5601, 38369, 21985, 54753, 13793, 46561, 30177, 62945, 3553, 36321, + 19937, 52705, 11745, 44513, 28129, 60897, 7649, 40417, 24033, 56801, 15841, + 48609, 32225, 64993, 993, 33761, 17377, 50145, 9185, 41953, 25569, 58337, + 5089, 37857, 21473, 54241, 13281, 46049, 29665, 62433, 3041, 35809, 19425, + 52193, 11233, 44001, 27617, 60385, 7137, 39905, 23521, 56289, 15329, 48097, + 31713, 64481, 2017, 34785, 18401, 51169, 10209, 42977, 26593, 59361, 6113, + 38881, 22497, 55265, 14305, 47073, 30689, 63457, 4065, 36833, 20449, 53217, + 12257, 45025, 28641, 61409, 8161, 40929, 24545, 57313, 16353, 49121, 32737, + 65505, 17, 32785, 16401, 49169, 8209, 40977, 24593, 57361, 4113, 36881, + 20497, 53265, 12305, 45073, 28689, 61457, 2065, 34833, 18449, 51217, 10257, + 43025, 26641, 59409, 6161, 38929, 22545, 55313, 14353, 47121, 30737, 63505, + 1041, 33809, 17425, 50193, 9233, 42001, 25617, 58385, 5137, 37905, 21521, + 54289, 13329, 46097, 29713, 62481, 3089, 35857, 19473, 52241, 11281, 44049, + 27665, 60433, 7185, 39953, 23569, 56337, 15377, 48145, 31761, 64529, 529, + 33297, 16913, 49681, 8721, 41489, 25105, 57873, 4625, 37393, 21009, 53777, + 12817, 45585, 29201, 61969, 2577, 35345, 18961, 51729, 10769, 43537, 27153, + 59921, 6673, 39441, 23057, 55825, 14865, 47633, 31249, 64017, 1553, 34321, + 17937, 50705, 9745, 42513, 26129, 58897, 5649, 38417, 22033, 54801, 13841, + 46609, 30225, 62993, 3601, 36369, 19985, 52753, 11793, 44561, 28177, 60945, + 7697, 40465, 24081, 56849, 15889, 48657, 32273, 65041, 273, 33041, 16657, + 49425, 8465, 41233, 24849, 57617, 4369, 37137, 20753, 53521, 12561, 45329, + 28945, 61713, 2321, 35089, 18705, 51473, 10513, 43281, 26897, 59665, 6417, + 39185, 22801, 55569, 14609, 47377, 30993, 63761, 1297, 34065, 17681, 50449, + 9489, 42257, 25873, 58641, 5393, 38161, 21777, 54545, 13585, 46353, 29969, + 62737, 3345, 36113, 19729, 52497, 11537, 44305, 27921, 60689, 7441, 40209, + 23825, 56593, 15633, 48401, 32017, 64785, 785, 33553, 17169, 49937, 8977, + 41745, 25361, 58129, 4881, 37649, 21265, 54033, 13073, 45841, 29457, 62225, + 2833, 35601, 19217, 51985, 11025, 43793, 27409, 60177, 6929, 39697, 23313, + 56081, 15121, 47889, 31505, 64273, 1809, 34577, 18193, 50961, 10001, 42769, + 26385, 59153, 5905, 38673, 22289, 55057, 14097, 46865, 30481, 63249, 3857, + 36625, 20241, 53009, 12049, 44817, 28433, 61201, 7953, 40721, 24337, 57105, + 16145, 48913, 32529, 65297, 145, 32913, 16529, 49297, 8337, 41105, 24721, + 57489, 4241, 37009, 20625, 53393, 12433, 45201, 28817, 61585, 2193, 34961, + 18577, 51345, 10385, 43153, 26769, 59537, 6289, 39057, 22673, 55441, 14481, + 47249, 30865, 63633, 1169, 33937, 17553, 50321, 9361, 42129, 25745, 58513, + 5265, 38033, 21649, 54417, 13457, 46225, 29841, 62609, 3217, 35985, 19601, + 52369, 11409, 44177, 27793, 60561, 7313, 40081, 23697, 56465, 15505, 48273, + 31889, 64657, 657, 33425, 17041, 49809, 8849, 41617, 25233, 58001, 4753, + 37521, 21137, 53905, 12945, 45713, 29329, 62097, 2705, 35473, 19089, 51857, + 10897, 43665, 27281, 60049, 6801, 39569, 23185, 55953, 14993, 47761, 31377, + 64145, 1681, 34449, 18065, 50833, 9873, 42641, 26257, 59025, 5777, 38545, + 22161, 54929, 13969, 46737, 30353, 63121, 3729, 36497, 20113, 52881, 11921, + 44689, 28305, 61073, 7825, 40593, 24209, 56977, 16017, 48785, 32401, 65169, + 401, 33169, 16785, 49553, 8593, 41361, 24977, 57745, 4497, 37265, 20881, + 53649, 12689, 45457, 29073, 61841, 2449, 35217, 18833, 51601, 10641, 43409, + 27025, 59793, 6545, 39313, 22929, 55697, 14737, 47505, 31121, 63889, 1425, + 34193, 17809, 50577, 9617, 42385, 26001, 58769, 5521, 38289, 21905, 54673, + 13713, 46481, 30097, 62865, 3473, 36241, 19857, 52625, 11665, 44433, 28049, + 60817, 7569, 40337, 23953, 56721, 15761, 48529, 32145, 64913, 913, 33681, + 17297, 50065, 9105, 41873, 25489, 58257, 5009, 37777, 21393, 54161, 13201, + 45969, 29585, 62353, 2961, 35729, 19345, 52113, 11153, 43921, 27537, 60305, + 7057, 39825, 23441, 56209, 15249, 48017, 31633, 64401, 1937, 34705, 18321, + 51089, 10129, 42897, 26513, 59281, 6033, 38801, 22417, 55185, 14225, 46993, + 30609, 63377, 3985, 36753, 20369, 53137, 12177, 44945, 28561, 61329, 8081, + 40849, 24465, 57233, 16273, 49041, 32657, 65425, 81, 32849, 16465, 49233, + 8273, 41041, 24657, 57425, 4177, 36945, 20561, 53329, 12369, 45137, 28753, + 61521, 2129, 34897, 18513, 51281, 10321, 43089, 26705, 59473, 6225, 38993, + 22609, 55377, 14417, 47185, 30801, 63569, 1105, 33873, 17489, 50257, 9297, + 42065, 25681, 58449, 5201, 37969, 21585, 54353, 13393, 46161, 29777, 62545, + 3153, 35921, 19537, 52305, 11345, 44113, 27729, 60497, 7249, 40017, 23633, + 56401, 15441, 48209, 31825, 64593, 593, 33361, 16977, 49745, 8785, 41553, + 25169, 57937, 4689, 37457, 21073, 53841, 12881, 45649, 29265, 62033, 2641, + 35409, 19025, 51793, 10833, 43601, 27217, 59985, 6737, 39505, 23121, 55889, + 14929, 47697, 31313, 64081, 1617, 34385, 18001, 50769, 9809, 42577, 26193, + 58961, 5713, 38481, 22097, 54865, 13905, 46673, 30289, 63057, 3665, 36433, + 20049, 52817, 11857, 44625, 28241, 61009, 7761, 40529, 24145, 56913, 15953, + 48721, 32337, 65105, 337, 33105, 16721, 49489, 8529, 41297, 24913, 57681, + 4433, 37201, 20817, 53585, 12625, 45393, 29009, 61777, 2385, 35153, 18769, + 51537, 10577, 43345, 26961, 59729, 6481, 39249, 22865, 55633, 14673, 47441, + 31057, 63825, 1361, 34129, 17745, 50513, 9553, 42321, 25937, 58705, 5457, + 38225, 21841, 54609, 13649, 46417, 30033, 62801, 3409, 36177, 19793, 52561, + 11601, 44369, 27985, 60753, 7505, 40273, 23889, 56657, 15697, 48465, 32081, + 64849, 849, 33617, 17233, 50001, 9041, 41809, 25425, 58193, 4945, 37713, + 21329, 54097, 13137, 45905, 29521, 62289, 2897, 35665, 19281, 52049, 11089, + 43857, 27473, 60241, 6993, 39761, 23377, 56145, 15185, 47953, 31569, 64337, + 1873, 34641, 18257, 51025, 10065, 42833, 26449, 59217, 5969, 38737, 22353, + 55121, 14161, 46929, 30545, 63313, 3921, 36689, 20305, 53073, 12113, 44881, + 28497, 61265, 8017, 40785, 24401, 57169, 16209, 48977, 32593, 65361, 209, + 32977, 16593, 49361, 8401, 41169, 24785, 57553, 4305, 37073, 20689, 53457, + 12497, 45265, 28881, 61649, 2257, 35025, 18641, 51409, 10449, 43217, 26833, + 59601, 6353, 39121, 22737, 55505, 14545, 47313, 30929, 63697, 1233, 34001, + 17617, 50385, 9425, 42193, 25809, 58577, 5329, 38097, 21713, 54481, 13521, + 46289, 29905, 62673, 3281, 36049, 19665, 52433, 11473, 44241, 27857, 60625, + 7377, 40145, 23761, 56529, 15569, 48337, 31953, 64721, 721, 33489, 17105, + 49873, 8913, 41681, 25297, 58065, 4817, 37585, 21201, 53969, 13009, 45777, + 29393, 62161, 2769, 35537, 19153, 51921, 10961, 43729, 27345, 60113, 6865, + 39633, 23249, 56017, 15057, 47825, 31441, 64209, 1745, 34513, 18129, 50897, + 9937, 42705, 26321, 59089, 5841, 38609, 22225, 54993, 14033, 46801, 30417, + 63185, 3793, 36561, 20177, 52945, 11985, 44753, 28369, 61137, 7889, 40657, + 24273, 57041, 16081, 48849, 32465, 65233, 465, 33233, 16849, 49617, 8657, + 41425, 25041, 57809, 4561, 37329, 20945, 53713, 12753, 45521, 29137, 61905, + 2513, 35281, 18897, 51665, 10705, 43473, 27089, 59857, 6609, 39377, 22993, + 55761, 14801, 47569, 31185, 63953, 1489, 34257, 17873, 50641, 9681, 42449, + 26065, 58833, 5585, 38353, 21969, 54737, 13777, 46545, 30161, 62929, 3537, + 36305, 19921, 52689, 11729, 44497, 28113, 60881, 7633, 40401, 24017, 56785, + 15825, 48593, 32209, 64977, 977, 33745, 17361, 50129, 9169, 41937, 25553, + 58321, 5073, 37841, 21457, 54225, 13265, 46033, 29649, 62417, 3025, 35793, + 19409, 52177, 11217, 43985, 27601, 60369, 7121, 39889, 23505, 56273, 15313, + 48081, 31697, 64465, 2001, 34769, 18385, 51153, 10193, 42961, 26577, 59345, + 6097, 38865, 22481, 55249, 14289, 47057, 30673, 63441, 4049, 36817, 20433, + 53201, 12241, 45009, 28625, 61393, 8145, 40913, 24529, 57297, 16337, 49105, + 32721, 65489, 49, 32817, 16433, 49201, 8241, 41009, 24625, 57393, 4145, + 36913, 20529, 53297, 12337, 45105, 28721, 61489, 2097, 34865, 18481, 51249, + 10289, 43057, 26673, 59441, 6193, 38961, 22577, 55345, 14385, 47153, 30769, + 63537, 1073, 33841, 17457, 50225, 9265, 42033, 25649, 58417, 5169, 37937, + 21553, 54321, 13361, 46129, 29745, 62513, 3121, 35889, 19505, 52273, 11313, + 44081, 27697, 60465, 7217, 39985, 23601, 56369, 15409, 48177, 31793, 64561, + 561, 33329, 16945, 49713, 8753, 41521, 25137, 57905, 4657, 37425, 21041, + 53809, 12849, 45617, 29233, 62001, 2609, 35377, 18993, 51761, 10801, 43569, + 27185, 59953, 6705, 39473, 23089, 55857, 14897, 47665, 31281, 64049, 1585, + 34353, 17969, 50737, 9777, 42545, 26161, 58929, 5681, 38449, 22065, 54833, + 13873, 46641, 30257, 63025, 3633, 36401, 20017, 52785, 11825, 44593, 28209, + 60977, 7729, 40497, 24113, 56881, 15921, 48689, 32305, 65073, 305, 33073, + 16689, 49457, 8497, 41265, 24881, 57649, 4401, 37169, 20785, 53553, 12593, + 45361, 28977, 61745, 2353, 35121, 18737, 51505, 10545, 43313, 26929, 59697, + 6449, 39217, 22833, 55601, 14641, 47409, 31025, 63793, 1329, 34097, 17713, + 50481, 9521, 42289, 25905, 58673, 5425, 38193, 21809, 54577, 13617, 46385, + 30001, 62769, 3377, 36145, 19761, 52529, 11569, 44337, 27953, 60721, 7473, + 40241, 23857, 56625, 15665, 48433, 32049, 64817, 817, 33585, 17201, 49969, + 9009, 41777, 25393, 58161, 4913, 37681, 21297, 54065, 13105, 45873, 29489, + 62257, 2865, 35633, 19249, 52017, 11057, 43825, 27441, 60209, 6961, 39729, + 23345, 56113, 15153, 47921, 31537, 64305, 1841, 34609, 18225, 50993, 10033, + 42801, 26417, 59185, 5937, 38705, 22321, 55089, 14129, 46897, 30513, 63281, + 3889, 36657, 20273, 53041, 12081, 44849, 28465, 61233, 7985, 40753, 24369, + 57137, 16177, 48945, 32561, 65329, 177, 32945, 16561, 49329, 8369, 41137, + 24753, 57521, 4273, 37041, 20657, 53425, 12465, 45233, 28849, 61617, 2225, + 34993, 18609, 51377, 10417, 43185, 26801, 59569, 6321, 39089, 22705, 55473, + 14513, 47281, 30897, 63665, 1201, 33969, 17585, 50353, 9393, 42161, 25777, + 58545, 5297, 38065, 21681, 54449, 13489, 46257, 29873, 62641, 3249, 36017, + 19633, 52401, 11441, 44209, 27825, 60593, 7345, 40113, 23729, 56497, 15537, + 48305, 31921, 64689, 689, 33457, 17073, 49841, 8881, 41649, 25265, 58033, + 4785, 37553, 21169, 53937, 12977, 45745, 29361, 62129, 2737, 35505, 19121, + 51889, 10929, 43697, 27313, 60081, 6833, 39601, 23217, 55985, 15025, 47793, + 31409, 64177, 1713, 34481, 18097, 50865, 9905, 42673, 26289, 59057, 5809, + 38577, 22193, 54961, 14001, 46769, 30385, 63153, 3761, 36529, 20145, 52913, + 11953, 44721, 28337, 61105, 7857, 40625, 24241, 57009, 16049, 48817, 32433, + 65201, 433, 33201, 16817, 49585, 8625, 41393, 25009, 57777, 4529, 37297, + 20913, 53681, 12721, 45489, 29105, 61873, 2481, 35249, 18865, 51633, 10673, + 43441, 27057, 59825, 6577, 39345, 22961, 55729, 14769, 47537, 31153, 63921, + 1457, 34225, 17841, 50609, 9649, 42417, 26033, 58801, 5553, 38321, 21937, + 54705, 13745, 46513, 30129, 62897, 3505, 36273, 19889, 52657, 11697, 44465, + 28081, 60849, 7601, 40369, 23985, 56753, 15793, 48561, 32177, 64945, 945, + 33713, 17329, 50097, 9137, 41905, 25521, 58289, 5041, 37809, 21425, 54193, + 13233, 46001, 29617, 62385, 2993, 35761, 19377, 52145, 11185, 43953, 27569, + 60337, 7089, 39857, 23473, 56241, 15281, 48049, 31665, 64433, 1969, 34737, + 18353, 51121, 10161, 42929, 26545, 59313, 6065, 38833, 22449, 55217, 14257, + 47025, 30641, 63409, 4017, 36785, 20401, 53169, 12209, 44977, 28593, 61361, + 8113, 40881, 24497, 57265, 16305, 49073, 32689, 65457, 113, 32881, 16497, + 49265, 8305, 41073, 24689, 57457, 4209, 36977, 20593, 53361, 12401, 45169, + 28785, 61553, 2161, 34929, 18545, 51313, 10353, 43121, 26737, 59505, 6257, + 39025, 22641, 55409, 14449, 47217, 30833, 63601, 1137, 33905, 17521, 50289, + 9329, 42097, 25713, 58481, 5233, 38001, 21617, 54385, 13425, 46193, 29809, + 62577, 3185, 35953, 19569, 52337, 11377, 44145, 27761, 60529, 7281, 40049, + 23665, 56433, 15473, 48241, 31857, 64625, 625, 33393, 17009, 49777, 8817, + 41585, 25201, 57969, 4721, 37489, 21105, 53873, 12913, 45681, 29297, 62065, + 2673, 35441, 19057, 51825, 10865, 43633, 27249, 60017, 6769, 39537, 23153, + 55921, 14961, 47729, 31345, 64113, 1649, 34417, 18033, 50801, 9841, 42609, + 26225, 58993, 5745, 38513, 22129, 54897, 13937, 46705, 30321, 63089, 3697, + 36465, 20081, 52849, 11889, 44657, 28273, 61041, 7793, 40561, 24177, 56945, + 15985, 48753, 32369, 65137, 369, 33137, 16753, 49521, 8561, 41329, 24945, + 57713, 4465, 37233, 20849, 53617, 12657, 45425, 29041, 61809, 2417, 35185, + 18801, 51569, 10609, 43377, 26993, 59761, 6513, 39281, 22897, 55665, 14705, + 47473, 31089, 63857, 1393, 34161, 17777, 50545, 9585, 42353, 25969, 58737, + 5489, 38257, 21873, 54641, 13681, 46449, 30065, 62833, 3441, 36209, 19825, + 52593, 11633, 44401, 28017, 60785, 7537, 40305, 23921, 56689, 15729, 48497, + 32113, 64881, 881, 33649, 17265, 50033, 9073, 41841, 25457, 58225, 4977, + 37745, 21361, 54129, 13169, 45937, 29553, 62321, 2929, 35697, 19313, 52081, + 11121, 43889, 27505, 60273, 7025, 39793, 23409, 56177, 15217, 47985, 31601, + 64369, 1905, 34673, 18289, 51057, 10097, 42865, 26481, 59249, 6001, 38769, + 22385, 55153, 14193, 46961, 30577, 63345, 3953, 36721, 20337, 53105, 12145, + 44913, 28529, 61297, 8049, 40817, 24433, 57201, 16241, 49009, 32625, 65393, + 241, 33009, 16625, 49393, 8433, 41201, 24817, 57585, 4337, 37105, 20721, + 53489, 12529, 45297, 28913, 61681, 2289, 35057, 18673, 51441, 10481, 43249, + 26865, 59633, 6385, 39153, 22769, 55537, 14577, 47345, 30961, 63729, 1265, + 34033, 17649, 50417, 9457, 42225, 25841, 58609, 5361, 38129, 21745, 54513, + 13553, 46321, 29937, 62705, 3313, 36081, 19697, 52465, 11505, 44273, 27889, + 60657, 7409, 40177, 23793, 56561, 15601, 48369, 31985, 64753, 753, 33521, + 17137, 49905, 8945, 41713, 25329, 58097, 4849, 37617, 21233, 54001, 13041, + 45809, 29425, 62193, 2801, 35569, 19185, 51953, 10993, 43761, 27377, 60145, + 6897, 39665, 23281, 56049, 15089, 47857, 31473, 64241, 1777, 34545, 18161, + 50929, 9969, 42737, 26353, 59121, 5873, 38641, 22257, 55025, 14065, 46833, + 30449, 63217, 3825, 36593, 20209, 52977, 12017, 44785, 28401, 61169, 7921, + 40689, 24305, 57073, 16113, 48881, 32497, 65265, 497, 33265, 16881, 49649, + 8689, 41457, 25073, 57841, 4593, 37361, 20977, 53745, 12785, 45553, 29169, + 61937, 2545, 35313, 18929, 51697, 10737, 43505, 27121, 59889, 6641, 39409, + 23025, 55793, 14833, 47601, 31217, 63985, 1521, 34289, 17905, 50673, 9713, + 42481, 26097, 58865, 5617, 38385, 22001, 54769, 13809, 46577, 30193, 62961, + 3569, 36337, 19953, 52721, 11761, 44529, 28145, 60913, 7665, 40433, 24049, + 56817, 15857, 48625, 32241, 65009, 1009, 33777, 17393, 50161, 9201, 41969, + 25585, 58353, 5105, 37873, 21489, 54257, 13297, 46065, 29681, 62449, 3057, + 35825, 19441, 52209, 11249, 44017, 27633, 60401, 7153, 39921, 23537, 56305, + 15345, 48113, 31729, 64497, 2033, 34801, 18417, 51185, 10225, 42993, 26609, + 59377, 6129, 38897, 22513, 55281, 14321, 47089, 30705, 63473, 4081, 36849, + 20465, 53233, 12273, 45041, 28657, 61425, 8177, 40945, 24561, 57329, 16369, + 49137, 32753, 65521, 9, 32777, 16393, 49161, 8201, 40969, 24585, 57353, + 4105, 36873, 20489, 53257, 12297, 45065, 28681, 61449, 2057, 34825, 18441, + 51209, 10249, 43017, 26633, 59401, 6153, 38921, 22537, 55305, 14345, 47113, + 30729, 63497, 1033, 33801, 17417, 50185, 9225, 41993, 25609, 58377, 5129, + 37897, 21513, 54281, 13321, 46089, 29705, 62473, 3081, 35849, 19465, 52233, + 11273, 44041, 27657, 60425, 7177, 39945, 23561, 56329, 15369, 48137, 31753, + 64521, 521, 33289, 16905, 49673, 8713, 41481, 25097, 57865, 4617, 37385, + 21001, 53769, 12809, 45577, 29193, 61961, 2569, 35337, 18953, 51721, 10761, + 43529, 27145, 59913, 6665, 39433, 23049, 55817, 14857, 47625, 31241, 64009, + 1545, 34313, 17929, 50697, 9737, 42505, 26121, 58889, 5641, 38409, 22025, + 54793, 13833, 46601, 30217, 62985, 3593, 36361, 19977, 52745, 11785, 44553, + 28169, 60937, 7689, 40457, 24073, 56841, 15881, 48649, 32265, 65033, 265, + 33033, 16649, 49417, 8457, 41225, 24841, 57609, 4361, 37129, 20745, 53513, + 12553, 45321, 28937, 61705, 2313, 35081, 18697, 51465, 10505, 43273, 26889, + 59657, 6409, 39177, 22793, 55561, 14601, 47369, 30985, 63753, 1289, 34057, + 17673, 50441, 9481, 42249, 25865, 58633, 5385, 38153, 21769, 54537, 13577, + 46345, 29961, 62729, 3337, 36105, 19721, 52489, 11529, 44297, 27913, 60681, + 7433, 40201, 23817, 56585, 15625, 48393, 32009, 64777, 777, 33545, 17161, + 49929, 8969, 41737, 25353, 58121, 4873, 37641, 21257, 54025, 13065, 45833, + 29449, 62217, 2825, 35593, 19209, 51977, 11017, 43785, 27401, 60169, 6921, + 39689, 23305, 56073, 15113, 47881, 31497, 64265, 1801, 34569, 18185, 50953, + 9993, 42761, 26377, 59145, 5897, 38665, 22281, 55049, 14089, 46857, 30473, + 63241, 3849, 36617, 20233, 53001, 12041, 44809, 28425, 61193, 7945, 40713, + 24329, 57097, 16137, 48905, 32521, 65289, 137, 32905, 16521, 49289, 8329, + 41097, 24713, 57481, 4233, 37001, 20617, 53385, 12425, 45193, 28809, 61577, + 2185, 34953, 18569, 51337, 10377, 43145, 26761, 59529, 6281, 39049, 22665, + 55433, 14473, 47241, 30857, 63625, 1161, 33929, 17545, 50313, 9353, 42121, + 25737, 58505, 5257, 38025, 21641, 54409, 13449, 46217, 29833, 62601, 3209, + 35977, 19593, 52361, 11401, 44169, 27785, 60553, 7305, 40073, 23689, 56457, + 15497, 48265, 31881, 64649, 649, 33417, 17033, 49801, 8841, 41609, 25225, + 57993, 4745, 37513, 21129, 53897, 12937, 45705, 29321, 62089, 2697, 35465, + 19081, 51849, 10889, 43657, 27273, 60041, 6793, 39561, 23177, 55945, 14985, + 47753, 31369, 64137, 1673, 34441, 18057, 50825, 9865, 42633, 26249, 59017, + 5769, 38537, 22153, 54921, 13961, 46729, 30345, 63113, 3721, 36489, 20105, + 52873, 11913, 44681, 28297, 61065, 7817, 40585, 24201, 56969, 16009, 48777, + 32393, 65161, 393, 33161, 16777, 49545, 8585, 41353, 24969, 57737, 4489, + 37257, 20873, 53641, 12681, 45449, 29065, 61833, 2441, 35209, 18825, 51593, + 10633, 43401, 27017, 59785, 6537, 39305, 22921, 55689, 14729, 47497, 31113, + 63881, 1417, 34185, 17801, 50569, 9609, 42377, 25993, 58761, 5513, 38281, + 21897, 54665, 13705, 46473, 30089, 62857, 3465, 36233, 19849, 52617, 11657, + 44425, 28041, 60809, 7561, 40329, 23945, 56713, 15753, 48521, 32137, 64905, + 905, 33673, 17289, 50057, 9097, 41865, 25481, 58249, 5001, 37769, 21385, + 54153, 13193, 45961, 29577, 62345, 2953, 35721, 19337, 52105, 11145, 43913, + 27529, 60297, 7049, 39817, 23433, 56201, 15241, 48009, 31625, 64393, 1929, + 34697, 18313, 51081, 10121, 42889, 26505, 59273, 6025, 38793, 22409, 55177, + 14217, 46985, 30601, 63369, 3977, 36745, 20361, 53129, 12169, 44937, 28553, + 61321, 8073, 40841, 24457, 57225, 16265, 49033, 32649, 65417, 73, 32841, + 16457, 49225, 8265, 41033, 24649, 57417, 4169, 36937, 20553, 53321, 12361, + 45129, 28745, 61513, 2121, 34889, 18505, 51273, 10313, 43081, 26697, 59465, + 6217, 38985, 22601, 55369, 14409, 47177, 30793, 63561, 1097, 33865, 17481, + 50249, 9289, 42057, 25673, 58441, 5193, 37961, 21577, 54345, 13385, 46153, + 29769, 62537, 3145, 35913, 19529, 52297, 11337, 44105, 27721, 60489, 7241, + 40009, 23625, 56393, 15433, 48201, 31817, 64585, 585, 33353, 16969, 49737, + 8777, 41545, 25161, 57929, 4681, 37449, 21065, 53833, 12873, 45641, 29257, + 62025, 2633, 35401, 19017, 51785, 10825, 43593, 27209, 59977, 6729, 39497, + 23113, 55881, 14921, 47689, 31305, 64073, 1609, 34377, 17993, 50761, 9801, + 42569, 26185, 58953, 5705, 38473, 22089, 54857, 13897, 46665, 30281, 63049, + 3657, 36425, 20041, 52809, 11849, 44617, 28233, 61001, 7753, 40521, 24137, + 56905, 15945, 48713, 32329, 65097, 329, 33097, 16713, 49481, 8521, 41289, + 24905, 57673, 4425, 37193, 20809, 53577, 12617, 45385, 29001, 61769, 2377, + 35145, 18761, 51529, 10569, 43337, 26953, 59721, 6473, 39241, 22857, 55625, + 14665, 47433, 31049, 63817, 1353, 34121, 17737, 50505, 9545, 42313, 25929, + 58697, 5449, 38217, 21833, 54601, 13641, 46409, 30025, 62793, 3401, 36169, + 19785, 52553, 11593, 44361, 27977, 60745, 7497, 40265, 23881, 56649, 15689, + 48457, 32073, 64841, 841, 33609, 17225, 49993, 9033, 41801, 25417, 58185, + 4937, 37705, 21321, 54089, 13129, 45897, 29513, 62281, 2889, 35657, 19273, + 52041, 11081, 43849, 27465, 60233, 6985, 39753, 23369, 56137, 15177, 47945, + 31561, 64329, 1865, 34633, 18249, 51017, 10057, 42825, 26441, 59209, 5961, + 38729, 22345, 55113, 14153, 46921, 30537, 63305, 3913, 36681, 20297, 53065, + 12105, 44873, 28489, 61257, 8009, 40777, 24393, 57161, 16201, 48969, 32585, + 65353, 201, 32969, 16585, 49353, 8393, 41161, 24777, 57545, 4297, 37065, + 20681, 53449, 12489, 45257, 28873, 61641, 2249, 35017, 18633, 51401, 10441, + 43209, 26825, 59593, 6345, 39113, 22729, 55497, 14537, 47305, 30921, 63689, + 1225, 33993, 17609, 50377, 9417, 42185, 25801, 58569, 5321, 38089, 21705, + 54473, 13513, 46281, 29897, 62665, 3273, 36041, 19657, 52425, 11465, 44233, + 27849, 60617, 7369, 40137, 23753, 56521, 15561, 48329, 31945, 64713, 713, + 33481, 17097, 49865, 8905, 41673, 25289, 58057, 4809, 37577, 21193, 53961, + 13001, 45769, 29385, 62153, 2761, 35529, 19145, 51913, 10953, 43721, 27337, + 60105, 6857, 39625, 23241, 56009, 15049, 47817, 31433, 64201, 1737, 34505, + 18121, 50889, 9929, 42697, 26313, 59081, 5833, 38601, 22217, 54985, 14025, + 46793, 30409, 63177, 3785, 36553, 20169, 52937, 11977, 44745, 28361, 61129, + 7881, 40649, 24265, 57033, 16073, 48841, 32457, 65225, 457, 33225, 16841, + 49609, 8649, 41417, 25033, 57801, 4553, 37321, 20937, 53705, 12745, 45513, + 29129, 61897, 2505, 35273, 18889, 51657, 10697, 43465, 27081, 59849, 6601, + 39369, 22985, 55753, 14793, 47561, 31177, 63945, 1481, 34249, 17865, 50633, + 9673, 42441, 26057, 58825, 5577, 38345, 21961, 54729, 13769, 46537, 30153, + 62921, 3529, 36297, 19913, 52681, 11721, 44489, 28105, 60873, 7625, 40393, + 24009, 56777, 15817, 48585, 32201, 64969, 969, 33737, 17353, 50121, 9161, + 41929, 25545, 58313, 5065, 37833, 21449, 54217, 13257, 46025, 29641, 62409, + 3017, 35785, 19401, 52169, 11209, 43977, 27593, 60361, 7113, 39881, 23497, + 56265, 15305, 48073, 31689, 64457, 1993, 34761, 18377, 51145, 10185, 42953, + 26569, 59337, 6089, 38857, 22473, 55241, 14281, 47049, 30665, 63433, 4041, + 36809, 20425, 53193, 12233, 45001, 28617, 61385, 8137, 40905, 24521, 57289, + 16329, 49097, 32713, 65481, 41, 32809, 16425, 49193, 8233, 41001, 24617, + 57385, 4137, 36905, 20521, 53289, 12329, 45097, 28713, 61481, 2089, 34857, + 18473, 51241, 10281, 43049, 26665, 59433, 6185, 38953, 22569, 55337, 14377, + 47145, 30761, 63529, 1065, 33833, 17449, 50217, 9257, 42025, 25641, 58409, + 5161, 37929, 21545, 54313, 13353, 46121, 29737, 62505, 3113, 35881, 19497, + 52265, 11305, 44073, 27689, 60457, 7209, 39977, 23593, 56361, 15401, 48169, + 31785, 64553, 553, 33321, 16937, 49705, 8745, 41513, 25129, 57897, 4649, + 37417, 21033, 53801, 12841, 45609, 29225, 61993, 2601, 35369, 18985, 51753, + 10793, 43561, 27177, 59945, 6697, 39465, 23081, 55849, 14889, 47657, 31273, + 64041, 1577, 34345, 17961, 50729, 9769, 42537, 26153, 58921, 5673, 38441, + 22057, 54825, 13865, 46633, 30249, 63017, 3625, 36393, 20009, 52777, 11817, + 44585, 28201, 60969, 7721, 40489, 24105, 56873, 15913, 48681, 32297, 65065, + 297, 33065, 16681, 49449, 8489, 41257, 24873, 57641, 4393, 37161, 20777, + 53545, 12585, 45353, 28969, 61737, 2345, 35113, 18729, 51497, 10537, 43305, + 26921, 59689, 6441, 39209, 22825, 55593, 14633, 47401, 31017, 63785, 1321, + 34089, 17705, 50473, 9513, 42281, 25897, 58665, 5417, 38185, 21801, 54569, + 13609, 46377, 29993, 62761, 3369, 36137, 19753, 52521, 11561, 44329, 27945, + 60713, 7465, 40233, 23849, 56617, 15657, 48425, 32041, 64809, 809, 33577, + 17193, 49961, 9001, 41769, 25385, 58153, 4905, 37673, 21289, 54057, 13097, + 45865, 29481, 62249, 2857, 35625, 19241, 52009, 11049, 43817, 27433, 60201, + 6953, 39721, 23337, 56105, 15145, 47913, 31529, 64297, 1833, 34601, 18217, + 50985, 10025, 42793, 26409, 59177, 5929, 38697, 22313, 55081, 14121, 46889, + 30505, 63273, 3881, 36649, 20265, 53033, 12073, 44841, 28457, 61225, 7977, + 40745, 24361, 57129, 16169, 48937, 32553, 65321, 169, 32937, 16553, 49321, + 8361, 41129, 24745, 57513, 4265, 37033, 20649, 53417, 12457, 45225, 28841, + 61609, 2217, 34985, 18601, 51369, 10409, 43177, 26793, 59561, 6313, 39081, + 22697, 55465, 14505, 47273, 30889, 63657, 1193, 33961, 17577, 50345, 9385, + 42153, 25769, 58537, 5289, 38057, 21673, 54441, 13481, 46249, 29865, 62633, + 3241, 36009, 19625, 52393, 11433, 44201, 27817, 60585, 7337, 40105, 23721, + 56489, 15529, 48297, 31913, 64681, 681, 33449, 17065, 49833, 8873, 41641, + 25257, 58025, 4777, 37545, 21161, 53929, 12969, 45737, 29353, 62121, 2729, + 35497, 19113, 51881, 10921, 43689, 27305, 60073, 6825, 39593, 23209, 55977, + 15017, 47785, 31401, 64169, 1705, 34473, 18089, 50857, 9897, 42665, 26281, + 59049, 5801, 38569, 22185, 54953, 13993, 46761, 30377, 63145, 3753, 36521, + 20137, 52905, 11945, 44713, 28329, 61097, 7849, 40617, 24233, 57001, 16041, + 48809, 32425, 65193, 425, 33193, 16809, 49577, 8617, 41385, 25001, 57769, + 4521, 37289, 20905, 53673, 12713, 45481, 29097, 61865, 2473, 35241, 18857, + 51625, 10665, 43433, 27049, 59817, 6569, 39337, 22953, 55721, 14761, 47529, + 31145, 63913, 1449, 34217, 17833, 50601, 9641, 42409, 26025, 58793, 5545, + 38313, 21929, 54697, 13737, 46505, 30121, 62889, 3497, 36265, 19881, 52649, + 11689, 44457, 28073, 60841, 7593, 40361, 23977, 56745, 15785, 48553, 32169, + 64937, 937, 33705, 17321, 50089, 9129, 41897, 25513, 58281, 5033, 37801, + 21417, 54185, 13225, 45993, 29609, 62377, 2985, 35753, 19369, 52137, 11177, + 43945, 27561, 60329, 7081, 39849, 23465, 56233, 15273, 48041, 31657, 64425, + 1961, 34729, 18345, 51113, 10153, 42921, 26537, 59305, 6057, 38825, 22441, + 55209, 14249, 47017, 30633, 63401, 4009, 36777, 20393, 53161, 12201, 44969, + 28585, 61353, 8105, 40873, 24489, 57257, 16297, 49065, 32681, 65449, 105, + 32873, 16489, 49257, 8297, 41065, 24681, 57449, 4201, 36969, 20585, 53353, + 12393, 45161, 28777, 61545, 2153, 34921, 18537, 51305, 10345, 43113, 26729, + 59497, 6249, 39017, 22633, 55401, 14441, 47209, 30825, 63593, 1129, 33897, + 17513, 50281, 9321, 42089, 25705, 58473, 5225, 37993, 21609, 54377, 13417, + 46185, 29801, 62569, 3177, 35945, 19561, 52329, 11369, 44137, 27753, 60521, + 7273, 40041, 23657, 56425, 15465, 48233, 31849, 64617, 617, 33385, 17001, + 49769, 8809, 41577, 25193, 57961, 4713, 37481, 21097, 53865, 12905, 45673, + 29289, 62057, 2665, 35433, 19049, 51817, 10857, 43625, 27241, 60009, 6761, + 39529, 23145, 55913, 14953, 47721, 31337, 64105, 1641, 34409, 18025, 50793, + 9833, 42601, 26217, 58985, 5737, 38505, 22121, 54889, 13929, 46697, 30313, + 63081, 3689, 36457, 20073, 52841, 11881, 44649, 28265, 61033, 7785, 40553, + 24169, 56937, 15977, 48745, 32361, 65129, 361, 33129, 16745, 49513, 8553, + 41321, 24937, 57705, 4457, 37225, 20841, 53609, 12649, 45417, 29033, 61801, + 2409, 35177, 18793, 51561, 10601, 43369, 26985, 59753, 6505, 39273, 22889, + 55657, 14697, 47465, 31081, 63849, 1385, 34153, 17769, 50537, 9577, 42345, + 25961, 58729, 5481, 38249, 21865, 54633, 13673, 46441, 30057, 62825, 3433, + 36201, 19817, 52585, 11625, 44393, 28009, 60777, 7529, 40297, 23913, 56681, + 15721, 48489, 32105, 64873, 873, 33641, 17257, 50025, 9065, 41833, 25449, + 58217, 4969, 37737, 21353, 54121, 13161, 45929, 29545, 62313, 2921, 35689, + 19305, 52073, 11113, 43881, 27497, 60265, 7017, 39785, 23401, 56169, 15209, + 47977, 31593, 64361, 1897, 34665, 18281, 51049, 10089, 42857, 26473, 59241, + 5993, 38761, 22377, 55145, 14185, 46953, 30569, 63337, 3945, 36713, 20329, + 53097, 12137, 44905, 28521, 61289, 8041, 40809, 24425, 57193, 16233, 49001, + 32617, 65385, 233, 33001, 16617, 49385, 8425, 41193, 24809, 57577, 4329, + 37097, 20713, 53481, 12521, 45289, 28905, 61673, 2281, 35049, 18665, 51433, + 10473, 43241, 26857, 59625, 6377, 39145, 22761, 55529, 14569, 47337, 30953, + 63721, 1257, 34025, 17641, 50409, 9449, 42217, 25833, 58601, 5353, 38121, + 21737, 54505, 13545, 46313, 29929, 62697, 3305, 36073, 19689, 52457, 11497, + 44265, 27881, 60649, 7401, 40169, 23785, 56553, 15593, 48361, 31977, 64745, + 745, 33513, 17129, 49897, 8937, 41705, 25321, 58089, 4841, 37609, 21225, + 53993, 13033, 45801, 29417, 62185, 2793, 35561, 19177, 51945, 10985, 43753, + 27369, 60137, 6889, 39657, 23273, 56041, 15081, 47849, 31465, 64233, 1769, + 34537, 18153, 50921, 9961, 42729, 26345, 59113, 5865, 38633, 22249, 55017, + 14057, 46825, 30441, 63209, 3817, 36585, 20201, 52969, 12009, 44777, 28393, + 61161, 7913, 40681, 24297, 57065, 16105, 48873, 32489, 65257, 489, 33257, + 16873, 49641, 8681, 41449, 25065, 57833, 4585, 37353, 20969, 53737, 12777, + 45545, 29161, 61929, 2537, 35305, 18921, 51689, 10729, 43497, 27113, 59881, + 6633, 39401, 23017, 55785, 14825, 47593, 31209, 63977, 1513, 34281, 17897, + 50665, 9705, 42473, 26089, 58857, 5609, 38377, 21993, 54761, 13801, 46569, + 30185, 62953, 3561, 36329, 19945, 52713, 11753, 44521, 28137, 60905, 7657, + 40425, 24041, 56809, 15849, 48617, 32233, 65001, 1001, 33769, 17385, 50153, + 9193, 41961, 25577, 58345, 5097, 37865, 21481, 54249, 13289, 46057, 29673, + 62441, 3049, 35817, 19433, 52201, 11241, 44009, 27625, 60393, 7145, 39913, + 23529, 56297, 15337, 48105, 31721, 64489, 2025, 34793, 18409, 51177, 10217, + 42985, 26601, 59369, 6121, 38889, 22505, 55273, 14313, 47081, 30697, 63465, + 4073, 36841, 20457, 53225, 12265, 45033, 28649, 61417, 8169, 40937, 24553, + 57321, 16361, 49129, 32745, 65513, 25, 32793, 16409, 49177, 8217, 40985, + 24601, 57369, 4121, 36889, 20505, 53273, 12313, 45081, 28697, 61465, 2073, + 34841, 18457, 51225, 10265, 43033, 26649, 59417, 6169, 38937, 22553, 55321, + 14361, 47129, 30745, 63513, 1049, 33817, 17433, 50201, 9241, 42009, 25625, + 58393, 5145, 37913, 21529, 54297, 13337, 46105, 29721, 62489, 3097, 35865, + 19481, 52249, 11289, 44057, 27673, 60441, 7193, 39961, 23577, 56345, 15385, + 48153, 31769, 64537, 537, 33305, 16921, 49689, 8729, 41497, 25113, 57881, + 4633, 37401, 21017, 53785, 12825, 45593, 29209, 61977, 2585, 35353, 18969, + 51737, 10777, 43545, 27161, 59929, 6681, 39449, 23065, 55833, 14873, 47641, + 31257, 64025, 1561, 34329, 17945, 50713, 9753, 42521, 26137, 58905, 5657, + 38425, 22041, 54809, 13849, 46617, 30233, 63001, 3609, 36377, 19993, 52761, + 11801, 44569, 28185, 60953, 7705, 40473, 24089, 56857, 15897, 48665, 32281, + 65049, 281, 33049, 16665, 49433, 8473, 41241, 24857, 57625, 4377, 37145, + 20761, 53529, 12569, 45337, 28953, 61721, 2329, 35097, 18713, 51481, 10521, + 43289, 26905, 59673, 6425, 39193, 22809, 55577, 14617, 47385, 31001, 63769, + 1305, 34073, 17689, 50457, 9497, 42265, 25881, 58649, 5401, 38169, 21785, + 54553, 13593, 46361, 29977, 62745, 3353, 36121, 19737, 52505, 11545, 44313, + 27929, 60697, 7449, 40217, 23833, 56601, 15641, 48409, 32025, 64793, 793, + 33561, 17177, 49945, 8985, 41753, 25369, 58137, 4889, 37657, 21273, 54041, + 13081, 45849, 29465, 62233, 2841, 35609, 19225, 51993, 11033, 43801, 27417, + 60185, 6937, 39705, 23321, 56089, 15129, 47897, 31513, 64281, 1817, 34585, + 18201, 50969, 10009, 42777, 26393, 59161, 5913, 38681, 22297, 55065, 14105, + 46873, 30489, 63257, 3865, 36633, 20249, 53017, 12057, 44825, 28441, 61209, + 7961, 40729, 24345, 57113, 16153, 48921, 32537, 65305, 153, 32921, 16537, + 49305, 8345, 41113, 24729, 57497, 4249, 37017, 20633, 53401, 12441, 45209, + 28825, 61593, 2201, 34969, 18585, 51353, 10393, 43161, 26777, 59545, 6297, + 39065, 22681, 55449, 14489, 47257, 30873, 63641, 1177, 33945, 17561, 50329, + 9369, 42137, 25753, 58521, 5273, 38041, 21657, 54425, 13465, 46233, 29849, + 62617, 3225, 35993, 19609, 52377, 11417, 44185, 27801, 60569, 7321, 40089, + 23705, 56473, 15513, 48281, 31897, 64665, 665, 33433, 17049, 49817, 8857, + 41625, 25241, 58009, 4761, 37529, 21145, 53913, 12953, 45721, 29337, 62105, + 2713, 35481, 19097, 51865, 10905, 43673, 27289, 60057, 6809, 39577, 23193, + 55961, 15001, 47769, 31385, 64153, 1689, 34457, 18073, 50841, 9881, 42649, + 26265, 59033, 5785, 38553, 22169, 54937, 13977, 46745, 30361, 63129, 3737, + 36505, 20121, 52889, 11929, 44697, 28313, 61081, 7833, 40601, 24217, 56985, + 16025, 48793, 32409, 65177, 409, 33177, 16793, 49561, 8601, 41369, 24985, + 57753, 4505, 37273, 20889, 53657, 12697, 45465, 29081, 61849, 2457, 35225, + 18841, 51609, 10649, 43417, 27033, 59801, 6553, 39321, 22937, 55705, 14745, + 47513, 31129, 63897, 1433, 34201, 17817, 50585, 9625, 42393, 26009, 58777, + 5529, 38297, 21913, 54681, 13721, 46489, 30105, 62873, 3481, 36249, 19865, + 52633, 11673, 44441, 28057, 60825, 7577, 40345, 23961, 56729, 15769, 48537, + 32153, 64921, 921, 33689, 17305, 50073, 9113, 41881, 25497, 58265, 5017, + 37785, 21401, 54169, 13209, 45977, 29593, 62361, 2969, 35737, 19353, 52121, + 11161, 43929, 27545, 60313, 7065, 39833, 23449, 56217, 15257, 48025, 31641, + 64409, 1945, 34713, 18329, 51097, 10137, 42905, 26521, 59289, 6041, 38809, + 22425, 55193, 14233, 47001, 30617, 63385, 3993, 36761, 20377, 53145, 12185, + 44953, 28569, 61337, 8089, 40857, 24473, 57241, 16281, 49049, 32665, 65433, + 89, 32857, 16473, 49241, 8281, 41049, 24665, 57433, 4185, 36953, 20569, + 53337, 12377, 45145, 28761, 61529, 2137, 34905, 18521, 51289, 10329, 43097, + 26713, 59481, 6233, 39001, 22617, 55385, 14425, 47193, 30809, 63577, 1113, + 33881, 17497, 50265, 9305, 42073, 25689, 58457, 5209, 37977, 21593, 54361, + 13401, 46169, 29785, 62553, 3161, 35929, 19545, 52313, 11353, 44121, 27737, + 60505, 7257, 40025, 23641, 56409, 15449, 48217, 31833, 64601, 601, 33369, + 16985, 49753, 8793, 41561, 25177, 57945, 4697, 37465, 21081, 53849, 12889, + 45657, 29273, 62041, 2649, 35417, 19033, 51801, 10841, 43609, 27225, 59993, + 6745, 39513, 23129, 55897, 14937, 47705, 31321, 64089, 1625, 34393, 18009, + 50777, 9817, 42585, 26201, 58969, 5721, 38489, 22105, 54873, 13913, 46681, + 30297, 63065, 3673, 36441, 20057, 52825, 11865, 44633, 28249, 61017, 7769, + 40537, 24153, 56921, 15961, 48729, 32345, 65113, 345, 33113, 16729, 49497, + 8537, 41305, 24921, 57689, 4441, 37209, 20825, 53593, 12633, 45401, 29017, + 61785, 2393, 35161, 18777, 51545, 10585, 43353, 26969, 59737, 6489, 39257, + 22873, 55641, 14681, 47449, 31065, 63833, 1369, 34137, 17753, 50521, 9561, + 42329, 25945, 58713, 5465, 38233, 21849, 54617, 13657, 46425, 30041, 62809, + 3417, 36185, 19801, 52569, 11609, 44377, 27993, 60761, 7513, 40281, 23897, + 56665, 15705, 48473, 32089, 64857, 857, 33625, 17241, 50009, 9049, 41817, + 25433, 58201, 4953, 37721, 21337, 54105, 13145, 45913, 29529, 62297, 2905, + 35673, 19289, 52057, 11097, 43865, 27481, 60249, 7001, 39769, 23385, 56153, + 15193, 47961, 31577, 64345, 1881, 34649, 18265, 51033, 10073, 42841, 26457, + 59225, 5977, 38745, 22361, 55129, 14169, 46937, 30553, 63321, 3929, 36697, + 20313, 53081, 12121, 44889, 28505, 61273, 8025, 40793, 24409, 57177, 16217, + 48985, 32601, 65369, 217, 32985, 16601, 49369, 8409, 41177, 24793, 57561, + 4313, 37081, 20697, 53465, 12505, 45273, 28889, 61657, 2265, 35033, 18649, + 51417, 10457, 43225, 26841, 59609, 6361, 39129, 22745, 55513, 14553, 47321, + 30937, 63705, 1241, 34009, 17625, 50393, 9433, 42201, 25817, 58585, 5337, + 38105, 21721, 54489, 13529, 46297, 29913, 62681, 3289, 36057, 19673, 52441, + 11481, 44249, 27865, 60633, 7385, 40153, 23769, 56537, 15577, 48345, 31961, + 64729, 729, 33497, 17113, 49881, 8921, 41689, 25305, 58073, 4825, 37593, + 21209, 53977, 13017, 45785, 29401, 62169, 2777, 35545, 19161, 51929, 10969, + 43737, 27353, 60121, 6873, 39641, 23257, 56025, 15065, 47833, 31449, 64217, + 1753, 34521, 18137, 50905, 9945, 42713, 26329, 59097, 5849, 38617, 22233, + 55001, 14041, 46809, 30425, 63193, 3801, 36569, 20185, 52953, 11993, 44761, + 28377, 61145, 7897, 40665, 24281, 57049, 16089, 48857, 32473, 65241, 473, + 33241, 16857, 49625, 8665, 41433, 25049, 57817, 4569, 37337, 20953, 53721, + 12761, 45529, 29145, 61913, 2521, 35289, 18905, 51673, 10713, 43481, 27097, + 59865, 6617, 39385, 23001, 55769, 14809, 47577, 31193, 63961, 1497, 34265, + 17881, 50649, 9689, 42457, 26073, 58841, 5593, 38361, 21977, 54745, 13785, + 46553, 30169, 62937, 3545, 36313, 19929, 52697, 11737, 44505, 28121, 60889, + 7641, 40409, 24025, 56793, 15833, 48601, 32217, 64985, 985, 33753, 17369, + 50137, 9177, 41945, 25561, 58329, 5081, 37849, 21465, 54233, 13273, 46041, + 29657, 62425, 3033, 35801, 19417, 52185, 11225, 43993, 27609, 60377, 7129, + 39897, 23513, 56281, 15321, 48089, 31705, 64473, 2009, 34777, 18393, 51161, + 10201, 42969, 26585, 59353, 6105, 38873, 22489, 55257, 14297, 47065, 30681, + 63449, 4057, 36825, 20441, 53209, 12249, 45017, 28633, 61401, 8153, 40921, + 24537, 57305, 16345, 49113, 32729, 65497, 57, 32825, 16441, 49209, 8249, + 41017, 24633, 57401, 4153, 36921, 20537, 53305, 12345, 45113, 28729, 61497, + 2105, 34873, 18489, 51257, 10297, 43065, 26681, 59449, 6201, 38969, 22585, + 55353, 14393, 47161, 30777, 63545, 1081, 33849, 17465, 50233, 9273, 42041, + 25657, 58425, 5177, 37945, 21561, 54329, 13369, 46137, 29753, 62521, 3129, + 35897, 19513, 52281, 11321, 44089, 27705, 60473, 7225, 39993, 23609, 56377, + 15417, 48185, 31801, 64569, 569, 33337, 16953, 49721, 8761, 41529, 25145, + 57913, 4665, 37433, 21049, 53817, 12857, 45625, 29241, 62009, 2617, 35385, + 19001, 51769, 10809, 43577, 27193, 59961, 6713, 39481, 23097, 55865, 14905, + 47673, 31289, 64057, 1593, 34361, 17977, 50745, 9785, 42553, 26169, 58937, + 5689, 38457, 22073, 54841, 13881, 46649, 30265, 63033, 3641, 36409, 20025, + 52793, 11833, 44601, 28217, 60985, 7737, 40505, 24121, 56889, 15929, 48697, + 32313, 65081, 313, 33081, 16697, 49465, 8505, 41273, 24889, 57657, 4409, + 37177, 20793, 53561, 12601, 45369, 28985, 61753, 2361, 35129, 18745, 51513, + 10553, 43321, 26937, 59705, 6457, 39225, 22841, 55609, 14649, 47417, 31033, + 63801, 1337, 34105, 17721, 50489, 9529, 42297, 25913, 58681, 5433, 38201, + 21817, 54585, 13625, 46393, 30009, 62777, 3385, 36153, 19769, 52537, 11577, + 44345, 27961, 60729, 7481, 40249, 23865, 56633, 15673, 48441, 32057, 64825, + 825, 33593, 17209, 49977, 9017, 41785, 25401, 58169, 4921, 37689, 21305, + 54073, 13113, 45881, 29497, 62265, 2873, 35641, 19257, 52025, 11065, 43833, + 27449, 60217, 6969, 39737, 23353, 56121, 15161, 47929, 31545, 64313, 1849, + 34617, 18233, 51001, 10041, 42809, 26425, 59193, 5945, 38713, 22329, 55097, + 14137, 46905, 30521, 63289, 3897, 36665, 20281, 53049, 12089, 44857, 28473, + 61241, 7993, 40761, 24377, 57145, 16185, 48953, 32569, 65337, 185, 32953, + 16569, 49337, 8377, 41145, 24761, 57529, 4281, 37049, 20665, 53433, 12473, + 45241, 28857, 61625, 2233, 35001, 18617, 51385, 10425, 43193, 26809, 59577, + 6329, 39097, 22713, 55481, 14521, 47289, 30905, 63673, 1209, 33977, 17593, + 50361, 9401, 42169, 25785, 58553, 5305, 38073, 21689, 54457, 13497, 46265, + 29881, 62649, 3257, 36025, 19641, 52409, 11449, 44217, 27833, 60601, 7353, + 40121, 23737, 56505, 15545, 48313, 31929, 64697, 697, 33465, 17081, 49849, + 8889, 41657, 25273, 58041, 4793, 37561, 21177, 53945, 12985, 45753, 29369, + 62137, 2745, 35513, 19129, 51897, 10937, 43705, 27321, 60089, 6841, 39609, + 23225, 55993, 15033, 47801, 31417, 64185, 1721, 34489, 18105, 50873, 9913, + 42681, 26297, 59065, 5817, 38585, 22201, 54969, 14009, 46777, 30393, 63161, + 3769, 36537, 20153, 52921, 11961, 44729, 28345, 61113, 7865, 40633, 24249, + 57017, 16057, 48825, 32441, 65209, 441, 33209, 16825, 49593, 8633, 41401, + 25017, 57785, 4537, 37305, 20921, 53689, 12729, 45497, 29113, 61881, 2489, + 35257, 18873, 51641, 10681, 43449, 27065, 59833, 6585, 39353, 22969, 55737, + 14777, 47545, 31161, 63929, 1465, 34233, 17849, 50617, 9657, 42425, 26041, + 58809, 5561, 38329, 21945, 54713, 13753, 46521, 30137, 62905, 3513, 36281, + 19897, 52665, 11705, 44473, 28089, 60857, 7609, 40377, 23993, 56761, 15801, + 48569, 32185, 64953, 953, 33721, 17337, 50105, 9145, 41913, 25529, 58297, + 5049, 37817, 21433, 54201, 13241, 46009, 29625, 62393, 3001, 35769, 19385, + 52153, 11193, 43961, 27577, 60345, 7097, 39865, 23481, 56249, 15289, 48057, + 31673, 64441, 1977, 34745, 18361, 51129, 10169, 42937, 26553, 59321, 6073, + 38841, 22457, 55225, 14265, 47033, 30649, 63417, 4025, 36793, 20409, 53177, + 12217, 44985, 28601, 61369, 8121, 40889, 24505, 57273, 16313, 49081, 32697, + 65465, 121, 32889, 16505, 49273, 8313, 41081, 24697, 57465, 4217, 36985, + 20601, 53369, 12409, 45177, 28793, 61561, 2169, 34937, 18553, 51321, 10361, + 43129, 26745, 59513, 6265, 39033, 22649, 55417, 14457, 47225, 30841, 63609, + 1145, 33913, 17529, 50297, 9337, 42105, 25721, 58489, 5241, 38009, 21625, + 54393, 13433, 46201, 29817, 62585, 3193, 35961, 19577, 52345, 11385, 44153, + 27769, 60537, 7289, 40057, 23673, 56441, 15481, 48249, 31865, 64633, 633, + 33401, 17017, 49785, 8825, 41593, 25209, 57977, 4729, 37497, 21113, 53881, + 12921, 45689, 29305, 62073, 2681, 35449, 19065, 51833, 10873, 43641, 27257, + 60025, 6777, 39545, 23161, 55929, 14969, 47737, 31353, 64121, 1657, 34425, + 18041, 50809, 9849, 42617, 26233, 59001, 5753, 38521, 22137, 54905, 13945, + 46713, 30329, 63097, 3705, 36473, 20089, 52857, 11897, 44665, 28281, 61049, + 7801, 40569, 24185, 56953, 15993, 48761, 32377, 65145, 377, 33145, 16761, + 49529, 8569, 41337, 24953, 57721, 4473, 37241, 20857, 53625, 12665, 45433, + 29049, 61817, 2425, 35193, 18809, 51577, 10617, 43385, 27001, 59769, 6521, + 39289, 22905, 55673, 14713, 47481, 31097, 63865, 1401, 34169, 17785, 50553, + 9593, 42361, 25977, 58745, 5497, 38265, 21881, 54649, 13689, 46457, 30073, + 62841, 3449, 36217, 19833, 52601, 11641, 44409, 28025, 60793, 7545, 40313, + 23929, 56697, 15737, 48505, 32121, 64889, 889, 33657, 17273, 50041, 9081, + 41849, 25465, 58233, 4985, 37753, 21369, 54137, 13177, 45945, 29561, 62329, + 2937, 35705, 19321, 52089, 11129, 43897, 27513, 60281, 7033, 39801, 23417, + 56185, 15225, 47993, 31609, 64377, 1913, 34681, 18297, 51065, 10105, 42873, + 26489, 59257, 6009, 38777, 22393, 55161, 14201, 46969, 30585, 63353, 3961, + 36729, 20345, 53113, 12153, 44921, 28537, 61305, 8057, 40825, 24441, 57209, + 16249, 49017, 32633, 65401, 249, 33017, 16633, 49401, 8441, 41209, 24825, + 57593, 4345, 37113, 20729, 53497, 12537, 45305, 28921, 61689, 2297, 35065, + 18681, 51449, 10489, 43257, 26873, 59641, 6393, 39161, 22777, 55545, 14585, + 47353, 30969, 63737, 1273, 34041, 17657, 50425, 9465, 42233, 25849, 58617, + 5369, 38137, 21753, 54521, 13561, 46329, 29945, 62713, 3321, 36089, 19705, + 52473, 11513, 44281, 27897, 60665, 7417, 40185, 23801, 56569, 15609, 48377, + 31993, 64761, 761, 33529, 17145, 49913, 8953, 41721, 25337, 58105, 4857, + 37625, 21241, 54009, 13049, 45817, 29433, 62201, 2809, 35577, 19193, 51961, + 11001, 43769, 27385, 60153, 6905, 39673, 23289, 56057, 15097, 47865, 31481, + 64249, 1785, 34553, 18169, 50937, 9977, 42745, 26361, 59129, 5881, 38649, + 22265, 55033, 14073, 46841, 30457, 63225, 3833, 36601, 20217, 52985, 12025, + 44793, 28409, 61177, 7929, 40697, 24313, 57081, 16121, 48889, 32505, 65273, + 505, 33273, 16889, 49657, 8697, 41465, 25081, 57849, 4601, 37369, 20985, + 53753, 12793, 45561, 29177, 61945, 2553, 35321, 18937, 51705, 10745, 43513, + 27129, 59897, 6649, 39417, 23033, 55801, 14841, 47609, 31225, 63993, 1529, + 34297, 17913, 50681, 9721, 42489, 26105, 58873, 5625, 38393, 22009, 54777, + 13817, 46585, 30201, 62969, 3577, 36345, 19961, 52729, 11769, 44537, 28153, + 60921, 7673, 40441, 24057, 56825, 15865, 48633, 32249, 65017, 1017, 33785, + 17401, 50169, 9209, 41977, 25593, 58361, 5113, 37881, 21497, 54265, 13305, + 46073, 29689, 62457, 3065, 35833, 19449, 52217, 11257, 44025, 27641, 60409, + 7161, 39929, 23545, 56313, 15353, 48121, 31737, 64505, 2041, 34809, 18425, + 51193, 10233, 43001, 26617, 59385, 6137, 38905, 22521, 55289, 14329, 47097, + 30713, 63481, 4089, 36857, 20473, 53241, 12281, 45049, 28665, 61433, 8185, + 40953, 24569, 57337, 16377, 49145, 32761, 65529, 5, 32773, 16389, 49157, + 8197, 40965, 24581, 57349, 4101, 36869, 20485, 53253, 12293, 45061, 28677, + 61445, 2053, 34821, 18437, 51205, 10245, 43013, 26629, 59397, 6149, 38917, + 22533, 55301, 14341, 47109, 30725, 63493, 1029, 33797, 17413, 50181, 9221, + 41989, 25605, 58373, 5125, 37893, 21509, 54277, 13317, 46085, 29701, 62469, + 3077, 35845, 19461, 52229, 11269, 44037, 27653, 60421, 7173, 39941, 23557, + 56325, 15365, 48133, 31749, 64517, 517, 33285, 16901, 49669, 8709, 41477, + 25093, 57861, 4613, 37381, 20997, 53765, 12805, 45573, 29189, 61957, 2565, + 35333, 18949, 51717, 10757, 43525, 27141, 59909, 6661, 39429, 23045, 55813, + 14853, 47621, 31237, 64005, 1541, 34309, 17925, 50693, 9733, 42501, 26117, + 58885, 5637, 38405, 22021, 54789, 13829, 46597, 30213, 62981, 3589, 36357, + 19973, 52741, 11781, 44549, 28165, 60933, 7685, 40453, 24069, 56837, 15877, + 48645, 32261, 65029, 261, 33029, 16645, 49413, 8453, 41221, 24837, 57605, + 4357, 37125, 20741, 53509, 12549, 45317, 28933, 61701, 2309, 35077, 18693, + 51461, 10501, 43269, 26885, 59653, 6405, 39173, 22789, 55557, 14597, 47365, + 30981, 63749, 1285, 34053, 17669, 50437, 9477, 42245, 25861, 58629, 5381, + 38149, 21765, 54533, 13573, 46341, 29957, 62725, 3333, 36101, 19717, 52485, + 11525, 44293, 27909, 60677, 7429, 40197, 23813, 56581, 15621, 48389, 32005, + 64773, 773, 33541, 17157, 49925, 8965, 41733, 25349, 58117, 4869, 37637, + 21253, 54021, 13061, 45829, 29445, 62213, 2821, 35589, 19205, 51973, 11013, + 43781, 27397, 60165, 6917, 39685, 23301, 56069, 15109, 47877, 31493, 64261, + 1797, 34565, 18181, 50949, 9989, 42757, 26373, 59141, 5893, 38661, 22277, + 55045, 14085, 46853, 30469, 63237, 3845, 36613, 20229, 52997, 12037, 44805, + 28421, 61189, 7941, 40709, 24325, 57093, 16133, 48901, 32517, 65285, 133, + 32901, 16517, 49285, 8325, 41093, 24709, 57477, 4229, 36997, 20613, 53381, + 12421, 45189, 28805, 61573, 2181, 34949, 18565, 51333, 10373, 43141, 26757, + 59525, 6277, 39045, 22661, 55429, 14469, 47237, 30853, 63621, 1157, 33925, + 17541, 50309, 9349, 42117, 25733, 58501, 5253, 38021, 21637, 54405, 13445, + 46213, 29829, 62597, 3205, 35973, 19589, 52357, 11397, 44165, 27781, 60549, + 7301, 40069, 23685, 56453, 15493, 48261, 31877, 64645, 645, 33413, 17029, + 49797, 8837, 41605, 25221, 57989, 4741, 37509, 21125, 53893, 12933, 45701, + 29317, 62085, 2693, 35461, 19077, 51845, 10885, 43653, 27269, 60037, 6789, + 39557, 23173, 55941, 14981, 47749, 31365, 64133, 1669, 34437, 18053, 50821, + 9861, 42629, 26245, 59013, 5765, 38533, 22149, 54917, 13957, 46725, 30341, + 63109, 3717, 36485, 20101, 52869, 11909, 44677, 28293, 61061, 7813, 40581, + 24197, 56965, 16005, 48773, 32389, 65157, 389, 33157, 16773, 49541, 8581, + 41349, 24965, 57733, 4485, 37253, 20869, 53637, 12677, 45445, 29061, 61829, + 2437, 35205, 18821, 51589, 10629, 43397, 27013, 59781, 6533, 39301, 22917, + 55685, 14725, 47493, 31109, 63877, 1413, 34181, 17797, 50565, 9605, 42373, + 25989, 58757, 5509, 38277, 21893, 54661, 13701, 46469, 30085, 62853, 3461, + 36229, 19845, 52613, 11653, 44421, 28037, 60805, 7557, 40325, 23941, 56709, + 15749, 48517, 32133, 64901, 901, 33669, 17285, 50053, 9093, 41861, 25477, + 58245, 4997, 37765, 21381, 54149, 13189, 45957, 29573, 62341, 2949, 35717, + 19333, 52101, 11141, 43909, 27525, 60293, 7045, 39813, 23429, 56197, 15237, + 48005, 31621, 64389, 1925, 34693, 18309, 51077, 10117, 42885, 26501, 59269, + 6021, 38789, 22405, 55173, 14213, 46981, 30597, 63365, 3973, 36741, 20357, + 53125, 12165, 44933, 28549, 61317, 8069, 40837, 24453, 57221, 16261, 49029, + 32645, 65413, 69, 32837, 16453, 49221, 8261, 41029, 24645, 57413, 4165, + 36933, 20549, 53317, 12357, 45125, 28741, 61509, 2117, 34885, 18501, 51269, + 10309, 43077, 26693, 59461, 6213, 38981, 22597, 55365, 14405, 47173, 30789, + 63557, 1093, 33861, 17477, 50245, 9285, 42053, 25669, 58437, 5189, 37957, + 21573, 54341, 13381, 46149, 29765, 62533, 3141, 35909, 19525, 52293, 11333, + 44101, 27717, 60485, 7237, 40005, 23621, 56389, 15429, 48197, 31813, 64581, + 581, 33349, 16965, 49733, 8773, 41541, 25157, 57925, 4677, 37445, 21061, + 53829, 12869, 45637, 29253, 62021, 2629, 35397, 19013, 51781, 10821, 43589, + 27205, 59973, 6725, 39493, 23109, 55877, 14917, 47685, 31301, 64069, 1605, + 34373, 17989, 50757, 9797, 42565, 26181, 58949, 5701, 38469, 22085, 54853, + 13893, 46661, 30277, 63045, 3653, 36421, 20037, 52805, 11845, 44613, 28229, + 60997, 7749, 40517, 24133, 56901, 15941, 48709, 32325, 65093, 325, 33093, + 16709, 49477, 8517, 41285, 24901, 57669, 4421, 37189, 20805, 53573, 12613, + 45381, 28997, 61765, 2373, 35141, 18757, 51525, 10565, 43333, 26949, 59717, + 6469, 39237, 22853, 55621, 14661, 47429, 31045, 63813, 1349, 34117, 17733, + 50501, 9541, 42309, 25925, 58693, 5445, 38213, 21829, 54597, 13637, 46405, + 30021, 62789, 3397, 36165, 19781, 52549, 11589, 44357, 27973, 60741, 7493, + 40261, 23877, 56645, 15685, 48453, 32069, 64837, 837, 33605, 17221, 49989, + 9029, 41797, 25413, 58181, 4933, 37701, 21317, 54085, 13125, 45893, 29509, + 62277, 2885, 35653, 19269, 52037, 11077, 43845, 27461, 60229, 6981, 39749, + 23365, 56133, 15173, 47941, 31557, 64325, 1861, 34629, 18245, 51013, 10053, + 42821, 26437, 59205, 5957, 38725, 22341, 55109, 14149, 46917, 30533, 63301, + 3909, 36677, 20293, 53061, 12101, 44869, 28485, 61253, 8005, 40773, 24389, + 57157, 16197, 48965, 32581, 65349, 197, 32965, 16581, 49349, 8389, 41157, + 24773, 57541, 4293, 37061, 20677, 53445, 12485, 45253, 28869, 61637, 2245, + 35013, 18629, 51397, 10437, 43205, 26821, 59589, 6341, 39109, 22725, 55493, + 14533, 47301, 30917, 63685, 1221, 33989, 17605, 50373, 9413, 42181, 25797, + 58565, 5317, 38085, 21701, 54469, 13509, 46277, 29893, 62661, 3269, 36037, + 19653, 52421, 11461, 44229, 27845, 60613, 7365, 40133, 23749, 56517, 15557, + 48325, 31941, 64709, 709, 33477, 17093, 49861, 8901, 41669, 25285, 58053, + 4805, 37573, 21189, 53957, 12997, 45765, 29381, 62149, 2757, 35525, 19141, + 51909, 10949, 43717, 27333, 60101, 6853, 39621, 23237, 56005, 15045, 47813, + 31429, 64197, 1733, 34501, 18117, 50885, 9925, 42693, 26309, 59077, 5829, + 38597, 22213, 54981, 14021, 46789, 30405, 63173, 3781, 36549, 20165, 52933, + 11973, 44741, 28357, 61125, 7877, 40645, 24261, 57029, 16069, 48837, 32453, + 65221, 453, 33221, 16837, 49605, 8645, 41413, 25029, 57797, 4549, 37317, + 20933, 53701, 12741, 45509, 29125, 61893, 2501, 35269, 18885, 51653, 10693, + 43461, 27077, 59845, 6597, 39365, 22981, 55749, 14789, 47557, 31173, 63941, + 1477, 34245, 17861, 50629, 9669, 42437, 26053, 58821, 5573, 38341, 21957, + 54725, 13765, 46533, 30149, 62917, 3525, 36293, 19909, 52677, 11717, 44485, + 28101, 60869, 7621, 40389, 24005, 56773, 15813, 48581, 32197, 64965, 965, + 33733, 17349, 50117, 9157, 41925, 25541, 58309, 5061, 37829, 21445, 54213, + 13253, 46021, 29637, 62405, 3013, 35781, 19397, 52165, 11205, 43973, 27589, + 60357, 7109, 39877, 23493, 56261, 15301, 48069, 31685, 64453, 1989, 34757, + 18373, 51141, 10181, 42949, 26565, 59333, 6085, 38853, 22469, 55237, 14277, + 47045, 30661, 63429, 4037, 36805, 20421, 53189, 12229, 44997, 28613, 61381, + 8133, 40901, 24517, 57285, 16325, 49093, 32709, 65477, 37, 32805, 16421, + 49189, 8229, 40997, 24613, 57381, 4133, 36901, 20517, 53285, 12325, 45093, + 28709, 61477, 2085, 34853, 18469, 51237, 10277, 43045, 26661, 59429, 6181, + 38949, 22565, 55333, 14373, 47141, 30757, 63525, 1061, 33829, 17445, 50213, + 9253, 42021, 25637, 58405, 5157, 37925, 21541, 54309, 13349, 46117, 29733, + 62501, 3109, 35877, 19493, 52261, 11301, 44069, 27685, 60453, 7205, 39973, + 23589, 56357, 15397, 48165, 31781, 64549, 549, 33317, 16933, 49701, 8741, + 41509, 25125, 57893, 4645, 37413, 21029, 53797, 12837, 45605, 29221, 61989, + 2597, 35365, 18981, 51749, 10789, 43557, 27173, 59941, 6693, 39461, 23077, + 55845, 14885, 47653, 31269, 64037, 1573, 34341, 17957, 50725, 9765, 42533, + 26149, 58917, 5669, 38437, 22053, 54821, 13861, 46629, 30245, 63013, 3621, + 36389, 20005, 52773, 11813, 44581, 28197, 60965, 7717, 40485, 24101, 56869, + 15909, 48677, 32293, 65061, 293, 33061, 16677, 49445, 8485, 41253, 24869, + 57637, 4389, 37157, 20773, 53541, 12581, 45349, 28965, 61733, 2341, 35109, + 18725, 51493, 10533, 43301, 26917, 59685, 6437, 39205, 22821, 55589, 14629, + 47397, 31013, 63781, 1317, 34085, 17701, 50469, 9509, 42277, 25893, 58661, + 5413, 38181, 21797, 54565, 13605, 46373, 29989, 62757, 3365, 36133, 19749, + 52517, 11557, 44325, 27941, 60709, 7461, 40229, 23845, 56613, 15653, 48421, + 32037, 64805, 805, 33573, 17189, 49957, 8997, 41765, 25381, 58149, 4901, + 37669, 21285, 54053, 13093, 45861, 29477, 62245, 2853, 35621, 19237, 52005, + 11045, 43813, 27429, 60197, 6949, 39717, 23333, 56101, 15141, 47909, 31525, + 64293, 1829, 34597, 18213, 50981, 10021, 42789, 26405, 59173, 5925, 38693, + 22309, 55077, 14117, 46885, 30501, 63269, 3877, 36645, 20261, 53029, 12069, + 44837, 28453, 61221, 7973, 40741, 24357, 57125, 16165, 48933, 32549, 65317, + 165, 32933, 16549, 49317, 8357, 41125, 24741, 57509, 4261, 37029, 20645, + 53413, 12453, 45221, 28837, 61605, 2213, 34981, 18597, 51365, 10405, 43173, + 26789, 59557, 6309, 39077, 22693, 55461, 14501, 47269, 30885, 63653, 1189, + 33957, 17573, 50341, 9381, 42149, 25765, 58533, 5285, 38053, 21669, 54437, + 13477, 46245, 29861, 62629, 3237, 36005, 19621, 52389, 11429, 44197, 27813, + 60581, 7333, 40101, 23717, 56485, 15525, 48293, 31909, 64677, 677, 33445, + 17061, 49829, 8869, 41637, 25253, 58021, 4773, 37541, 21157, 53925, 12965, + 45733, 29349, 62117, 2725, 35493, 19109, 51877, 10917, 43685, 27301, 60069, + 6821, 39589, 23205, 55973, 15013, 47781, 31397, 64165, 1701, 34469, 18085, + 50853, 9893, 42661, 26277, 59045, 5797, 38565, 22181, 54949, 13989, 46757, + 30373, 63141, 3749, 36517, 20133, 52901, 11941, 44709, 28325, 61093, 7845, + 40613, 24229, 56997, 16037, 48805, 32421, 65189, 421, 33189, 16805, 49573, + 8613, 41381, 24997, 57765, 4517, 37285, 20901, 53669, 12709, 45477, 29093, + 61861, 2469, 35237, 18853, 51621, 10661, 43429, 27045, 59813, 6565, 39333, + 22949, 55717, 14757, 47525, 31141, 63909, 1445, 34213, 17829, 50597, 9637, + 42405, 26021, 58789, 5541, 38309, 21925, 54693, 13733, 46501, 30117, 62885, + 3493, 36261, 19877, 52645, 11685, 44453, 28069, 60837, 7589, 40357, 23973, + 56741, 15781, 48549, 32165, 64933, 933, 33701, 17317, 50085, 9125, 41893, + 25509, 58277, 5029, 37797, 21413, 54181, 13221, 45989, 29605, 62373, 2981, + 35749, 19365, 52133, 11173, 43941, 27557, 60325, 7077, 39845, 23461, 56229, + 15269, 48037, 31653, 64421, 1957, 34725, 18341, 51109, 10149, 42917, 26533, + 59301, 6053, 38821, 22437, 55205, 14245, 47013, 30629, 63397, 4005, 36773, + 20389, 53157, 12197, 44965, 28581, 61349, 8101, 40869, 24485, 57253, 16293, + 49061, 32677, 65445, 101, 32869, 16485, 49253, 8293, 41061, 24677, 57445, + 4197, 36965, 20581, 53349, 12389, 45157, 28773, 61541, 2149, 34917, 18533, + 51301, 10341, 43109, 26725, 59493, 6245, 39013, 22629, 55397, 14437, 47205, + 30821, 63589, 1125, 33893, 17509, 50277, 9317, 42085, 25701, 58469, 5221, + 37989, 21605, 54373, 13413, 46181, 29797, 62565, 3173, 35941, 19557, 52325, + 11365, 44133, 27749, 60517, 7269, 40037, 23653, 56421, 15461, 48229, 31845, + 64613, 613, 33381, 16997, 49765, 8805, 41573, 25189, 57957, 4709, 37477, + 21093, 53861, 12901, 45669, 29285, 62053, 2661, 35429, 19045, 51813, 10853, + 43621, 27237, 60005, 6757, 39525, 23141, 55909, 14949, 47717, 31333, 64101, + 1637, 34405, 18021, 50789, 9829, 42597, 26213, 58981, 5733, 38501, 22117, + 54885, 13925, 46693, 30309, 63077, 3685, 36453, 20069, 52837, 11877, 44645, + 28261, 61029, 7781, 40549, 24165, 56933, 15973, 48741, 32357, 65125, 357, + 33125, 16741, 49509, 8549, 41317, 24933, 57701, 4453, 37221, 20837, 53605, + 12645, 45413, 29029, 61797, 2405, 35173, 18789, 51557, 10597, 43365, 26981, + 59749, 6501, 39269, 22885, 55653, 14693, 47461, 31077, 63845, 1381, 34149, + 17765, 50533, 9573, 42341, 25957, 58725, 5477, 38245, 21861, 54629, 13669, + 46437, 30053, 62821, 3429, 36197, 19813, 52581, 11621, 44389, 28005, 60773, + 7525, 40293, 23909, 56677, 15717, 48485, 32101, 64869, 869, 33637, 17253, + 50021, 9061, 41829, 25445, 58213, 4965, 37733, 21349, 54117, 13157, 45925, + 29541, 62309, 2917, 35685, 19301, 52069, 11109, 43877, 27493, 60261, 7013, + 39781, 23397, 56165, 15205, 47973, 31589, 64357, 1893, 34661, 18277, 51045, + 10085, 42853, 26469, 59237, 5989, 38757, 22373, 55141, 14181, 46949, 30565, + 63333, 3941, 36709, 20325, 53093, 12133, 44901, 28517, 61285, 8037, 40805, + 24421, 57189, 16229, 48997, 32613, 65381, 229, 32997, 16613, 49381, 8421, + 41189, 24805, 57573, 4325, 37093, 20709, 53477, 12517, 45285, 28901, 61669, + 2277, 35045, 18661, 51429, 10469, 43237, 26853, 59621, 6373, 39141, 22757, + 55525, 14565, 47333, 30949, 63717, 1253, 34021, 17637, 50405, 9445, 42213, + 25829, 58597, 5349, 38117, 21733, 54501, 13541, 46309, 29925, 62693, 3301, + 36069, 19685, 52453, 11493, 44261, 27877, 60645, 7397, 40165, 23781, 56549, + 15589, 48357, 31973, 64741, 741, 33509, 17125, 49893, 8933, 41701, 25317, + 58085, 4837, 37605, 21221, 53989, 13029, 45797, 29413, 62181, 2789, 35557, + 19173, 51941, 10981, 43749, 27365, 60133, 6885, 39653, 23269, 56037, 15077, + 47845, 31461, 64229, 1765, 34533, 18149, 50917, 9957, 42725, 26341, 59109, + 5861, 38629, 22245, 55013, 14053, 46821, 30437, 63205, 3813, 36581, 20197, + 52965, 12005, 44773, 28389, 61157, 7909, 40677, 24293, 57061, 16101, 48869, + 32485, 65253, 485, 33253, 16869, 49637, 8677, 41445, 25061, 57829, 4581, + 37349, 20965, 53733, 12773, 45541, 29157, 61925, 2533, 35301, 18917, 51685, + 10725, 43493, 27109, 59877, 6629, 39397, 23013, 55781, 14821, 47589, 31205, + 63973, 1509, 34277, 17893, 50661, 9701, 42469, 26085, 58853, 5605, 38373, + 21989, 54757, 13797, 46565, 30181, 62949, 3557, 36325, 19941, 52709, 11749, + 44517, 28133, 60901, 7653, 40421, 24037, 56805, 15845, 48613, 32229, 64997, + 997, 33765, 17381, 50149, 9189, 41957, 25573, 58341, 5093, 37861, 21477, + 54245, 13285, 46053, 29669, 62437, 3045, 35813, 19429, 52197, 11237, 44005, + 27621, 60389, 7141, 39909, 23525, 56293, 15333, 48101, 31717, 64485, 2021, + 34789, 18405, 51173, 10213, 42981, 26597, 59365, 6117, 38885, 22501, 55269, + 14309, 47077, 30693, 63461, 4069, 36837, 20453, 53221, 12261, 45029, 28645, + 61413, 8165, 40933, 24549, 57317, 16357, 49125, 32741, 65509, 21, 32789, + 16405, 49173, 8213, 40981, 24597, 57365, 4117, 36885, 20501, 53269, 12309, + 45077, 28693, 61461, 2069, 34837, 18453, 51221, 10261, 43029, 26645, 59413, + 6165, 38933, 22549, 55317, 14357, 47125, 30741, 63509, 1045, 33813, 17429, + 50197, 9237, 42005, 25621, 58389, 5141, 37909, 21525, 54293, 13333, 46101, + 29717, 62485, 3093, 35861, 19477, 52245, 11285, 44053, 27669, 60437, 7189, + 39957, 23573, 56341, 15381, 48149, 31765, 64533, 533, 33301, 16917, 49685, + 8725, 41493, 25109, 57877, 4629, 37397, 21013, 53781, 12821, 45589, 29205, + 61973, 2581, 35349, 18965, 51733, 10773, 43541, 27157, 59925, 6677, 39445, + 23061, 55829, 14869, 47637, 31253, 64021, 1557, 34325, 17941, 50709, 9749, + 42517, 26133, 58901, 5653, 38421, 22037, 54805, 13845, 46613, 30229, 62997, + 3605, 36373, 19989, 52757, 11797, 44565, 28181, 60949, 7701, 40469, 24085, + 56853, 15893, 48661, 32277, 65045, 277, 33045, 16661, 49429, 8469, 41237, + 24853, 57621, 4373, 37141, 20757, 53525, 12565, 45333, 28949, 61717, 2325, + 35093, 18709, 51477, 10517, 43285, 26901, 59669, 6421, 39189, 22805, 55573, + 14613, 47381, 30997, 63765, 1301, 34069, 17685, 50453, 9493, 42261, 25877, + 58645, 5397, 38165, 21781, 54549, 13589, 46357, 29973, 62741, 3349, 36117, + 19733, 52501, 11541, 44309, 27925, 60693, 7445, 40213, 23829, 56597, 15637, + 48405, 32021, 64789, 789, 33557, 17173, 49941, 8981, 41749, 25365, 58133, + 4885, 37653, 21269, 54037, 13077, 45845, 29461, 62229, 2837, 35605, 19221, + 51989, 11029, 43797, 27413, 60181, 6933, 39701, 23317, 56085, 15125, 47893, + 31509, 64277, 1813, 34581, 18197, 50965, 10005, 42773, 26389, 59157, 5909, + 38677, 22293, 55061, 14101, 46869, 30485, 63253, 3861, 36629, 20245, 53013, + 12053, 44821, 28437, 61205, 7957, 40725, 24341, 57109, 16149, 48917, 32533, + 65301, 149, 32917, 16533, 49301, 8341, 41109, 24725, 57493, 4245, 37013, + 20629, 53397, 12437, 45205, 28821, 61589, 2197, 34965, 18581, 51349, 10389, + 43157, 26773, 59541, 6293, 39061, 22677, 55445, 14485, 47253, 30869, 63637, + 1173, 33941, 17557, 50325, 9365, 42133, 25749, 58517, 5269, 38037, 21653, + 54421, 13461, 46229, 29845, 62613, 3221, 35989, 19605, 52373, 11413, 44181, + 27797, 60565, 7317, 40085, 23701, 56469, 15509, 48277, 31893, 64661, 661, + 33429, 17045, 49813, 8853, 41621, 25237, 58005, 4757, 37525, 21141, 53909, + 12949, 45717, 29333, 62101, 2709, 35477, 19093, 51861, 10901, 43669, 27285, + 60053, 6805, 39573, 23189, 55957, 14997, 47765, 31381, 64149, 1685, 34453, + 18069, 50837, 9877, 42645, 26261, 59029, 5781, 38549, 22165, 54933, 13973, + 46741, 30357, 63125, 3733, 36501, 20117, 52885, 11925, 44693, 28309, 61077, + 7829, 40597, 24213, 56981, 16021, 48789, 32405, 65173, 405, 33173, 16789, + 49557, 8597, 41365, 24981, 57749, 4501, 37269, 20885, 53653, 12693, 45461, + 29077, 61845, 2453, 35221, 18837, 51605, 10645, 43413, 27029, 59797, 6549, + 39317, 22933, 55701, 14741, 47509, 31125, 63893, 1429, 34197, 17813, 50581, + 9621, 42389, 26005, 58773, 5525, 38293, 21909, 54677, 13717, 46485, 30101, + 62869, 3477, 36245, 19861, 52629, 11669, 44437, 28053, 60821, 7573, 40341, + 23957, 56725, 15765, 48533, 32149, 64917, 917, 33685, 17301, 50069, 9109, + 41877, 25493, 58261, 5013, 37781, 21397, 54165, 13205, 45973, 29589, 62357, + 2965, 35733, 19349, 52117, 11157, 43925, 27541, 60309, 7061, 39829, 23445, + 56213, 15253, 48021, 31637, 64405, 1941, 34709, 18325, 51093, 10133, 42901, + 26517, 59285, 6037, 38805, 22421, 55189, 14229, 46997, 30613, 63381, 3989, + 36757, 20373, 53141, 12181, 44949, 28565, 61333, 8085, 40853, 24469, 57237, + 16277, 49045, 32661, 65429, 85, 32853, 16469, 49237, 8277, 41045, 24661, + 57429, 4181, 36949, 20565, 53333, 12373, 45141, 28757, 61525, 2133, 34901, + 18517, 51285, 10325, 43093, 26709, 59477, 6229, 38997, 22613, 55381, 14421, + 47189, 30805, 63573, 1109, 33877, 17493, 50261, 9301, 42069, 25685, 58453, + 5205, 37973, 21589, 54357, 13397, 46165, 29781, 62549, 3157, 35925, 19541, + 52309, 11349, 44117, 27733, 60501, 7253, 40021, 23637, 56405, 15445, 48213, + 31829, 64597, 597, 33365, 16981, 49749, 8789, 41557, 25173, 57941, 4693, + 37461, 21077, 53845, 12885, 45653, 29269, 62037, 2645, 35413, 19029, 51797, + 10837, 43605, 27221, 59989, 6741, 39509, 23125, 55893, 14933, 47701, 31317, + 64085, 1621, 34389, 18005, 50773, 9813, 42581, 26197, 58965, 5717, 38485, + 22101, 54869, 13909, 46677, 30293, 63061, 3669, 36437, 20053, 52821, 11861, + 44629, 28245, 61013, 7765, 40533, 24149, 56917, 15957, 48725, 32341, 65109, + 341, 33109, 16725, 49493, 8533, 41301, 24917, 57685, 4437, 37205, 20821, + 53589, 12629, 45397, 29013, 61781, 2389, 35157, 18773, 51541, 10581, 43349, + 26965, 59733, 6485, 39253, 22869, 55637, 14677, 47445, 31061, 63829, 1365, + 34133, 17749, 50517, 9557, 42325, 25941, 58709, 5461, 38229, 21845, 54613, + 13653, 46421, 30037, 62805, 3413, 36181, 19797, 52565, 11605, 44373, 27989, + 60757, 7509, 40277, 23893, 56661, 15701, 48469, 32085, 64853, 853, 33621, + 17237, 50005, 9045, 41813, 25429, 58197, 4949, 37717, 21333, 54101, 13141, + 45909, 29525, 62293, 2901, 35669, 19285, 52053, 11093, 43861, 27477, 60245, + 6997, 39765, 23381, 56149, 15189, 47957, 31573, 64341, 1877, 34645, 18261, + 51029, 10069, 42837, 26453, 59221, 5973, 38741, 22357, 55125, 14165, 46933, + 30549, 63317, 3925, 36693, 20309, 53077, 12117, 44885, 28501, 61269, 8021, + 40789, 24405, 57173, 16213, 48981, 32597, 65365, 213, 32981, 16597, 49365, + 8405, 41173, 24789, 57557, 4309, 37077, 20693, 53461, 12501, 45269, 28885, + 61653, 2261, 35029, 18645, 51413, 10453, 43221, 26837, 59605, 6357, 39125, + 22741, 55509, 14549, 47317, 30933, 63701, 1237, 34005, 17621, 50389, 9429, + 42197, 25813, 58581, 5333, 38101, 21717, 54485, 13525, 46293, 29909, 62677, + 3285, 36053, 19669, 52437, 11477, 44245, 27861, 60629, 7381, 40149, 23765, + 56533, 15573, 48341, 31957, 64725, 725, 33493, 17109, 49877, 8917, 41685, + 25301, 58069, 4821, 37589, 21205, 53973, 13013, 45781, 29397, 62165, 2773, + 35541, 19157, 51925, 10965, 43733, 27349, 60117, 6869, 39637, 23253, 56021, + 15061, 47829, 31445, 64213, 1749, 34517, 18133, 50901, 9941, 42709, 26325, + 59093, 5845, 38613, 22229, 54997, 14037, 46805, 30421, 63189, 3797, 36565, + 20181, 52949, 11989, 44757, 28373, 61141, 7893, 40661, 24277, 57045, 16085, + 48853, 32469, 65237, 469, 33237, 16853, 49621, 8661, 41429, 25045, 57813, + 4565, 37333, 20949, 53717, 12757, 45525, 29141, 61909, 2517, 35285, 18901, + 51669, 10709, 43477, 27093, 59861, 6613, 39381, 22997, 55765, 14805, 47573, + 31189, 63957, 1493, 34261, 17877, 50645, 9685, 42453, 26069, 58837, 5589, + 38357, 21973, 54741, 13781, 46549, 30165, 62933, 3541, 36309, 19925, 52693, + 11733, 44501, 28117, 60885, 7637, 40405, 24021, 56789, 15829, 48597, 32213, + 64981, 981, 33749, 17365, 50133, 9173, 41941, 25557, 58325, 5077, 37845, + 21461, 54229, 13269, 46037, 29653, 62421, 3029, 35797, 19413, 52181, 11221, + 43989, 27605, 60373, 7125, 39893, 23509, 56277, 15317, 48085, 31701, 64469, + 2005, 34773, 18389, 51157, 10197, 42965, 26581, 59349, 6101, 38869, 22485, + 55253, 14293, 47061, 30677, 63445, 4053, 36821, 20437, 53205, 12245, 45013, + 28629, 61397, 8149, 40917, 24533, 57301, 16341, 49109, 32725, 65493, 53, + 32821, 16437, 49205, 8245, 41013, 24629, 57397, 4149, 36917, 20533, 53301, + 12341, 45109, 28725, 61493, 2101, 34869, 18485, 51253, 10293, 43061, 26677, + 59445, 6197, 38965, 22581, 55349, 14389, 47157, 30773, 63541, 1077, 33845, + 17461, 50229, 9269, 42037, 25653, 58421, 5173, 37941, 21557, 54325, 13365, + 46133, 29749, 62517, 3125, 35893, 19509, 52277, 11317, 44085, 27701, 60469, + 7221, 39989, 23605, 56373, 15413, 48181, 31797, 64565, 565, 33333, 16949, + 49717, 8757, 41525, 25141, 57909, 4661, 37429, 21045, 53813, 12853, 45621, + 29237, 62005, 2613, 35381, 18997, 51765, 10805, 43573, 27189, 59957, 6709, + 39477, 23093, 55861, 14901, 47669, 31285, 64053, 1589, 34357, 17973, 50741, + 9781, 42549, 26165, 58933, 5685, 38453, 22069, 54837, 13877, 46645, 30261, + 63029, 3637, 36405, 20021, 52789, 11829, 44597, 28213, 60981, 7733, 40501, + 24117, 56885, 15925, 48693, 32309, 65077, 309, 33077, 16693, 49461, 8501, + 41269, 24885, 57653, 4405, 37173, 20789, 53557, 12597, 45365, 28981, 61749, + 2357, 35125, 18741, 51509, 10549, 43317, 26933, 59701, 6453, 39221, 22837, + 55605, 14645, 47413, 31029, 63797, 1333, 34101, 17717, 50485, 9525, 42293, + 25909, 58677, 5429, 38197, 21813, 54581, 13621, 46389, 30005, 62773, 3381, + 36149, 19765, 52533, 11573, 44341, 27957, 60725, 7477, 40245, 23861, 56629, + 15669, 48437, 32053, 64821, 821, 33589, 17205, 49973, 9013, 41781, 25397, + 58165, 4917, 37685, 21301, 54069, 13109, 45877, 29493, 62261, 2869, 35637, + 19253, 52021, 11061, 43829, 27445, 60213, 6965, 39733, 23349, 56117, 15157, + 47925, 31541, 64309, 1845, 34613, 18229, 50997, 10037, 42805, 26421, 59189, + 5941, 38709, 22325, 55093, 14133, 46901, 30517, 63285, 3893, 36661, 20277, + 53045, 12085, 44853, 28469, 61237, 7989, 40757, 24373, 57141, 16181, 48949, + 32565, 65333, 181, 32949, 16565, 49333, 8373, 41141, 24757, 57525, 4277, + 37045, 20661, 53429, 12469, 45237, 28853, 61621, 2229, 34997, 18613, 51381, + 10421, 43189, 26805, 59573, 6325, 39093, 22709, 55477, 14517, 47285, 30901, + 63669, 1205, 33973, 17589, 50357, 9397, 42165, 25781, 58549, 5301, 38069, + 21685, 54453, 13493, 46261, 29877, 62645, 3253, 36021, 19637, 52405, 11445, + 44213, 27829, 60597, 7349, 40117, 23733, 56501, 15541, 48309, 31925, 64693, + 693, 33461, 17077, 49845, 8885, 41653, 25269, 58037, 4789, 37557, 21173, + 53941, 12981, 45749, 29365, 62133, 2741, 35509, 19125, 51893, 10933, 43701, + 27317, 60085, 6837, 39605, 23221, 55989, 15029, 47797, 31413, 64181, 1717, + 34485, 18101, 50869, 9909, 42677, 26293, 59061, 5813, 38581, 22197, 54965, + 14005, 46773, 30389, 63157, 3765, 36533, 20149, 52917, 11957, 44725, 28341, + 61109, 7861, 40629, 24245, 57013, 16053, 48821, 32437, 65205, 437, 33205, + 16821, 49589, 8629, 41397, 25013, 57781, 4533, 37301, 20917, 53685, 12725, + 45493, 29109, 61877, 2485, 35253, 18869, 51637, 10677, 43445, 27061, 59829, + 6581, 39349, 22965, 55733, 14773, 47541, 31157, 63925, 1461, 34229, 17845, + 50613, 9653, 42421, 26037, 58805, 5557, 38325, 21941, 54709, 13749, 46517, + 30133, 62901, 3509, 36277, 19893, 52661, 11701, 44469, 28085, 60853, 7605, + 40373, 23989, 56757, 15797, 48565, 32181, 64949, 949, 33717, 17333, 50101, + 9141, 41909, 25525, 58293, 5045, 37813, 21429, 54197, 13237, 46005, 29621, + 62389, 2997, 35765, 19381, 52149, 11189, 43957, 27573, 60341, 7093, 39861, + 23477, 56245, 15285, 48053, 31669, 64437, 1973, 34741, 18357, 51125, 10165, + 42933, 26549, 59317, 6069, 38837, 22453, 55221, 14261, 47029, 30645, 63413, + 4021, 36789, 20405, 53173, 12213, 44981, 28597, 61365, 8117, 40885, 24501, + 57269, 16309, 49077, 32693, 65461, 117, 32885, 16501, 49269, 8309, 41077, + 24693, 57461, 4213, 36981, 20597, 53365, 12405, 45173, 28789, 61557, 2165, + 34933, 18549, 51317, 10357, 43125, 26741, 59509, 6261, 39029, 22645, 55413, + 14453, 47221, 30837, 63605, 1141, 33909, 17525, 50293, 9333, 42101, 25717, + 58485, 5237, 38005, 21621, 54389, 13429, 46197, 29813, 62581, 3189, 35957, + 19573, 52341, 11381, 44149, 27765, 60533, 7285, 40053, 23669, 56437, 15477, + 48245, 31861, 64629, 629, 33397, 17013, 49781, 8821, 41589, 25205, 57973, + 4725, 37493, 21109, 53877, 12917, 45685, 29301, 62069, 2677, 35445, 19061, + 51829, 10869, 43637, 27253, 60021, 6773, 39541, 23157, 55925, 14965, 47733, + 31349, 64117, 1653, 34421, 18037, 50805, 9845, 42613, 26229, 58997, 5749, + 38517, 22133, 54901, 13941, 46709, 30325, 63093, 3701, 36469, 20085, 52853, + 11893, 44661, 28277, 61045, 7797, 40565, 24181, 56949, 15989, 48757, 32373, + 65141, 373, 33141, 16757, 49525, 8565, 41333, 24949, 57717, 4469, 37237, + 20853, 53621, 12661, 45429, 29045, 61813, 2421, 35189, 18805, 51573, 10613, + 43381, 26997, 59765, 6517, 39285, 22901, 55669, 14709, 47477, 31093, 63861, + 1397, 34165, 17781, 50549, 9589, 42357, 25973, 58741, 5493, 38261, 21877, + 54645, 13685, 46453, 30069, 62837, 3445, 36213, 19829, 52597, 11637, 44405, + 28021, 60789, 7541, 40309, 23925, 56693, 15733, 48501, 32117, 64885, 885, + 33653, 17269, 50037, 9077, 41845, 25461, 58229, 4981, 37749, 21365, 54133, + 13173, 45941, 29557, 62325, 2933, 35701, 19317, 52085, 11125, 43893, 27509, + 60277, 7029, 39797, 23413, 56181, 15221, 47989, 31605, 64373, 1909, 34677, + 18293, 51061, 10101, 42869, 26485, 59253, 6005, 38773, 22389, 55157, 14197, + 46965, 30581, 63349, 3957, 36725, 20341, 53109, 12149, 44917, 28533, 61301, + 8053, 40821, 24437, 57205, 16245, 49013, 32629, 65397, 245, 33013, 16629, + 49397, 8437, 41205, 24821, 57589, 4341, 37109, 20725, 53493, 12533, 45301, + 28917, 61685, 2293, 35061, 18677, 51445, 10485, 43253, 26869, 59637, 6389, + 39157, 22773, 55541, 14581, 47349, 30965, 63733, 1269, 34037, 17653, 50421, + 9461, 42229, 25845, 58613, 5365, 38133, 21749, 54517, 13557, 46325, 29941, + 62709, 3317, 36085, 19701, 52469, 11509, 44277, 27893, 60661, 7413, 40181, + 23797, 56565, 15605, 48373, 31989, 64757, 757, 33525, 17141, 49909, 8949, + 41717, 25333, 58101, 4853, 37621, 21237, 54005, 13045, 45813, 29429, 62197, + 2805, 35573, 19189, 51957, 10997, 43765, 27381, 60149, 6901, 39669, 23285, + 56053, 15093, 47861, 31477, 64245, 1781, 34549, 18165, 50933, 9973, 42741, + 26357, 59125, 5877, 38645, 22261, 55029, 14069, 46837, 30453, 63221, 3829, + 36597, 20213, 52981, 12021, 44789, 28405, 61173, 7925, 40693, 24309, 57077, + 16117, 48885, 32501, 65269, 501, 33269, 16885, 49653, 8693, 41461, 25077, + 57845, 4597, 37365, 20981, 53749, 12789, 45557, 29173, 61941, 2549, 35317, + 18933, 51701, 10741, 43509, 27125, 59893, 6645, 39413, 23029, 55797, 14837, + 47605, 31221, 63989, 1525, 34293, 17909, 50677, 9717, 42485, 26101, 58869, + 5621, 38389, 22005, 54773, 13813, 46581, 30197, 62965, 3573, 36341, 19957, + 52725, 11765, 44533, 28149, 60917, 7669, 40437, 24053, 56821, 15861, 48629, + 32245, 65013, 1013, 33781, 17397, 50165, 9205, 41973, 25589, 58357, 5109, + 37877, 21493, 54261, 13301, 46069, 29685, 62453, 3061, 35829, 19445, 52213, + 11253, 44021, 27637, 60405, 7157, 39925, 23541, 56309, 15349, 48117, 31733, + 64501, 2037, 34805, 18421, 51189, 10229, 42997, 26613, 59381, 6133, 38901, + 22517, 55285, 14325, 47093, 30709, 63477, 4085, 36853, 20469, 53237, 12277, + 45045, 28661, 61429, 8181, 40949, 24565, 57333, 16373, 49141, 32757, 65525, + 13, 32781, 16397, 49165, 8205, 40973, 24589, 57357, 4109, 36877, 20493, + 53261, 12301, 45069, 28685, 61453, 2061, 34829, 18445, 51213, 10253, 43021, + 26637, 59405, 6157, 38925, 22541, 55309, 14349, 47117, 30733, 63501, 1037, + 33805, 17421, 50189, 9229, 41997, 25613, 58381, 5133, 37901, 21517, 54285, + 13325, 46093, 29709, 62477, 3085, 35853, 19469, 52237, 11277, 44045, 27661, + 60429, 7181, 39949, 23565, 56333, 15373, 48141, 31757, 64525, 525, 33293, + 16909, 49677, 8717, 41485, 25101, 57869, 4621, 37389, 21005, 53773, 12813, + 45581, 29197, 61965, 2573, 35341, 18957, 51725, 10765, 43533, 27149, 59917, + 6669, 39437, 23053, 55821, 14861, 47629, 31245, 64013, 1549, 34317, 17933, + 50701, 9741, 42509, 26125, 58893, 5645, 38413, 22029, 54797, 13837, 46605, + 30221, 62989, 3597, 36365, 19981, 52749, 11789, 44557, 28173, 60941, 7693, + 40461, 24077, 56845, 15885, 48653, 32269, 65037, 269, 33037, 16653, 49421, + 8461, 41229, 24845, 57613, 4365, 37133, 20749, 53517, 12557, 45325, 28941, + 61709, 2317, 35085, 18701, 51469, 10509, 43277, 26893, 59661, 6413, 39181, + 22797, 55565, 14605, 47373, 30989, 63757, 1293, 34061, 17677, 50445, 9485, + 42253, 25869, 58637, 5389, 38157, 21773, 54541, 13581, 46349, 29965, 62733, + 3341, 36109, 19725, 52493, 11533, 44301, 27917, 60685, 7437, 40205, 23821, + 56589, 15629, 48397, 32013, 64781, 781, 33549, 17165, 49933, 8973, 41741, + 25357, 58125, 4877, 37645, 21261, 54029, 13069, 45837, 29453, 62221, 2829, + 35597, 19213, 51981, 11021, 43789, 27405, 60173, 6925, 39693, 23309, 56077, + 15117, 47885, 31501, 64269, 1805, 34573, 18189, 50957, 9997, 42765, 26381, + 59149, 5901, 38669, 22285, 55053, 14093, 46861, 30477, 63245, 3853, 36621, + 20237, 53005, 12045, 44813, 28429, 61197, 7949, 40717, 24333, 57101, 16141, + 48909, 32525, 65293, 141, 32909, 16525, 49293, 8333, 41101, 24717, 57485, + 4237, 37005, 20621, 53389, 12429, 45197, 28813, 61581, 2189, 34957, 18573, + 51341, 10381, 43149, 26765, 59533, 6285, 39053, 22669, 55437, 14477, 47245, + 30861, 63629, 1165, 33933, 17549, 50317, 9357, 42125, 25741, 58509, 5261, + 38029, 21645, 54413, 13453, 46221, 29837, 62605, 3213, 35981, 19597, 52365, + 11405, 44173, 27789, 60557, 7309, 40077, 23693, 56461, 15501, 48269, 31885, + 64653, 653, 33421, 17037, 49805, 8845, 41613, 25229, 57997, 4749, 37517, + 21133, 53901, 12941, 45709, 29325, 62093, 2701, 35469, 19085, 51853, 10893, + 43661, 27277, 60045, 6797, 39565, 23181, 55949, 14989, 47757, 31373, 64141, + 1677, 34445, 18061, 50829, 9869, 42637, 26253, 59021, 5773, 38541, 22157, + 54925, 13965, 46733, 30349, 63117, 3725, 36493, 20109, 52877, 11917, 44685, + 28301, 61069, 7821, 40589, 24205, 56973, 16013, 48781, 32397, 65165, 397, + 33165, 16781, 49549, 8589, 41357, 24973, 57741, 4493, 37261, 20877, 53645, + 12685, 45453, 29069, 61837, 2445, 35213, 18829, 51597, 10637, 43405, 27021, + 59789, 6541, 39309, 22925, 55693, 14733, 47501, 31117, 63885, 1421, 34189, + 17805, 50573, 9613, 42381, 25997, 58765, 5517, 38285, 21901, 54669, 13709, + 46477, 30093, 62861, 3469, 36237, 19853, 52621, 11661, 44429, 28045, 60813, + 7565, 40333, 23949, 56717, 15757, 48525, 32141, 64909, 909, 33677, 17293, + 50061, 9101, 41869, 25485, 58253, 5005, 37773, 21389, 54157, 13197, 45965, + 29581, 62349, 2957, 35725, 19341, 52109, 11149, 43917, 27533, 60301, 7053, + 39821, 23437, 56205, 15245, 48013, 31629, 64397, 1933, 34701, 18317, 51085, + 10125, 42893, 26509, 59277, 6029, 38797, 22413, 55181, 14221, 46989, 30605, + 63373, 3981, 36749, 20365, 53133, 12173, 44941, 28557, 61325, 8077, 40845, + 24461, 57229, 16269, 49037, 32653, 65421, 77, 32845, 16461, 49229, 8269, + 41037, 24653, 57421, 4173, 36941, 20557, 53325, 12365, 45133, 28749, 61517, + 2125, 34893, 18509, 51277, 10317, 43085, 26701, 59469, 6221, 38989, 22605, + 55373, 14413, 47181, 30797, 63565, 1101, 33869, 17485, 50253, 9293, 42061, + 25677, 58445, 5197, 37965, 21581, 54349, 13389, 46157, 29773, 62541, 3149, + 35917, 19533, 52301, 11341, 44109, 27725, 60493, 7245, 40013, 23629, 56397, + 15437, 48205, 31821, 64589, 589, 33357, 16973, 49741, 8781, 41549, 25165, + 57933, 4685, 37453, 21069, 53837, 12877, 45645, 29261, 62029, 2637, 35405, + 19021, 51789, 10829, 43597, 27213, 59981, 6733, 39501, 23117, 55885, 14925, + 47693, 31309, 64077, 1613, 34381, 17997, 50765, 9805, 42573, 26189, 58957, + 5709, 38477, 22093, 54861, 13901, 46669, 30285, 63053, 3661, 36429, 20045, + 52813, 11853, 44621, 28237, 61005, 7757, 40525, 24141, 56909, 15949, 48717, + 32333, 65101, 333, 33101, 16717, 49485, 8525, 41293, 24909, 57677, 4429, + 37197, 20813, 53581, 12621, 45389, 29005, 61773, 2381, 35149, 18765, 51533, + 10573, 43341, 26957, 59725, 6477, 39245, 22861, 55629, 14669, 47437, 31053, + 63821, 1357, 34125, 17741, 50509, 9549, 42317, 25933, 58701, 5453, 38221, + 21837, 54605, 13645, 46413, 30029, 62797, 3405, 36173, 19789, 52557, 11597, + 44365, 27981, 60749, 7501, 40269, 23885, 56653, 15693, 48461, 32077, 64845, + 845, 33613, 17229, 49997, 9037, 41805, 25421, 58189, 4941, 37709, 21325, + 54093, 13133, 45901, 29517, 62285, 2893, 35661, 19277, 52045, 11085, 43853, + 27469, 60237, 6989, 39757, 23373, 56141, 15181, 47949, 31565, 64333, 1869, + 34637, 18253, 51021, 10061, 42829, 26445, 59213, 5965, 38733, 22349, 55117, + 14157, 46925, 30541, 63309, 3917, 36685, 20301, 53069, 12109, 44877, 28493, + 61261, 8013, 40781, 24397, 57165, 16205, 48973, 32589, 65357, 205, 32973, + 16589, 49357, 8397, 41165, 24781, 57549, 4301, 37069, 20685, 53453, 12493, + 45261, 28877, 61645, 2253, 35021, 18637, 51405, 10445, 43213, 26829, 59597, + 6349, 39117, 22733, 55501, 14541, 47309, 30925, 63693, 1229, 33997, 17613, + 50381, 9421, 42189, 25805, 58573, 5325, 38093, 21709, 54477, 13517, 46285, + 29901, 62669, 3277, 36045, 19661, 52429, 11469, 44237, 27853, 60621, 7373, + 40141, 23757, 56525, 15565, 48333, 31949, 64717, 717, 33485, 17101, 49869, + 8909, 41677, 25293, 58061, 4813, 37581, 21197, 53965, 13005, 45773, 29389, + 62157, 2765, 35533, 19149, 51917, 10957, 43725, 27341, 60109, 6861, 39629, + 23245, 56013, 15053, 47821, 31437, 64205, 1741, 34509, 18125, 50893, 9933, + 42701, 26317, 59085, 5837, 38605, 22221, 54989, 14029, 46797, 30413, 63181, + 3789, 36557, 20173, 52941, 11981, 44749, 28365, 61133, 7885, 40653, 24269, + 57037, 16077, 48845, 32461, 65229, 461, 33229, 16845, 49613, 8653, 41421, + 25037, 57805, 4557, 37325, 20941, 53709, 12749, 45517, 29133, 61901, 2509, + 35277, 18893, 51661, 10701, 43469, 27085, 59853, 6605, 39373, 22989, 55757, + 14797, 47565, 31181, 63949, 1485, 34253, 17869, 50637, 9677, 42445, 26061, + 58829, 5581, 38349, 21965, 54733, 13773, 46541, 30157, 62925, 3533, 36301, + 19917, 52685, 11725, 44493, 28109, 60877, 7629, 40397, 24013, 56781, 15821, + 48589, 32205, 64973, 973, 33741, 17357, 50125, 9165, 41933, 25549, 58317, + 5069, 37837, 21453, 54221, 13261, 46029, 29645, 62413, 3021, 35789, 19405, + 52173, 11213, 43981, 27597, 60365, 7117, 39885, 23501, 56269, 15309, 48077, + 31693, 64461, 1997, 34765, 18381, 51149, 10189, 42957, 26573, 59341, 6093, + 38861, 22477, 55245, 14285, 47053, 30669, 63437, 4045, 36813, 20429, 53197, + 12237, 45005, 28621, 61389, 8141, 40909, 24525, 57293, 16333, 49101, 32717, + 65485, 45, 32813, 16429, 49197, 8237, 41005, 24621, 57389, 4141, 36909, + 20525, 53293, 12333, 45101, 28717, 61485, 2093, 34861, 18477, 51245, 10285, + 43053, 26669, 59437, 6189, 38957, 22573, 55341, 14381, 47149, 30765, 63533, + 1069, 33837, 17453, 50221, 9261, 42029, 25645, 58413, 5165, 37933, 21549, + 54317, 13357, 46125, 29741, 62509, 3117, 35885, 19501, 52269, 11309, 44077, + 27693, 60461, 7213, 39981, 23597, 56365, 15405, 48173, 31789, 64557, 557, + 33325, 16941, 49709, 8749, 41517, 25133, 57901, 4653, 37421, 21037, 53805, + 12845, 45613, 29229, 61997, 2605, 35373, 18989, 51757, 10797, 43565, 27181, + 59949, 6701, 39469, 23085, 55853, 14893, 47661, 31277, 64045, 1581, 34349, + 17965, 50733, 9773, 42541, 26157, 58925, 5677, 38445, 22061, 54829, 13869, + 46637, 30253, 63021, 3629, 36397, 20013, 52781, 11821, 44589, 28205, 60973, + 7725, 40493, 24109, 56877, 15917, 48685, 32301, 65069, 301, 33069, 16685, + 49453, 8493, 41261, 24877, 57645, 4397, 37165, 20781, 53549, 12589, 45357, + 28973, 61741, 2349, 35117, 18733, 51501, 10541, 43309, 26925, 59693, 6445, + 39213, 22829, 55597, 14637, 47405, 31021, 63789, 1325, 34093, 17709, 50477, + 9517, 42285, 25901, 58669, 5421, 38189, 21805, 54573, 13613, 46381, 29997, + 62765, 3373, 36141, 19757, 52525, 11565, 44333, 27949, 60717, 7469, 40237, + 23853, 56621, 15661, 48429, 32045, 64813, 813, 33581, 17197, 49965, 9005, + 41773, 25389, 58157, 4909, 37677, 21293, 54061, 13101, 45869, 29485, 62253, + 2861, 35629, 19245, 52013, 11053, 43821, 27437, 60205, 6957, 39725, 23341, + 56109, 15149, 47917, 31533, 64301, 1837, 34605, 18221, 50989, 10029, 42797, + 26413, 59181, 5933, 38701, 22317, 55085, 14125, 46893, 30509, 63277, 3885, + 36653, 20269, 53037, 12077, 44845, 28461, 61229, 7981, 40749, 24365, 57133, + 16173, 48941, 32557, 65325, 173, 32941, 16557, 49325, 8365, 41133, 24749, + 57517, 4269, 37037, 20653, 53421, 12461, 45229, 28845, 61613, 2221, 34989, + 18605, 51373, 10413, 43181, 26797, 59565, 6317, 39085, 22701, 55469, 14509, + 47277, 30893, 63661, 1197, 33965, 17581, 50349, 9389, 42157, 25773, 58541, + 5293, 38061, 21677, 54445, 13485, 46253, 29869, 62637, 3245, 36013, 19629, + 52397, 11437, 44205, 27821, 60589, 7341, 40109, 23725, 56493, 15533, 48301, + 31917, 64685, 685, 33453, 17069, 49837, 8877, 41645, 25261, 58029, 4781, + 37549, 21165, 53933, 12973, 45741, 29357, 62125, 2733, 35501, 19117, 51885, + 10925, 43693, 27309, 60077, 6829, 39597, 23213, 55981, 15021, 47789, 31405, + 64173, 1709, 34477, 18093, 50861, 9901, 42669, 26285, 59053, 5805, 38573, + 22189, 54957, 13997, 46765, 30381, 63149, 3757, 36525, 20141, 52909, 11949, + 44717, 28333, 61101, 7853, 40621, 24237, 57005, 16045, 48813, 32429, 65197, + 429, 33197, 16813, 49581, 8621, 41389, 25005, 57773, 4525, 37293, 20909, + 53677, 12717, 45485, 29101, 61869, 2477, 35245, 18861, 51629, 10669, 43437, + 27053, 59821, 6573, 39341, 22957, 55725, 14765, 47533, 31149, 63917, 1453, + 34221, 17837, 50605, 9645, 42413, 26029, 58797, 5549, 38317, 21933, 54701, + 13741, 46509, 30125, 62893, 3501, 36269, 19885, 52653, 11693, 44461, 28077, + 60845, 7597, 40365, 23981, 56749, 15789, 48557, 32173, 64941, 941, 33709, + 17325, 50093, 9133, 41901, 25517, 58285, 5037, 37805, 21421, 54189, 13229, + 45997, 29613, 62381, 2989, 35757, 19373, 52141, 11181, 43949, 27565, 60333, + 7085, 39853, 23469, 56237, 15277, 48045, 31661, 64429, 1965, 34733, 18349, + 51117, 10157, 42925, 26541, 59309, 6061, 38829, 22445, 55213, 14253, 47021, + 30637, 63405, 4013, 36781, 20397, 53165, 12205, 44973, 28589, 61357, 8109, + 40877, 24493, 57261, 16301, 49069, 32685, 65453, 109, 32877, 16493, 49261, + 8301, 41069, 24685, 57453, 4205, 36973, 20589, 53357, 12397, 45165, 28781, + 61549, 2157, 34925, 18541, 51309, 10349, 43117, 26733, 59501, 6253, 39021, + 22637, 55405, 14445, 47213, 30829, 63597, 1133, 33901, 17517, 50285, 9325, + 42093, 25709, 58477, 5229, 37997, 21613, 54381, 13421, 46189, 29805, 62573, + 3181, 35949, 19565, 52333, 11373, 44141, 27757, 60525, 7277, 40045, 23661, + 56429, 15469, 48237, 31853, 64621, 621, 33389, 17005, 49773, 8813, 41581, + 25197, 57965, 4717, 37485, 21101, 53869, 12909, 45677, 29293, 62061, 2669, + 35437, 19053, 51821, 10861, 43629, 27245, 60013, 6765, 39533, 23149, 55917, + 14957, 47725, 31341, 64109, 1645, 34413, 18029, 50797, 9837, 42605, 26221, + 58989, 5741, 38509, 22125, 54893, 13933, 46701, 30317, 63085, 3693, 36461, + 20077, 52845, 11885, 44653, 28269, 61037, 7789, 40557, 24173, 56941, 15981, + 48749, 32365, 65133, 365, 33133, 16749, 49517, 8557, 41325, 24941, 57709, + 4461, 37229, 20845, 53613, 12653, 45421, 29037, 61805, 2413, 35181, 18797, + 51565, 10605, 43373, 26989, 59757, 6509, 39277, 22893, 55661, 14701, 47469, + 31085, 63853, 1389, 34157, 17773, 50541, 9581, 42349, 25965, 58733, 5485, + 38253, 21869, 54637, 13677, 46445, 30061, 62829, 3437, 36205, 19821, 52589, + 11629, 44397, 28013, 60781, 7533, 40301, 23917, 56685, 15725, 48493, 32109, + 64877, 877, 33645, 17261, 50029, 9069, 41837, 25453, 58221, 4973, 37741, + 21357, 54125, 13165, 45933, 29549, 62317, 2925, 35693, 19309, 52077, 11117, + 43885, 27501, 60269, 7021, 39789, 23405, 56173, 15213, 47981, 31597, 64365, + 1901, 34669, 18285, 51053, 10093, 42861, 26477, 59245, 5997, 38765, 22381, + 55149, 14189, 46957, 30573, 63341, 3949, 36717, 20333, 53101, 12141, 44909, + 28525, 61293, 8045, 40813, 24429, 57197, 16237, 49005, 32621, 65389, 237, + 33005, 16621, 49389, 8429, 41197, 24813, 57581, 4333, 37101, 20717, 53485, + 12525, 45293, 28909, 61677, 2285, 35053, 18669, 51437, 10477, 43245, 26861, + 59629, 6381, 39149, 22765, 55533, 14573, 47341, 30957, 63725, 1261, 34029, + 17645, 50413, 9453, 42221, 25837, 58605, 5357, 38125, 21741, 54509, 13549, + 46317, 29933, 62701, 3309, 36077, 19693, 52461, 11501, 44269, 27885, 60653, + 7405, 40173, 23789, 56557, 15597, 48365, 31981, 64749, 749, 33517, 17133, + 49901, 8941, 41709, 25325, 58093, 4845, 37613, 21229, 53997, 13037, 45805, + 29421, 62189, 2797, 35565, 19181, 51949, 10989, 43757, 27373, 60141, 6893, + 39661, 23277, 56045, 15085, 47853, 31469, 64237, 1773, 34541, 18157, 50925, + 9965, 42733, 26349, 59117, 5869, 38637, 22253, 55021, 14061, 46829, 30445, + 63213, 3821, 36589, 20205, 52973, 12013, 44781, 28397, 61165, 7917, 40685, + 24301, 57069, 16109, 48877, 32493, 65261, 493, 33261, 16877, 49645, 8685, + 41453, 25069, 57837, 4589, 37357, 20973, 53741, 12781, 45549, 29165, 61933, + 2541, 35309, 18925, 51693, 10733, 43501, 27117, 59885, 6637, 39405, 23021, + 55789, 14829, 47597, 31213, 63981, 1517, 34285, 17901, 50669, 9709, 42477, + 26093, 58861, 5613, 38381, 21997, 54765, 13805, 46573, 30189, 62957, 3565, + 36333, 19949, 52717, 11757, 44525, 28141, 60909, 7661, 40429, 24045, 56813, + 15853, 48621, 32237, 65005, 1005, 33773, 17389, 50157, 9197, 41965, 25581, + 58349, 5101, 37869, 21485, 54253, 13293, 46061, 29677, 62445, 3053, 35821, + 19437, 52205, 11245, 44013, 27629, 60397, 7149, 39917, 23533, 56301, 15341, + 48109, 31725, 64493, 2029, 34797, 18413, 51181, 10221, 42989, 26605, 59373, + 6125, 38893, 22509, 55277, 14317, 47085, 30701, 63469, 4077, 36845, 20461, + 53229, 12269, 45037, 28653, 61421, 8173, 40941, 24557, 57325, 16365, 49133, + 32749, 65517, 29, 32797, 16413, 49181, 8221, 40989, 24605, 57373, 4125, + 36893, 20509, 53277, 12317, 45085, 28701, 61469, 2077, 34845, 18461, 51229, + 10269, 43037, 26653, 59421, 6173, 38941, 22557, 55325, 14365, 47133, 30749, + 63517, 1053, 33821, 17437, 50205, 9245, 42013, 25629, 58397, 5149, 37917, + 21533, 54301, 13341, 46109, 29725, 62493, 3101, 35869, 19485, 52253, 11293, + 44061, 27677, 60445, 7197, 39965, 23581, 56349, 15389, 48157, 31773, 64541, + 541, 33309, 16925, 49693, 8733, 41501, 25117, 57885, 4637, 37405, 21021, + 53789, 12829, 45597, 29213, 61981, 2589, 35357, 18973, 51741, 10781, 43549, + 27165, 59933, 6685, 39453, 23069, 55837, 14877, 47645, 31261, 64029, 1565, + 34333, 17949, 50717, 9757, 42525, 26141, 58909, 5661, 38429, 22045, 54813, + 13853, 46621, 30237, 63005, 3613, 36381, 19997, 52765, 11805, 44573, 28189, + 60957, 7709, 40477, 24093, 56861, 15901, 48669, 32285, 65053, 285, 33053, + 16669, 49437, 8477, 41245, 24861, 57629, 4381, 37149, 20765, 53533, 12573, + 45341, 28957, 61725, 2333, 35101, 18717, 51485, 10525, 43293, 26909, 59677, + 6429, 39197, 22813, 55581, 14621, 47389, 31005, 63773, 1309, 34077, 17693, + 50461, 9501, 42269, 25885, 58653, 5405, 38173, 21789, 54557, 13597, 46365, + 29981, 62749, 3357, 36125, 19741, 52509, 11549, 44317, 27933, 60701, 7453, + 40221, 23837, 56605, 15645, 48413, 32029, 64797, 797, 33565, 17181, 49949, + 8989, 41757, 25373, 58141, 4893, 37661, 21277, 54045, 13085, 45853, 29469, + 62237, 2845, 35613, 19229, 51997, 11037, 43805, 27421, 60189, 6941, 39709, + 23325, 56093, 15133, 47901, 31517, 64285, 1821, 34589, 18205, 50973, 10013, + 42781, 26397, 59165, 5917, 38685, 22301, 55069, 14109, 46877, 30493, 63261, + 3869, 36637, 20253, 53021, 12061, 44829, 28445, 61213, 7965, 40733, 24349, + 57117, 16157, 48925, 32541, 65309, 157, 32925, 16541, 49309, 8349, 41117, + 24733, 57501, 4253, 37021, 20637, 53405, 12445, 45213, 28829, 61597, 2205, + 34973, 18589, 51357, 10397, 43165, 26781, 59549, 6301, 39069, 22685, 55453, + 14493, 47261, 30877, 63645, 1181, 33949, 17565, 50333, 9373, 42141, 25757, + 58525, 5277, 38045, 21661, 54429, 13469, 46237, 29853, 62621, 3229, 35997, + 19613, 52381, 11421, 44189, 27805, 60573, 7325, 40093, 23709, 56477, 15517, + 48285, 31901, 64669, 669, 33437, 17053, 49821, 8861, 41629, 25245, 58013, + 4765, 37533, 21149, 53917, 12957, 45725, 29341, 62109, 2717, 35485, 19101, + 51869, 10909, 43677, 27293, 60061, 6813, 39581, 23197, 55965, 15005, 47773, + 31389, 64157, 1693, 34461, 18077, 50845, 9885, 42653, 26269, 59037, 5789, + 38557, 22173, 54941, 13981, 46749, 30365, 63133, 3741, 36509, 20125, 52893, + 11933, 44701, 28317, 61085, 7837, 40605, 24221, 56989, 16029, 48797, 32413, + 65181, 413, 33181, 16797, 49565, 8605, 41373, 24989, 57757, 4509, 37277, + 20893, 53661, 12701, 45469, 29085, 61853, 2461, 35229, 18845, 51613, 10653, + 43421, 27037, 59805, 6557, 39325, 22941, 55709, 14749, 47517, 31133, 63901, + 1437, 34205, 17821, 50589, 9629, 42397, 26013, 58781, 5533, 38301, 21917, + 54685, 13725, 46493, 30109, 62877, 3485, 36253, 19869, 52637, 11677, 44445, + 28061, 60829, 7581, 40349, 23965, 56733, 15773, 48541, 32157, 64925, 925, + 33693, 17309, 50077, 9117, 41885, 25501, 58269, 5021, 37789, 21405, 54173, + 13213, 45981, 29597, 62365, 2973, 35741, 19357, 52125, 11165, 43933, 27549, + 60317, 7069, 39837, 23453, 56221, 15261, 48029, 31645, 64413, 1949, 34717, + 18333, 51101, 10141, 42909, 26525, 59293, 6045, 38813, 22429, 55197, 14237, + 47005, 30621, 63389, 3997, 36765, 20381, 53149, 12189, 44957, 28573, 61341, + 8093, 40861, 24477, 57245, 16285, 49053, 32669, 65437, 93, 32861, 16477, + 49245, 8285, 41053, 24669, 57437, 4189, 36957, 20573, 53341, 12381, 45149, + 28765, 61533, 2141, 34909, 18525, 51293, 10333, 43101, 26717, 59485, 6237, + 39005, 22621, 55389, 14429, 47197, 30813, 63581, 1117, 33885, 17501, 50269, + 9309, 42077, 25693, 58461, 5213, 37981, 21597, 54365, 13405, 46173, 29789, + 62557, 3165, 35933, 19549, 52317, 11357, 44125, 27741, 60509, 7261, 40029, + 23645, 56413, 15453, 48221, 31837, 64605, 605, 33373, 16989, 49757, 8797, + 41565, 25181, 57949, 4701, 37469, 21085, 53853, 12893, 45661, 29277, 62045, + 2653, 35421, 19037, 51805, 10845, 43613, 27229, 59997, 6749, 39517, 23133, + 55901, 14941, 47709, 31325, 64093, 1629, 34397, 18013, 50781, 9821, 42589, + 26205, 58973, 5725, 38493, 22109, 54877, 13917, 46685, 30301, 63069, 3677, + 36445, 20061, 52829, 11869, 44637, 28253, 61021, 7773, 40541, 24157, 56925, + 15965, 48733, 32349, 65117, 349, 33117, 16733, 49501, 8541, 41309, 24925, + 57693, 4445, 37213, 20829, 53597, 12637, 45405, 29021, 61789, 2397, 35165, + 18781, 51549, 10589, 43357, 26973, 59741, 6493, 39261, 22877, 55645, 14685, + 47453, 31069, 63837, 1373, 34141, 17757, 50525, 9565, 42333, 25949, 58717, + 5469, 38237, 21853, 54621, 13661, 46429, 30045, 62813, 3421, 36189, 19805, + 52573, 11613, 44381, 27997, 60765, 7517, 40285, 23901, 56669, 15709, 48477, + 32093, 64861, 861, 33629, 17245, 50013, 9053, 41821, 25437, 58205, 4957, + 37725, 21341, 54109, 13149, 45917, 29533, 62301, 2909, 35677, 19293, 52061, + 11101, 43869, 27485, 60253, 7005, 39773, 23389, 56157, 15197, 47965, 31581, + 64349, 1885, 34653, 18269, 51037, 10077, 42845, 26461, 59229, 5981, 38749, + 22365, 55133, 14173, 46941, 30557, 63325, 3933, 36701, 20317, 53085, 12125, + 44893, 28509, 61277, 8029, 40797, 24413, 57181, 16221, 48989, 32605, 65373, + 221, 32989, 16605, 49373, 8413, 41181, 24797, 57565, 4317, 37085, 20701, + 53469, 12509, 45277, 28893, 61661, 2269, 35037, 18653, 51421, 10461, 43229, + 26845, 59613, 6365, 39133, 22749, 55517, 14557, 47325, 30941, 63709, 1245, + 34013, 17629, 50397, 9437, 42205, 25821, 58589, 5341, 38109, 21725, 54493, + 13533, 46301, 29917, 62685, 3293, 36061, 19677, 52445, 11485, 44253, 27869, + 60637, 7389, 40157, 23773, 56541, 15581, 48349, 31965, 64733, 733, 33501, + 17117, 49885, 8925, 41693, 25309, 58077, 4829, 37597, 21213, 53981, 13021, + 45789, 29405, 62173, 2781, 35549, 19165, 51933, 10973, 43741, 27357, 60125, + 6877, 39645, 23261, 56029, 15069, 47837, 31453, 64221, 1757, 34525, 18141, + 50909, 9949, 42717, 26333, 59101, 5853, 38621, 22237, 55005, 14045, 46813, + 30429, 63197, 3805, 36573, 20189, 52957, 11997, 44765, 28381, 61149, 7901, + 40669, 24285, 57053, 16093, 48861, 32477, 65245, 477, 33245, 16861, 49629, + 8669, 41437, 25053, 57821, 4573, 37341, 20957, 53725, 12765, 45533, 29149, + 61917, 2525, 35293, 18909, 51677, 10717, 43485, 27101, 59869, 6621, 39389, + 23005, 55773, 14813, 47581, 31197, 63965, 1501, 34269, 17885, 50653, 9693, + 42461, 26077, 58845, 5597, 38365, 21981, 54749, 13789, 46557, 30173, 62941, + 3549, 36317, 19933, 52701, 11741, 44509, 28125, 60893, 7645, 40413, 24029, + 56797, 15837, 48605, 32221, 64989, 989, 33757, 17373, 50141, 9181, 41949, + 25565, 58333, 5085, 37853, 21469, 54237, 13277, 46045, 29661, 62429, 3037, + 35805, 19421, 52189, 11229, 43997, 27613, 60381, 7133, 39901, 23517, 56285, + 15325, 48093, 31709, 64477, 2013, 34781, 18397, 51165, 10205, 42973, 26589, + 59357, 6109, 38877, 22493, 55261, 14301, 47069, 30685, 63453, 4061, 36829, + 20445, 53213, 12253, 45021, 28637, 61405, 8157, 40925, 24541, 57309, 16349, + 49117, 32733, 65501, 61, 32829, 16445, 49213, 8253, 41021, 24637, 57405, + 4157, 36925, 20541, 53309, 12349, 45117, 28733, 61501, 2109, 34877, 18493, + 51261, 10301, 43069, 26685, 59453, 6205, 38973, 22589, 55357, 14397, 47165, + 30781, 63549, 1085, 33853, 17469, 50237, 9277, 42045, 25661, 58429, 5181, + 37949, 21565, 54333, 13373, 46141, 29757, 62525, 3133, 35901, 19517, 52285, + 11325, 44093, 27709, 60477, 7229, 39997, 23613, 56381, 15421, 48189, 31805, + 64573, 573, 33341, 16957, 49725, 8765, 41533, 25149, 57917, 4669, 37437, + 21053, 53821, 12861, 45629, 29245, 62013, 2621, 35389, 19005, 51773, 10813, + 43581, 27197, 59965, 6717, 39485, 23101, 55869, 14909, 47677, 31293, 64061, + 1597, 34365, 17981, 50749, 9789, 42557, 26173, 58941, 5693, 38461, 22077, + 54845, 13885, 46653, 30269, 63037, 3645, 36413, 20029, 52797, 11837, 44605, + 28221, 60989, 7741, 40509, 24125, 56893, 15933, 48701, 32317, 65085, 317, + 33085, 16701, 49469, 8509, 41277, 24893, 57661, 4413, 37181, 20797, 53565, + 12605, 45373, 28989, 61757, 2365, 35133, 18749, 51517, 10557, 43325, 26941, + 59709, 6461, 39229, 22845, 55613, 14653, 47421, 31037, 63805, 1341, 34109, + 17725, 50493, 9533, 42301, 25917, 58685, 5437, 38205, 21821, 54589, 13629, + 46397, 30013, 62781, 3389, 36157, 19773, 52541, 11581, 44349, 27965, 60733, + 7485, 40253, 23869, 56637, 15677, 48445, 32061, 64829, 829, 33597, 17213, + 49981, 9021, 41789, 25405, 58173, 4925, 37693, 21309, 54077, 13117, 45885, + 29501, 62269, 2877, 35645, 19261, 52029, 11069, 43837, 27453, 60221, 6973, + 39741, 23357, 56125, 15165, 47933, 31549, 64317, 1853, 34621, 18237, 51005, + 10045, 42813, 26429, 59197, 5949, 38717, 22333, 55101, 14141, 46909, 30525, + 63293, 3901, 36669, 20285, 53053, 12093, 44861, 28477, 61245, 7997, 40765, + 24381, 57149, 16189, 48957, 32573, 65341, 189, 32957, 16573, 49341, 8381, + 41149, 24765, 57533, 4285, 37053, 20669, 53437, 12477, 45245, 28861, 61629, + 2237, 35005, 18621, 51389, 10429, 43197, 26813, 59581, 6333, 39101, 22717, + 55485, 14525, 47293, 30909, 63677, 1213, 33981, 17597, 50365, 9405, 42173, + 25789, 58557, 5309, 38077, 21693, 54461, 13501, 46269, 29885, 62653, 3261, + 36029, 19645, 52413, 11453, 44221, 27837, 60605, 7357, 40125, 23741, 56509, + 15549, 48317, 31933, 64701, 701, 33469, 17085, 49853, 8893, 41661, 25277, + 58045, 4797, 37565, 21181, 53949, 12989, 45757, 29373, 62141, 2749, 35517, + 19133, 51901, 10941, 43709, 27325, 60093, 6845, 39613, 23229, 55997, 15037, + 47805, 31421, 64189, 1725, 34493, 18109, 50877, 9917, 42685, 26301, 59069, + 5821, 38589, 22205, 54973, 14013, 46781, 30397, 63165, 3773, 36541, 20157, + 52925, 11965, 44733, 28349, 61117, 7869, 40637, 24253, 57021, 16061, 48829, + 32445, 65213, 445, 33213, 16829, 49597, 8637, 41405, 25021, 57789, 4541, + 37309, 20925, 53693, 12733, 45501, 29117, 61885, 2493, 35261, 18877, 51645, + 10685, 43453, 27069, 59837, 6589, 39357, 22973, 55741, 14781, 47549, 31165, + 63933, 1469, 34237, 17853, 50621, 9661, 42429, 26045, 58813, 5565, 38333, + 21949, 54717, 13757, 46525, 30141, 62909, 3517, 36285, 19901, 52669, 11709, + 44477, 28093, 60861, 7613, 40381, 23997, 56765, 15805, 48573, 32189, 64957, + 957, 33725, 17341, 50109, 9149, 41917, 25533, 58301, 5053, 37821, 21437, + 54205, 13245, 46013, 29629, 62397, 3005, 35773, 19389, 52157, 11197, 43965, + 27581, 60349, 7101, 39869, 23485, 56253, 15293, 48061, 31677, 64445, 1981, + 34749, 18365, 51133, 10173, 42941, 26557, 59325, 6077, 38845, 22461, 55229, + 14269, 47037, 30653, 63421, 4029, 36797, 20413, 53181, 12221, 44989, 28605, + 61373, 8125, 40893, 24509, 57277, 16317, 49085, 32701, 65469, 125, 32893, + 16509, 49277, 8317, 41085, 24701, 57469, 4221, 36989, 20605, 53373, 12413, + 45181, 28797, 61565, 2173, 34941, 18557, 51325, 10365, 43133, 26749, 59517, + 6269, 39037, 22653, 55421, 14461, 47229, 30845, 63613, 1149, 33917, 17533, + 50301, 9341, 42109, 25725, 58493, 5245, 38013, 21629, 54397, 13437, 46205, + 29821, 62589, 3197, 35965, 19581, 52349, 11389, 44157, 27773, 60541, 7293, + 40061, 23677, 56445, 15485, 48253, 31869, 64637, 637, 33405, 17021, 49789, + 8829, 41597, 25213, 57981, 4733, 37501, 21117, 53885, 12925, 45693, 29309, + 62077, 2685, 35453, 19069, 51837, 10877, 43645, 27261, 60029, 6781, 39549, + 23165, 55933, 14973, 47741, 31357, 64125, 1661, 34429, 18045, 50813, 9853, + 42621, 26237, 59005, 5757, 38525, 22141, 54909, 13949, 46717, 30333, 63101, + 3709, 36477, 20093, 52861, 11901, 44669, 28285, 61053, 7805, 40573, 24189, + 56957, 15997, 48765, 32381, 65149, 381, 33149, 16765, 49533, 8573, 41341, + 24957, 57725, 4477, 37245, 20861, 53629, 12669, 45437, 29053, 61821, 2429, + 35197, 18813, 51581, 10621, 43389, 27005, 59773, 6525, 39293, 22909, 55677, + 14717, 47485, 31101, 63869, 1405, 34173, 17789, 50557, 9597, 42365, 25981, + 58749, 5501, 38269, 21885, 54653, 13693, 46461, 30077, 62845, 3453, 36221, + 19837, 52605, 11645, 44413, 28029, 60797, 7549, 40317, 23933, 56701, 15741, + 48509, 32125, 64893, 893, 33661, 17277, 50045, 9085, 41853, 25469, 58237, + 4989, 37757, 21373, 54141, 13181, 45949, 29565, 62333, 2941, 35709, 19325, + 52093, 11133, 43901, 27517, 60285, 7037, 39805, 23421, 56189, 15229, 47997, + 31613, 64381, 1917, 34685, 18301, 51069, 10109, 42877, 26493, 59261, 6013, + 38781, 22397, 55165, 14205, 46973, 30589, 63357, 3965, 36733, 20349, 53117, + 12157, 44925, 28541, 61309, 8061, 40829, 24445, 57213, 16253, 49021, 32637, + 65405, 253, 33021, 16637, 49405, 8445, 41213, 24829, 57597, 4349, 37117, + 20733, 53501, 12541, 45309, 28925, 61693, 2301, 35069, 18685, 51453, 10493, + 43261, 26877, 59645, 6397, 39165, 22781, 55549, 14589, 47357, 30973, 63741, + 1277, 34045, 17661, 50429, 9469, 42237, 25853, 58621, 5373, 38141, 21757, + 54525, 13565, 46333, 29949, 62717, 3325, 36093, 19709, 52477, 11517, 44285, + 27901, 60669, 7421, 40189, 23805, 56573, 15613, 48381, 31997, 64765, 765, + 33533, 17149, 49917, 8957, 41725, 25341, 58109, 4861, 37629, 21245, 54013, + 13053, 45821, 29437, 62205, 2813, 35581, 19197, 51965, 11005, 43773, 27389, + 60157, 6909, 39677, 23293, 56061, 15101, 47869, 31485, 64253, 1789, 34557, + 18173, 50941, 9981, 42749, 26365, 59133, 5885, 38653, 22269, 55037, 14077, + 46845, 30461, 63229, 3837, 36605, 20221, 52989, 12029, 44797, 28413, 61181, + 7933, 40701, 24317, 57085, 16125, 48893, 32509, 65277, 509, 33277, 16893, + 49661, 8701, 41469, 25085, 57853, 4605, 37373, 20989, 53757, 12797, 45565, + 29181, 61949, 2557, 35325, 18941, 51709, 10749, 43517, 27133, 59901, 6653, + 39421, 23037, 55805, 14845, 47613, 31229, 63997, 1533, 34301, 17917, 50685, + 9725, 42493, 26109, 58877, 5629, 38397, 22013, 54781, 13821, 46589, 30205, + 62973, 3581, 36349, 19965, 52733, 11773, 44541, 28157, 60925, 7677, 40445, + 24061, 56829, 15869, 48637, 32253, 65021, 1021, 33789, 17405, 50173, 9213, + 41981, 25597, 58365, 5117, 37885, 21501, 54269, 13309, 46077, 29693, 62461, + 3069, 35837, 19453, 52221, 11261, 44029, 27645, 60413, 7165, 39933, 23549, + 56317, 15357, 48125, 31741, 64509, 2045, 34813, 18429, 51197, 10237, 43005, + 26621, 59389, 6141, 38909, 22525, 55293, 14333, 47101, 30717, 63485, 4093, + 36861, 20477, 53245, 12285, 45053, 28669, 61437, 8189, 40957, 24573, 57341, + 16381, 49149, 32765, 65533, 3, 32771, 16387, 49155, 8195, 40963, 24579, + 57347, 4099, 36867, 20483, 53251, 12291, 45059, 28675, 61443, 2051, 34819, + 18435, 51203, 10243, 43011, 26627, 59395, 6147, 38915, 22531, 55299, 14339, + 47107, 30723, 63491, 1027, 33795, 17411, 50179, 9219, 41987, 25603, 58371, + 5123, 37891, 21507, 54275, 13315, 46083, 29699, 62467, 3075, 35843, 19459, + 52227, 11267, 44035, 27651, 60419, 7171, 39939, 23555, 56323, 15363, 48131, + 31747, 64515, 515, 33283, 16899, 49667, 8707, 41475, 25091, 57859, 4611, + 37379, 20995, 53763, 12803, 45571, 29187, 61955, 2563, 35331, 18947, 51715, + 10755, 43523, 27139, 59907, 6659, 39427, 23043, 55811, 14851, 47619, 31235, + 64003, 1539, 34307, 17923, 50691, 9731, 42499, 26115, 58883, 5635, 38403, + 22019, 54787, 13827, 46595, 30211, 62979, 3587, 36355, 19971, 52739, 11779, + 44547, 28163, 60931, 7683, 40451, 24067, 56835, 15875, 48643, 32259, 65027, + 259, 33027, 16643, 49411, 8451, 41219, 24835, 57603, 4355, 37123, 20739, + 53507, 12547, 45315, 28931, 61699, 2307, 35075, 18691, 51459, 10499, 43267, + 26883, 59651, 6403, 39171, 22787, 55555, 14595, 47363, 30979, 63747, 1283, + 34051, 17667, 50435, 9475, 42243, 25859, 58627, 5379, 38147, 21763, 54531, + 13571, 46339, 29955, 62723, 3331, 36099, 19715, 52483, 11523, 44291, 27907, + 60675, 7427, 40195, 23811, 56579, 15619, 48387, 32003, 64771, 771, 33539, + 17155, 49923, 8963, 41731, 25347, 58115, 4867, 37635, 21251, 54019, 13059, + 45827, 29443, 62211, 2819, 35587, 19203, 51971, 11011, 43779, 27395, 60163, + 6915, 39683, 23299, 56067, 15107, 47875, 31491, 64259, 1795, 34563, 18179, + 50947, 9987, 42755, 26371, 59139, 5891, 38659, 22275, 55043, 14083, 46851, + 30467, 63235, 3843, 36611, 20227, 52995, 12035, 44803, 28419, 61187, 7939, + 40707, 24323, 57091, 16131, 48899, 32515, 65283, 131, 32899, 16515, 49283, + 8323, 41091, 24707, 57475, 4227, 36995, 20611, 53379, 12419, 45187, 28803, + 61571, 2179, 34947, 18563, 51331, 10371, 43139, 26755, 59523, 6275, 39043, + 22659, 55427, 14467, 47235, 30851, 63619, 1155, 33923, 17539, 50307, 9347, + 42115, 25731, 58499, 5251, 38019, 21635, 54403, 13443, 46211, 29827, 62595, + 3203, 35971, 19587, 52355, 11395, 44163, 27779, 60547, 7299, 40067, 23683, + 56451, 15491, 48259, 31875, 64643, 643, 33411, 17027, 49795, 8835, 41603, + 25219, 57987, 4739, 37507, 21123, 53891, 12931, 45699, 29315, 62083, 2691, + 35459, 19075, 51843, 10883, 43651, 27267, 60035, 6787, 39555, 23171, 55939, + 14979, 47747, 31363, 64131, 1667, 34435, 18051, 50819, 9859, 42627, 26243, + 59011, 5763, 38531, 22147, 54915, 13955, 46723, 30339, 63107, 3715, 36483, + 20099, 52867, 11907, 44675, 28291, 61059, 7811, 40579, 24195, 56963, 16003, + 48771, 32387, 65155, 387, 33155, 16771, 49539, 8579, 41347, 24963, 57731, + 4483, 37251, 20867, 53635, 12675, 45443, 29059, 61827, 2435, 35203, 18819, + 51587, 10627, 43395, 27011, 59779, 6531, 39299, 22915, 55683, 14723, 47491, + 31107, 63875, 1411, 34179, 17795, 50563, 9603, 42371, 25987, 58755, 5507, + 38275, 21891, 54659, 13699, 46467, 30083, 62851, 3459, 36227, 19843, 52611, + 11651, 44419, 28035, 60803, 7555, 40323, 23939, 56707, 15747, 48515, 32131, + 64899, 899, 33667, 17283, 50051, 9091, 41859, 25475, 58243, 4995, 37763, + 21379, 54147, 13187, 45955, 29571, 62339, 2947, 35715, 19331, 52099, 11139, + 43907, 27523, 60291, 7043, 39811, 23427, 56195, 15235, 48003, 31619, 64387, + 1923, 34691, 18307, 51075, 10115, 42883, 26499, 59267, 6019, 38787, 22403, + 55171, 14211, 46979, 30595, 63363, 3971, 36739, 20355, 53123, 12163, 44931, + 28547, 61315, 8067, 40835, 24451, 57219, 16259, 49027, 32643, 65411, 67, + 32835, 16451, 49219, 8259, 41027, 24643, 57411, 4163, 36931, 20547, 53315, + 12355, 45123, 28739, 61507, 2115, 34883, 18499, 51267, 10307, 43075, 26691, + 59459, 6211, 38979, 22595, 55363, 14403, 47171, 30787, 63555, 1091, 33859, + 17475, 50243, 9283, 42051, 25667, 58435, 5187, 37955, 21571, 54339, 13379, + 46147, 29763, 62531, 3139, 35907, 19523, 52291, 11331, 44099, 27715, 60483, + 7235, 40003, 23619, 56387, 15427, 48195, 31811, 64579, 579, 33347, 16963, + 49731, 8771, 41539, 25155, 57923, 4675, 37443, 21059, 53827, 12867, 45635, + 29251, 62019, 2627, 35395, 19011, 51779, 10819, 43587, 27203, 59971, 6723, + 39491, 23107, 55875, 14915, 47683, 31299, 64067, 1603, 34371, 17987, 50755, + 9795, 42563, 26179, 58947, 5699, 38467, 22083, 54851, 13891, 46659, 30275, + 63043, 3651, 36419, 20035, 52803, 11843, 44611, 28227, 60995, 7747, 40515, + 24131, 56899, 15939, 48707, 32323, 65091, 323, 33091, 16707, 49475, 8515, + 41283, 24899, 57667, 4419, 37187, 20803, 53571, 12611, 45379, 28995, 61763, + 2371, 35139, 18755, 51523, 10563, 43331, 26947, 59715, 6467, 39235, 22851, + 55619, 14659, 47427, 31043, 63811, 1347, 34115, 17731, 50499, 9539, 42307, + 25923, 58691, 5443, 38211, 21827, 54595, 13635, 46403, 30019, 62787, 3395, + 36163, 19779, 52547, 11587, 44355, 27971, 60739, 7491, 40259, 23875, 56643, + 15683, 48451, 32067, 64835, 835, 33603, 17219, 49987, 9027, 41795, 25411, + 58179, 4931, 37699, 21315, 54083, 13123, 45891, 29507, 62275, 2883, 35651, + 19267, 52035, 11075, 43843, 27459, 60227, 6979, 39747, 23363, 56131, 15171, + 47939, 31555, 64323, 1859, 34627, 18243, 51011, 10051, 42819, 26435, 59203, + 5955, 38723, 22339, 55107, 14147, 46915, 30531, 63299, 3907, 36675, 20291, + 53059, 12099, 44867, 28483, 61251, 8003, 40771, 24387, 57155, 16195, 48963, + 32579, 65347, 195, 32963, 16579, 49347, 8387, 41155, 24771, 57539, 4291, + 37059, 20675, 53443, 12483, 45251, 28867, 61635, 2243, 35011, 18627, 51395, + 10435, 43203, 26819, 59587, 6339, 39107, 22723, 55491, 14531, 47299, 30915, + 63683, 1219, 33987, 17603, 50371, 9411, 42179, 25795, 58563, 5315, 38083, + 21699, 54467, 13507, 46275, 29891, 62659, 3267, 36035, 19651, 52419, 11459, + 44227, 27843, 60611, 7363, 40131, 23747, 56515, 15555, 48323, 31939, 64707, + 707, 33475, 17091, 49859, 8899, 41667, 25283, 58051, 4803, 37571, 21187, + 53955, 12995, 45763, 29379, 62147, 2755, 35523, 19139, 51907, 10947, 43715, + 27331, 60099, 6851, 39619, 23235, 56003, 15043, 47811, 31427, 64195, 1731, + 34499, 18115, 50883, 9923, 42691, 26307, 59075, 5827, 38595, 22211, 54979, + 14019, 46787, 30403, 63171, 3779, 36547, 20163, 52931, 11971, 44739, 28355, + 61123, 7875, 40643, 24259, 57027, 16067, 48835, 32451, 65219, 451, 33219, + 16835, 49603, 8643, 41411, 25027, 57795, 4547, 37315, 20931, 53699, 12739, + 45507, 29123, 61891, 2499, 35267, 18883, 51651, 10691, 43459, 27075, 59843, + 6595, 39363, 22979, 55747, 14787, 47555, 31171, 63939, 1475, 34243, 17859, + 50627, 9667, 42435, 26051, 58819, 5571, 38339, 21955, 54723, 13763, 46531, + 30147, 62915, 3523, 36291, 19907, 52675, 11715, 44483, 28099, 60867, 7619, + 40387, 24003, 56771, 15811, 48579, 32195, 64963, 963, 33731, 17347, 50115, + 9155, 41923, 25539, 58307, 5059, 37827, 21443, 54211, 13251, 46019, 29635, + 62403, 3011, 35779, 19395, 52163, 11203, 43971, 27587, 60355, 7107, 39875, + 23491, 56259, 15299, 48067, 31683, 64451, 1987, 34755, 18371, 51139, 10179, + 42947, 26563, 59331, 6083, 38851, 22467, 55235, 14275, 47043, 30659, 63427, + 4035, 36803, 20419, 53187, 12227, 44995, 28611, 61379, 8131, 40899, 24515, + 57283, 16323, 49091, 32707, 65475, 35, 32803, 16419, 49187, 8227, 40995, + 24611, 57379, 4131, 36899, 20515, 53283, 12323, 45091, 28707, 61475, 2083, + 34851, 18467, 51235, 10275, 43043, 26659, 59427, 6179, 38947, 22563, 55331, + 14371, 47139, 30755, 63523, 1059, 33827, 17443, 50211, 9251, 42019, 25635, + 58403, 5155, 37923, 21539, 54307, 13347, 46115, 29731, 62499, 3107, 35875, + 19491, 52259, 11299, 44067, 27683, 60451, 7203, 39971, 23587, 56355, 15395, + 48163, 31779, 64547, 547, 33315, 16931, 49699, 8739, 41507, 25123, 57891, + 4643, 37411, 21027, 53795, 12835, 45603, 29219, 61987, 2595, 35363, 18979, + 51747, 10787, 43555, 27171, 59939, 6691, 39459, 23075, 55843, 14883, 47651, + 31267, 64035, 1571, 34339, 17955, 50723, 9763, 42531, 26147, 58915, 5667, + 38435, 22051, 54819, 13859, 46627, 30243, 63011, 3619, 36387, 20003, 52771, + 11811, 44579, 28195, 60963, 7715, 40483, 24099, 56867, 15907, 48675, 32291, + 65059, 291, 33059, 16675, 49443, 8483, 41251, 24867, 57635, 4387, 37155, + 20771, 53539, 12579, 45347, 28963, 61731, 2339, 35107, 18723, 51491, 10531, + 43299, 26915, 59683, 6435, 39203, 22819, 55587, 14627, 47395, 31011, 63779, + 1315, 34083, 17699, 50467, 9507, 42275, 25891, 58659, 5411, 38179, 21795, + 54563, 13603, 46371, 29987, 62755, 3363, 36131, 19747, 52515, 11555, 44323, + 27939, 60707, 7459, 40227, 23843, 56611, 15651, 48419, 32035, 64803, 803, + 33571, 17187, 49955, 8995, 41763, 25379, 58147, 4899, 37667, 21283, 54051, + 13091, 45859, 29475, 62243, 2851, 35619, 19235, 52003, 11043, 43811, 27427, + 60195, 6947, 39715, 23331, 56099, 15139, 47907, 31523, 64291, 1827, 34595, + 18211, 50979, 10019, 42787, 26403, 59171, 5923, 38691, 22307, 55075, 14115, + 46883, 30499, 63267, 3875, 36643, 20259, 53027, 12067, 44835, 28451, 61219, + 7971, 40739, 24355, 57123, 16163, 48931, 32547, 65315, 163, 32931, 16547, + 49315, 8355, 41123, 24739, 57507, 4259, 37027, 20643, 53411, 12451, 45219, + 28835, 61603, 2211, 34979, 18595, 51363, 10403, 43171, 26787, 59555, 6307, + 39075, 22691, 55459, 14499, 47267, 30883, 63651, 1187, 33955, 17571, 50339, + 9379, 42147, 25763, 58531, 5283, 38051, 21667, 54435, 13475, 46243, 29859, + 62627, 3235, 36003, 19619, 52387, 11427, 44195, 27811, 60579, 7331, 40099, + 23715, 56483, 15523, 48291, 31907, 64675, 675, 33443, 17059, 49827, 8867, + 41635, 25251, 58019, 4771, 37539, 21155, 53923, 12963, 45731, 29347, 62115, + 2723, 35491, 19107, 51875, 10915, 43683, 27299, 60067, 6819, 39587, 23203, + 55971, 15011, 47779, 31395, 64163, 1699, 34467, 18083, 50851, 9891, 42659, + 26275, 59043, 5795, 38563, 22179, 54947, 13987, 46755, 30371, 63139, 3747, + 36515, 20131, 52899, 11939, 44707, 28323, 61091, 7843, 40611, 24227, 56995, + 16035, 48803, 32419, 65187, 419, 33187, 16803, 49571, 8611, 41379, 24995, + 57763, 4515, 37283, 20899, 53667, 12707, 45475, 29091, 61859, 2467, 35235, + 18851, 51619, 10659, 43427, 27043, 59811, 6563, 39331, 22947, 55715, 14755, + 47523, 31139, 63907, 1443, 34211, 17827, 50595, 9635, 42403, 26019, 58787, + 5539, 38307, 21923, 54691, 13731, 46499, 30115, 62883, 3491, 36259, 19875, + 52643, 11683, 44451, 28067, 60835, 7587, 40355, 23971, 56739, 15779, 48547, + 32163, 64931, 931, 33699, 17315, 50083, 9123, 41891, 25507, 58275, 5027, + 37795, 21411, 54179, 13219, 45987, 29603, 62371, 2979, 35747, 19363, 52131, + 11171, 43939, 27555, 60323, 7075, 39843, 23459, 56227, 15267, 48035, 31651, + 64419, 1955, 34723, 18339, 51107, 10147, 42915, 26531, 59299, 6051, 38819, + 22435, 55203, 14243, 47011, 30627, 63395, 4003, 36771, 20387, 53155, 12195, + 44963, 28579, 61347, 8099, 40867, 24483, 57251, 16291, 49059, 32675, 65443, + 99, 32867, 16483, 49251, 8291, 41059, 24675, 57443, 4195, 36963, 20579, + 53347, 12387, 45155, 28771, 61539, 2147, 34915, 18531, 51299, 10339, 43107, + 26723, 59491, 6243, 39011, 22627, 55395, 14435, 47203, 30819, 63587, 1123, + 33891, 17507, 50275, 9315, 42083, 25699, 58467, 5219, 37987, 21603, 54371, + 13411, 46179, 29795, 62563, 3171, 35939, 19555, 52323, 11363, 44131, 27747, + 60515, 7267, 40035, 23651, 56419, 15459, 48227, 31843, 64611, 611, 33379, + 16995, 49763, 8803, 41571, 25187, 57955, 4707, 37475, 21091, 53859, 12899, + 45667, 29283, 62051, 2659, 35427, 19043, 51811, 10851, 43619, 27235, 60003, + 6755, 39523, 23139, 55907, 14947, 47715, 31331, 64099, 1635, 34403, 18019, + 50787, 9827, 42595, 26211, 58979, 5731, 38499, 22115, 54883, 13923, 46691, + 30307, 63075, 3683, 36451, 20067, 52835, 11875, 44643, 28259, 61027, 7779, + 40547, 24163, 56931, 15971, 48739, 32355, 65123, 355, 33123, 16739, 49507, + 8547, 41315, 24931, 57699, 4451, 37219, 20835, 53603, 12643, 45411, 29027, + 61795, 2403, 35171, 18787, 51555, 10595, 43363, 26979, 59747, 6499, 39267, + 22883, 55651, 14691, 47459, 31075, 63843, 1379, 34147, 17763, 50531, 9571, + 42339, 25955, 58723, 5475, 38243, 21859, 54627, 13667, 46435, 30051, 62819, + 3427, 36195, 19811, 52579, 11619, 44387, 28003, 60771, 7523, 40291, 23907, + 56675, 15715, 48483, 32099, 64867, 867, 33635, 17251, 50019, 9059, 41827, + 25443, 58211, 4963, 37731, 21347, 54115, 13155, 45923, 29539, 62307, 2915, + 35683, 19299, 52067, 11107, 43875, 27491, 60259, 7011, 39779, 23395, 56163, + 15203, 47971, 31587, 64355, 1891, 34659, 18275, 51043, 10083, 42851, 26467, + 59235, 5987, 38755, 22371, 55139, 14179, 46947, 30563, 63331, 3939, 36707, + 20323, 53091, 12131, 44899, 28515, 61283, 8035, 40803, 24419, 57187, 16227, + 48995, 32611, 65379, 227, 32995, 16611, 49379, 8419, 41187, 24803, 57571, + 4323, 37091, 20707, 53475, 12515, 45283, 28899, 61667, 2275, 35043, 18659, + 51427, 10467, 43235, 26851, 59619, 6371, 39139, 22755, 55523, 14563, 47331, + 30947, 63715, 1251, 34019, 17635, 50403, 9443, 42211, 25827, 58595, 5347, + 38115, 21731, 54499, 13539, 46307, 29923, 62691, 3299, 36067, 19683, 52451, + 11491, 44259, 27875, 60643, 7395, 40163, 23779, 56547, 15587, 48355, 31971, + 64739, 739, 33507, 17123, 49891, 8931, 41699, 25315, 58083, 4835, 37603, + 21219, 53987, 13027, 45795, 29411, 62179, 2787, 35555, 19171, 51939, 10979, + 43747, 27363, 60131, 6883, 39651, 23267, 56035, 15075, 47843, 31459, 64227, + 1763, 34531, 18147, 50915, 9955, 42723, 26339, 59107, 5859, 38627, 22243, + 55011, 14051, 46819, 30435, 63203, 3811, 36579, 20195, 52963, 12003, 44771, + 28387, 61155, 7907, 40675, 24291, 57059, 16099, 48867, 32483, 65251, 483, + 33251, 16867, 49635, 8675, 41443, 25059, 57827, 4579, 37347, 20963, 53731, + 12771, 45539, 29155, 61923, 2531, 35299, 18915, 51683, 10723, 43491, 27107, + 59875, 6627, 39395, 23011, 55779, 14819, 47587, 31203, 63971, 1507, 34275, + 17891, 50659, 9699, 42467, 26083, 58851, 5603, 38371, 21987, 54755, 13795, + 46563, 30179, 62947, 3555, 36323, 19939, 52707, 11747, 44515, 28131, 60899, + 7651, 40419, 24035, 56803, 15843, 48611, 32227, 64995, 995, 33763, 17379, + 50147, 9187, 41955, 25571, 58339, 5091, 37859, 21475, 54243, 13283, 46051, + 29667, 62435, 3043, 35811, 19427, 52195, 11235, 44003, 27619, 60387, 7139, + 39907, 23523, 56291, 15331, 48099, 31715, 64483, 2019, 34787, 18403, 51171, + 10211, 42979, 26595, 59363, 6115, 38883, 22499, 55267, 14307, 47075, 30691, + 63459, 4067, 36835, 20451, 53219, 12259, 45027, 28643, 61411, 8163, 40931, + 24547, 57315, 16355, 49123, 32739, 65507, 19, 32787, 16403, 49171, 8211, + 40979, 24595, 57363, 4115, 36883, 20499, 53267, 12307, 45075, 28691, 61459, + 2067, 34835, 18451, 51219, 10259, 43027, 26643, 59411, 6163, 38931, 22547, + 55315, 14355, 47123, 30739, 63507, 1043, 33811, 17427, 50195, 9235, 42003, + 25619, 58387, 5139, 37907, 21523, 54291, 13331, 46099, 29715, 62483, 3091, + 35859, 19475, 52243, 11283, 44051, 27667, 60435, 7187, 39955, 23571, 56339, + 15379, 48147, 31763, 64531, 531, 33299, 16915, 49683, 8723, 41491, 25107, + 57875, 4627, 37395, 21011, 53779, 12819, 45587, 29203, 61971, 2579, 35347, + 18963, 51731, 10771, 43539, 27155, 59923, 6675, 39443, 23059, 55827, 14867, + 47635, 31251, 64019, 1555, 34323, 17939, 50707, 9747, 42515, 26131, 58899, + 5651, 38419, 22035, 54803, 13843, 46611, 30227, 62995, 3603, 36371, 19987, + 52755, 11795, 44563, 28179, 60947, 7699, 40467, 24083, 56851, 15891, 48659, + 32275, 65043, 275, 33043, 16659, 49427, 8467, 41235, 24851, 57619, 4371, + 37139, 20755, 53523, 12563, 45331, 28947, 61715, 2323, 35091, 18707, 51475, + 10515, 43283, 26899, 59667, 6419, 39187, 22803, 55571, 14611, 47379, 30995, + 63763, 1299, 34067, 17683, 50451, 9491, 42259, 25875, 58643, 5395, 38163, + 21779, 54547, 13587, 46355, 29971, 62739, 3347, 36115, 19731, 52499, 11539, + 44307, 27923, 60691, 7443, 40211, 23827, 56595, 15635, 48403, 32019, 64787, + 787, 33555, 17171, 49939, 8979, 41747, 25363, 58131, 4883, 37651, 21267, + 54035, 13075, 45843, 29459, 62227, 2835, 35603, 19219, 51987, 11027, 43795, + 27411, 60179, 6931, 39699, 23315, 56083, 15123, 47891, 31507, 64275, 1811, + 34579, 18195, 50963, 10003, 42771, 26387, 59155, 5907, 38675, 22291, 55059, + 14099, 46867, 30483, 63251, 3859, 36627, 20243, 53011, 12051, 44819, 28435, + 61203, 7955, 40723, 24339, 57107, 16147, 48915, 32531, 65299, 147, 32915, + 16531, 49299, 8339, 41107, 24723, 57491, 4243, 37011, 20627, 53395, 12435, + 45203, 28819, 61587, 2195, 34963, 18579, 51347, 10387, 43155, 26771, 59539, + 6291, 39059, 22675, 55443, 14483, 47251, 30867, 63635, 1171, 33939, 17555, + 50323, 9363, 42131, 25747, 58515, 5267, 38035, 21651, 54419, 13459, 46227, + 29843, 62611, 3219, 35987, 19603, 52371, 11411, 44179, 27795, 60563, 7315, + 40083, 23699, 56467, 15507, 48275, 31891, 64659, 659, 33427, 17043, 49811, + 8851, 41619, 25235, 58003, 4755, 37523, 21139, 53907, 12947, 45715, 29331, + 62099, 2707, 35475, 19091, 51859, 10899, 43667, 27283, 60051, 6803, 39571, + 23187, 55955, 14995, 47763, 31379, 64147, 1683, 34451, 18067, 50835, 9875, + 42643, 26259, 59027, 5779, 38547, 22163, 54931, 13971, 46739, 30355, 63123, + 3731, 36499, 20115, 52883, 11923, 44691, 28307, 61075, 7827, 40595, 24211, + 56979, 16019, 48787, 32403, 65171, 403, 33171, 16787, 49555, 8595, 41363, + 24979, 57747, 4499, 37267, 20883, 53651, 12691, 45459, 29075, 61843, 2451, + 35219, 18835, 51603, 10643, 43411, 27027, 59795, 6547, 39315, 22931, 55699, + 14739, 47507, 31123, 63891, 1427, 34195, 17811, 50579, 9619, 42387, 26003, + 58771, 5523, 38291, 21907, 54675, 13715, 46483, 30099, 62867, 3475, 36243, + 19859, 52627, 11667, 44435, 28051, 60819, 7571, 40339, 23955, 56723, 15763, + 48531, 32147, 64915, 915, 33683, 17299, 50067, 9107, 41875, 25491, 58259, + 5011, 37779, 21395, 54163, 13203, 45971, 29587, 62355, 2963, 35731, 19347, + 52115, 11155, 43923, 27539, 60307, 7059, 39827, 23443, 56211, 15251, 48019, + 31635, 64403, 1939, 34707, 18323, 51091, 10131, 42899, 26515, 59283, 6035, + 38803, 22419, 55187, 14227, 46995, 30611, 63379, 3987, 36755, 20371, 53139, + 12179, 44947, 28563, 61331, 8083, 40851, 24467, 57235, 16275, 49043, 32659, + 65427, 83, 32851, 16467, 49235, 8275, 41043, 24659, 57427, 4179, 36947, + 20563, 53331, 12371, 45139, 28755, 61523, 2131, 34899, 18515, 51283, 10323, + 43091, 26707, 59475, 6227, 38995, 22611, 55379, 14419, 47187, 30803, 63571, + 1107, 33875, 17491, 50259, 9299, 42067, 25683, 58451, 5203, 37971, 21587, + 54355, 13395, 46163, 29779, 62547, 3155, 35923, 19539, 52307, 11347, 44115, + 27731, 60499, 7251, 40019, 23635, 56403, 15443, 48211, 31827, 64595, 595, + 33363, 16979, 49747, 8787, 41555, 25171, 57939, 4691, 37459, 21075, 53843, + 12883, 45651, 29267, 62035, 2643, 35411, 19027, 51795, 10835, 43603, 27219, + 59987, 6739, 39507, 23123, 55891, 14931, 47699, 31315, 64083, 1619, 34387, + 18003, 50771, 9811, 42579, 26195, 58963, 5715, 38483, 22099, 54867, 13907, + 46675, 30291, 63059, 3667, 36435, 20051, 52819, 11859, 44627, 28243, 61011, + 7763, 40531, 24147, 56915, 15955, 48723, 32339, 65107, 339, 33107, 16723, + 49491, 8531, 41299, 24915, 57683, 4435, 37203, 20819, 53587, 12627, 45395, + 29011, 61779, 2387, 35155, 18771, 51539, 10579, 43347, 26963, 59731, 6483, + 39251, 22867, 55635, 14675, 47443, 31059, 63827, 1363, 34131, 17747, 50515, + 9555, 42323, 25939, 58707, 5459, 38227, 21843, 54611, 13651, 46419, 30035, + 62803, 3411, 36179, 19795, 52563, 11603, 44371, 27987, 60755, 7507, 40275, + 23891, 56659, 15699, 48467, 32083, 64851, 851, 33619, 17235, 50003, 9043, + 41811, 25427, 58195, 4947, 37715, 21331, 54099, 13139, 45907, 29523, 62291, + 2899, 35667, 19283, 52051, 11091, 43859, 27475, 60243, 6995, 39763, 23379, + 56147, 15187, 47955, 31571, 64339, 1875, 34643, 18259, 51027, 10067, 42835, + 26451, 59219, 5971, 38739, 22355, 55123, 14163, 46931, 30547, 63315, 3923, + 36691, 20307, 53075, 12115, 44883, 28499, 61267, 8019, 40787, 24403, 57171, + 16211, 48979, 32595, 65363, 211, 32979, 16595, 49363, 8403, 41171, 24787, + 57555, 4307, 37075, 20691, 53459, 12499, 45267, 28883, 61651, 2259, 35027, + 18643, 51411, 10451, 43219, 26835, 59603, 6355, 39123, 22739, 55507, 14547, + 47315, 30931, 63699, 1235, 34003, 17619, 50387, 9427, 42195, 25811, 58579, + 5331, 38099, 21715, 54483, 13523, 46291, 29907, 62675, 3283, 36051, 19667, + 52435, 11475, 44243, 27859, 60627, 7379, 40147, 23763, 56531, 15571, 48339, + 31955, 64723, 723, 33491, 17107, 49875, 8915, 41683, 25299, 58067, 4819, + 37587, 21203, 53971, 13011, 45779, 29395, 62163, 2771, 35539, 19155, 51923, + 10963, 43731, 27347, 60115, 6867, 39635, 23251, 56019, 15059, 47827, 31443, + 64211, 1747, 34515, 18131, 50899, 9939, 42707, 26323, 59091, 5843, 38611, + 22227, 54995, 14035, 46803, 30419, 63187, 3795, 36563, 20179, 52947, 11987, + 44755, 28371, 61139, 7891, 40659, 24275, 57043, 16083, 48851, 32467, 65235, + 467, 33235, 16851, 49619, 8659, 41427, 25043, 57811, 4563, 37331, 20947, + 53715, 12755, 45523, 29139, 61907, 2515, 35283, 18899, 51667, 10707, 43475, + 27091, 59859, 6611, 39379, 22995, 55763, 14803, 47571, 31187, 63955, 1491, + 34259, 17875, 50643, 9683, 42451, 26067, 58835, 5587, 38355, 21971, 54739, + 13779, 46547, 30163, 62931, 3539, 36307, 19923, 52691, 11731, 44499, 28115, + 60883, 7635, 40403, 24019, 56787, 15827, 48595, 32211, 64979, 979, 33747, + 17363, 50131, 9171, 41939, 25555, 58323, 5075, 37843, 21459, 54227, 13267, + 46035, 29651, 62419, 3027, 35795, 19411, 52179, 11219, 43987, 27603, 60371, + 7123, 39891, 23507, 56275, 15315, 48083, 31699, 64467, 2003, 34771, 18387, + 51155, 10195, 42963, 26579, 59347, 6099, 38867, 22483, 55251, 14291, 47059, + 30675, 63443, 4051, 36819, 20435, 53203, 12243, 45011, 28627, 61395, 8147, + 40915, 24531, 57299, 16339, 49107, 32723, 65491, 51, 32819, 16435, 49203, + 8243, 41011, 24627, 57395, 4147, 36915, 20531, 53299, 12339, 45107, 28723, + 61491, 2099, 34867, 18483, 51251, 10291, 43059, 26675, 59443, 6195, 38963, + 22579, 55347, 14387, 47155, 30771, 63539, 1075, 33843, 17459, 50227, 9267, + 42035, 25651, 58419, 5171, 37939, 21555, 54323, 13363, 46131, 29747, 62515, + 3123, 35891, 19507, 52275, 11315, 44083, 27699, 60467, 7219, 39987, 23603, + 56371, 15411, 48179, 31795, 64563, 563, 33331, 16947, 49715, 8755, 41523, + 25139, 57907, 4659, 37427, 21043, 53811, 12851, 45619, 29235, 62003, 2611, + 35379, 18995, 51763, 10803, 43571, 27187, 59955, 6707, 39475, 23091, 55859, + 14899, 47667, 31283, 64051, 1587, 34355, 17971, 50739, 9779, 42547, 26163, + 58931, 5683, 38451, 22067, 54835, 13875, 46643, 30259, 63027, 3635, 36403, + 20019, 52787, 11827, 44595, 28211, 60979, 7731, 40499, 24115, 56883, 15923, + 48691, 32307, 65075, 307, 33075, 16691, 49459, 8499, 41267, 24883, 57651, + 4403, 37171, 20787, 53555, 12595, 45363, 28979, 61747, 2355, 35123, 18739, + 51507, 10547, 43315, 26931, 59699, 6451, 39219, 22835, 55603, 14643, 47411, + 31027, 63795, 1331, 34099, 17715, 50483, 9523, 42291, 25907, 58675, 5427, + 38195, 21811, 54579, 13619, 46387, 30003, 62771, 3379, 36147, 19763, 52531, + 11571, 44339, 27955, 60723, 7475, 40243, 23859, 56627, 15667, 48435, 32051, + 64819, 819, 33587, 17203, 49971, 9011, 41779, 25395, 58163, 4915, 37683, + 21299, 54067, 13107, 45875, 29491, 62259, 2867, 35635, 19251, 52019, 11059, + 43827, 27443, 60211, 6963, 39731, 23347, 56115, 15155, 47923, 31539, 64307, + 1843, 34611, 18227, 50995, 10035, 42803, 26419, 59187, 5939, 38707, 22323, + 55091, 14131, 46899, 30515, 63283, 3891, 36659, 20275, 53043, 12083, 44851, + 28467, 61235, 7987, 40755, 24371, 57139, 16179, 48947, 32563, 65331, 179, + 32947, 16563, 49331, 8371, 41139, 24755, 57523, 4275, 37043, 20659, 53427, + 12467, 45235, 28851, 61619, 2227, 34995, 18611, 51379, 10419, 43187, 26803, + 59571, 6323, 39091, 22707, 55475, 14515, 47283, 30899, 63667, 1203, 33971, + 17587, 50355, 9395, 42163, 25779, 58547, 5299, 38067, 21683, 54451, 13491, + 46259, 29875, 62643, 3251, 36019, 19635, 52403, 11443, 44211, 27827, 60595, + 7347, 40115, 23731, 56499, 15539, 48307, 31923, 64691, 691, 33459, 17075, + 49843, 8883, 41651, 25267, 58035, 4787, 37555, 21171, 53939, 12979, 45747, + 29363, 62131, 2739, 35507, 19123, 51891, 10931, 43699, 27315, 60083, 6835, + 39603, 23219, 55987, 15027, 47795, 31411, 64179, 1715, 34483, 18099, 50867, + 9907, 42675, 26291, 59059, 5811, 38579, 22195, 54963, 14003, 46771, 30387, + 63155, 3763, 36531, 20147, 52915, 11955, 44723, 28339, 61107, 7859, 40627, + 24243, 57011, 16051, 48819, 32435, 65203, 435, 33203, 16819, 49587, 8627, + 41395, 25011, 57779, 4531, 37299, 20915, 53683, 12723, 45491, 29107, 61875, + 2483, 35251, 18867, 51635, 10675, 43443, 27059, 59827, 6579, 39347, 22963, + 55731, 14771, 47539, 31155, 63923, 1459, 34227, 17843, 50611, 9651, 42419, + 26035, 58803, 5555, 38323, 21939, 54707, 13747, 46515, 30131, 62899, 3507, + 36275, 19891, 52659, 11699, 44467, 28083, 60851, 7603, 40371, 23987, 56755, + 15795, 48563, 32179, 64947, 947, 33715, 17331, 50099, 9139, 41907, 25523, + 58291, 5043, 37811, 21427, 54195, 13235, 46003, 29619, 62387, 2995, 35763, + 19379, 52147, 11187, 43955, 27571, 60339, 7091, 39859, 23475, 56243, 15283, + 48051, 31667, 64435, 1971, 34739, 18355, 51123, 10163, 42931, 26547, 59315, + 6067, 38835, 22451, 55219, 14259, 47027, 30643, 63411, 4019, 36787, 20403, + 53171, 12211, 44979, 28595, 61363, 8115, 40883, 24499, 57267, 16307, 49075, + 32691, 65459, 115, 32883, 16499, 49267, 8307, 41075, 24691, 57459, 4211, + 36979, 20595, 53363, 12403, 45171, 28787, 61555, 2163, 34931, 18547, 51315, + 10355, 43123, 26739, 59507, 6259, 39027, 22643, 55411, 14451, 47219, 30835, + 63603, 1139, 33907, 17523, 50291, 9331, 42099, 25715, 58483, 5235, 38003, + 21619, 54387, 13427, 46195, 29811, 62579, 3187, 35955, 19571, 52339, 11379, + 44147, 27763, 60531, 7283, 40051, 23667, 56435, 15475, 48243, 31859, 64627, + 627, 33395, 17011, 49779, 8819, 41587, 25203, 57971, 4723, 37491, 21107, + 53875, 12915, 45683, 29299, 62067, 2675, 35443, 19059, 51827, 10867, 43635, + 27251, 60019, 6771, 39539, 23155, 55923, 14963, 47731, 31347, 64115, 1651, + 34419, 18035, 50803, 9843, 42611, 26227, 58995, 5747, 38515, 22131, 54899, + 13939, 46707, 30323, 63091, 3699, 36467, 20083, 52851, 11891, 44659, 28275, + 61043, 7795, 40563, 24179, 56947, 15987, 48755, 32371, 65139, 371, 33139, + 16755, 49523, 8563, 41331, 24947, 57715, 4467, 37235, 20851, 53619, 12659, + 45427, 29043, 61811, 2419, 35187, 18803, 51571, 10611, 43379, 26995, 59763, + 6515, 39283, 22899, 55667, 14707, 47475, 31091, 63859, 1395, 34163, 17779, + 50547, 9587, 42355, 25971, 58739, 5491, 38259, 21875, 54643, 13683, 46451, + 30067, 62835, 3443, 36211, 19827, 52595, 11635, 44403, 28019, 60787, 7539, + 40307, 23923, 56691, 15731, 48499, 32115, 64883, 883, 33651, 17267, 50035, + 9075, 41843, 25459, 58227, 4979, 37747, 21363, 54131, 13171, 45939, 29555, + 62323, 2931, 35699, 19315, 52083, 11123, 43891, 27507, 60275, 7027, 39795, + 23411, 56179, 15219, 47987, 31603, 64371, 1907, 34675, 18291, 51059, 10099, + 42867, 26483, 59251, 6003, 38771, 22387, 55155, 14195, 46963, 30579, 63347, + 3955, 36723, 20339, 53107, 12147, 44915, 28531, 61299, 8051, 40819, 24435, + 57203, 16243, 49011, 32627, 65395, 243, 33011, 16627, 49395, 8435, 41203, + 24819, 57587, 4339, 37107, 20723, 53491, 12531, 45299, 28915, 61683, 2291, + 35059, 18675, 51443, 10483, 43251, 26867, 59635, 6387, 39155, 22771, 55539, + 14579, 47347, 30963, 63731, 1267, 34035, 17651, 50419, 9459, 42227, 25843, + 58611, 5363, 38131, 21747, 54515, 13555, 46323, 29939, 62707, 3315, 36083, + 19699, 52467, 11507, 44275, 27891, 60659, 7411, 40179, 23795, 56563, 15603, + 48371, 31987, 64755, 755, 33523, 17139, 49907, 8947, 41715, 25331, 58099, + 4851, 37619, 21235, 54003, 13043, 45811, 29427, 62195, 2803, 35571, 19187, + 51955, 10995, 43763, 27379, 60147, 6899, 39667, 23283, 56051, 15091, 47859, + 31475, 64243, 1779, 34547, 18163, 50931, 9971, 42739, 26355, 59123, 5875, + 38643, 22259, 55027, 14067, 46835, 30451, 63219, 3827, 36595, 20211, 52979, + 12019, 44787, 28403, 61171, 7923, 40691, 24307, 57075, 16115, 48883, 32499, + 65267, 499, 33267, 16883, 49651, 8691, 41459, 25075, 57843, 4595, 37363, + 20979, 53747, 12787, 45555, 29171, 61939, 2547, 35315, 18931, 51699, 10739, + 43507, 27123, 59891, 6643, 39411, 23027, 55795, 14835, 47603, 31219, 63987, + 1523, 34291, 17907, 50675, 9715, 42483, 26099, 58867, 5619, 38387, 22003, + 54771, 13811, 46579, 30195, 62963, 3571, 36339, 19955, 52723, 11763, 44531, + 28147, 60915, 7667, 40435, 24051, 56819, 15859, 48627, 32243, 65011, 1011, + 33779, 17395, 50163, 9203, 41971, 25587, 58355, 5107, 37875, 21491, 54259, + 13299, 46067, 29683, 62451, 3059, 35827, 19443, 52211, 11251, 44019, 27635, + 60403, 7155, 39923, 23539, 56307, 15347, 48115, 31731, 64499, 2035, 34803, + 18419, 51187, 10227, 42995, 26611, 59379, 6131, 38899, 22515, 55283, 14323, + 47091, 30707, 63475, 4083, 36851, 20467, 53235, 12275, 45043, 28659, 61427, + 8179, 40947, 24563, 57331, 16371, 49139, 32755, 65523, 11, 32779, 16395, + 49163, 8203, 40971, 24587, 57355, 4107, 36875, 20491, 53259, 12299, 45067, + 28683, 61451, 2059, 34827, 18443, 51211, 10251, 43019, 26635, 59403, 6155, + 38923, 22539, 55307, 14347, 47115, 30731, 63499, 1035, 33803, 17419, 50187, + 9227, 41995, 25611, 58379, 5131, 37899, 21515, 54283, 13323, 46091, 29707, + 62475, 3083, 35851, 19467, 52235, 11275, 44043, 27659, 60427, 7179, 39947, + 23563, 56331, 15371, 48139, 31755, 64523, 523, 33291, 16907, 49675, 8715, + 41483, 25099, 57867, 4619, 37387, 21003, 53771, 12811, 45579, 29195, 61963, + 2571, 35339, 18955, 51723, 10763, 43531, 27147, 59915, 6667, 39435, 23051, + 55819, 14859, 47627, 31243, 64011, 1547, 34315, 17931, 50699, 9739, 42507, + 26123, 58891, 5643, 38411, 22027, 54795, 13835, 46603, 30219, 62987, 3595, + 36363, 19979, 52747, 11787, 44555, 28171, 60939, 7691, 40459, 24075, 56843, + 15883, 48651, 32267, 65035, 267, 33035, 16651, 49419, 8459, 41227, 24843, + 57611, 4363, 37131, 20747, 53515, 12555, 45323, 28939, 61707, 2315, 35083, + 18699, 51467, 10507, 43275, 26891, 59659, 6411, 39179, 22795, 55563, 14603, + 47371, 30987, 63755, 1291, 34059, 17675, 50443, 9483, 42251, 25867, 58635, + 5387, 38155, 21771, 54539, 13579, 46347, 29963, 62731, 3339, 36107, 19723, + 52491, 11531, 44299, 27915, 60683, 7435, 40203, 23819, 56587, 15627, 48395, + 32011, 64779, 779, 33547, 17163, 49931, 8971, 41739, 25355, 58123, 4875, + 37643, 21259, 54027, 13067, 45835, 29451, 62219, 2827, 35595, 19211, 51979, + 11019, 43787, 27403, 60171, 6923, 39691, 23307, 56075, 15115, 47883, 31499, + 64267, 1803, 34571, 18187, 50955, 9995, 42763, 26379, 59147, 5899, 38667, + 22283, 55051, 14091, 46859, 30475, 63243, 3851, 36619, 20235, 53003, 12043, + 44811, 28427, 61195, 7947, 40715, 24331, 57099, 16139, 48907, 32523, 65291, + 139, 32907, 16523, 49291, 8331, 41099, 24715, 57483, 4235, 37003, 20619, + 53387, 12427, 45195, 28811, 61579, 2187, 34955, 18571, 51339, 10379, 43147, + 26763, 59531, 6283, 39051, 22667, 55435, 14475, 47243, 30859, 63627, 1163, + 33931, 17547, 50315, 9355, 42123, 25739, 58507, 5259, 38027, 21643, 54411, + 13451, 46219, 29835, 62603, 3211, 35979, 19595, 52363, 11403, 44171, 27787, + 60555, 7307, 40075, 23691, 56459, 15499, 48267, 31883, 64651, 651, 33419, + 17035, 49803, 8843, 41611, 25227, 57995, 4747, 37515, 21131, 53899, 12939, + 45707, 29323, 62091, 2699, 35467, 19083, 51851, 10891, 43659, 27275, 60043, + 6795, 39563, 23179, 55947, 14987, 47755, 31371, 64139, 1675, 34443, 18059, + 50827, 9867, 42635, 26251, 59019, 5771, 38539, 22155, 54923, 13963, 46731, + 30347, 63115, 3723, 36491, 20107, 52875, 11915, 44683, 28299, 61067, 7819, + 40587, 24203, 56971, 16011, 48779, 32395, 65163, 395, 33163, 16779, 49547, + 8587, 41355, 24971, 57739, 4491, 37259, 20875, 53643, 12683, 45451, 29067, + 61835, 2443, 35211, 18827, 51595, 10635, 43403, 27019, 59787, 6539, 39307, + 22923, 55691, 14731, 47499, 31115, 63883, 1419, 34187, 17803, 50571, 9611, + 42379, 25995, 58763, 5515, 38283, 21899, 54667, 13707, 46475, 30091, 62859, + 3467, 36235, 19851, 52619, 11659, 44427, 28043, 60811, 7563, 40331, 23947, + 56715, 15755, 48523, 32139, 64907, 907, 33675, 17291, 50059, 9099, 41867, + 25483, 58251, 5003, 37771, 21387, 54155, 13195, 45963, 29579, 62347, 2955, + 35723, 19339, 52107, 11147, 43915, 27531, 60299, 7051, 39819, 23435, 56203, + 15243, 48011, 31627, 64395, 1931, 34699, 18315, 51083, 10123, 42891, 26507, + 59275, 6027, 38795, 22411, 55179, 14219, 46987, 30603, 63371, 3979, 36747, + 20363, 53131, 12171, 44939, 28555, 61323, 8075, 40843, 24459, 57227, 16267, + 49035, 32651, 65419, 75, 32843, 16459, 49227, 8267, 41035, 24651, 57419, + 4171, 36939, 20555, 53323, 12363, 45131, 28747, 61515, 2123, 34891, 18507, + 51275, 10315, 43083, 26699, 59467, 6219, 38987, 22603, 55371, 14411, 47179, + 30795, 63563, 1099, 33867, 17483, 50251, 9291, 42059, 25675, 58443, 5195, + 37963, 21579, 54347, 13387, 46155, 29771, 62539, 3147, 35915, 19531, 52299, + 11339, 44107, 27723, 60491, 7243, 40011, 23627, 56395, 15435, 48203, 31819, + 64587, 587, 33355, 16971, 49739, 8779, 41547, 25163, 57931, 4683, 37451, + 21067, 53835, 12875, 45643, 29259, 62027, 2635, 35403, 19019, 51787, 10827, + 43595, 27211, 59979, 6731, 39499, 23115, 55883, 14923, 47691, 31307, 64075, + 1611, 34379, 17995, 50763, 9803, 42571, 26187, 58955, 5707, 38475, 22091, + 54859, 13899, 46667, 30283, 63051, 3659, 36427, 20043, 52811, 11851, 44619, + 28235, 61003, 7755, 40523, 24139, 56907, 15947, 48715, 32331, 65099, 331, + 33099, 16715, 49483, 8523, 41291, 24907, 57675, 4427, 37195, 20811, 53579, + 12619, 45387, 29003, 61771, 2379, 35147, 18763, 51531, 10571, 43339, 26955, + 59723, 6475, 39243, 22859, 55627, 14667, 47435, 31051, 63819, 1355, 34123, + 17739, 50507, 9547, 42315, 25931, 58699, 5451, 38219, 21835, 54603, 13643, + 46411, 30027, 62795, 3403, 36171, 19787, 52555, 11595, 44363, 27979, 60747, + 7499, 40267, 23883, 56651, 15691, 48459, 32075, 64843, 843, 33611, 17227, + 49995, 9035, 41803, 25419, 58187, 4939, 37707, 21323, 54091, 13131, 45899, + 29515, 62283, 2891, 35659, 19275, 52043, 11083, 43851, 27467, 60235, 6987, + 39755, 23371, 56139, 15179, 47947, 31563, 64331, 1867, 34635, 18251, 51019, + 10059, 42827, 26443, 59211, 5963, 38731, 22347, 55115, 14155, 46923, 30539, + 63307, 3915, 36683, 20299, 53067, 12107, 44875, 28491, 61259, 8011, 40779, + 24395, 57163, 16203, 48971, 32587, 65355, 203, 32971, 16587, 49355, 8395, + 41163, 24779, 57547, 4299, 37067, 20683, 53451, 12491, 45259, 28875, 61643, + 2251, 35019, 18635, 51403, 10443, 43211, 26827, 59595, 6347, 39115, 22731, + 55499, 14539, 47307, 30923, 63691, 1227, 33995, 17611, 50379, 9419, 42187, + 25803, 58571, 5323, 38091, 21707, 54475, 13515, 46283, 29899, 62667, 3275, + 36043, 19659, 52427, 11467, 44235, 27851, 60619, 7371, 40139, 23755, 56523, + 15563, 48331, 31947, 64715, 715, 33483, 17099, 49867, 8907, 41675, 25291, + 58059, 4811, 37579, 21195, 53963, 13003, 45771, 29387, 62155, 2763, 35531, + 19147, 51915, 10955, 43723, 27339, 60107, 6859, 39627, 23243, 56011, 15051, + 47819, 31435, 64203, 1739, 34507, 18123, 50891, 9931, 42699, 26315, 59083, + 5835, 38603, 22219, 54987, 14027, 46795, 30411, 63179, 3787, 36555, 20171, + 52939, 11979, 44747, 28363, 61131, 7883, 40651, 24267, 57035, 16075, 48843, + 32459, 65227, 459, 33227, 16843, 49611, 8651, 41419, 25035, 57803, 4555, + 37323, 20939, 53707, 12747, 45515, 29131, 61899, 2507, 35275, 18891, 51659, + 10699, 43467, 27083, 59851, 6603, 39371, 22987, 55755, 14795, 47563, 31179, + 63947, 1483, 34251, 17867, 50635, 9675, 42443, 26059, 58827, 5579, 38347, + 21963, 54731, 13771, 46539, 30155, 62923, 3531, 36299, 19915, 52683, 11723, + 44491, 28107, 60875, 7627, 40395, 24011, 56779, 15819, 48587, 32203, 64971, + 971, 33739, 17355, 50123, 9163, 41931, 25547, 58315, 5067, 37835, 21451, + 54219, 13259, 46027, 29643, 62411, 3019, 35787, 19403, 52171, 11211, 43979, + 27595, 60363, 7115, 39883, 23499, 56267, 15307, 48075, 31691, 64459, 1995, + 34763, 18379, 51147, 10187, 42955, 26571, 59339, 6091, 38859, 22475, 55243, + 14283, 47051, 30667, 63435, 4043, 36811, 20427, 53195, 12235, 45003, 28619, + 61387, 8139, 40907, 24523, 57291, 16331, 49099, 32715, 65483, 43, 32811, + 16427, 49195, 8235, 41003, 24619, 57387, 4139, 36907, 20523, 53291, 12331, + 45099, 28715, 61483, 2091, 34859, 18475, 51243, 10283, 43051, 26667, 59435, + 6187, 38955, 22571, 55339, 14379, 47147, 30763, 63531, 1067, 33835, 17451, + 50219, 9259, 42027, 25643, 58411, 5163, 37931, 21547, 54315, 13355, 46123, + 29739, 62507, 3115, 35883, 19499, 52267, 11307, 44075, 27691, 60459, 7211, + 39979, 23595, 56363, 15403, 48171, 31787, 64555, 555, 33323, 16939, 49707, + 8747, 41515, 25131, 57899, 4651, 37419, 21035, 53803, 12843, 45611, 29227, + 61995, 2603, 35371, 18987, 51755, 10795, 43563, 27179, 59947, 6699, 39467, + 23083, 55851, 14891, 47659, 31275, 64043, 1579, 34347, 17963, 50731, 9771, + 42539, 26155, 58923, 5675, 38443, 22059, 54827, 13867, 46635, 30251, 63019, + 3627, 36395, 20011, 52779, 11819, 44587, 28203, 60971, 7723, 40491, 24107, + 56875, 15915, 48683, 32299, 65067, 299, 33067, 16683, 49451, 8491, 41259, + 24875, 57643, 4395, 37163, 20779, 53547, 12587, 45355, 28971, 61739, 2347, + 35115, 18731, 51499, 10539, 43307, 26923, 59691, 6443, 39211, 22827, 55595, + 14635, 47403, 31019, 63787, 1323, 34091, 17707, 50475, 9515, 42283, 25899, + 58667, 5419, 38187, 21803, 54571, 13611, 46379, 29995, 62763, 3371, 36139, + 19755, 52523, 11563, 44331, 27947, 60715, 7467, 40235, 23851, 56619, 15659, + 48427, 32043, 64811, 811, 33579, 17195, 49963, 9003, 41771, 25387, 58155, + 4907, 37675, 21291, 54059, 13099, 45867, 29483, 62251, 2859, 35627, 19243, + 52011, 11051, 43819, 27435, 60203, 6955, 39723, 23339, 56107, 15147, 47915, + 31531, 64299, 1835, 34603, 18219, 50987, 10027, 42795, 26411, 59179, 5931, + 38699, 22315, 55083, 14123, 46891, 30507, 63275, 3883, 36651, 20267, 53035, + 12075, 44843, 28459, 61227, 7979, 40747, 24363, 57131, 16171, 48939, 32555, + 65323, 171, 32939, 16555, 49323, 8363, 41131, 24747, 57515, 4267, 37035, + 20651, 53419, 12459, 45227, 28843, 61611, 2219, 34987, 18603, 51371, 10411, + 43179, 26795, 59563, 6315, 39083, 22699, 55467, 14507, 47275, 30891, 63659, + 1195, 33963, 17579, 50347, 9387, 42155, 25771, 58539, 5291, 38059, 21675, + 54443, 13483, 46251, 29867, 62635, 3243, 36011, 19627, 52395, 11435, 44203, + 27819, 60587, 7339, 40107, 23723, 56491, 15531, 48299, 31915, 64683, 683, + 33451, 17067, 49835, 8875, 41643, 25259, 58027, 4779, 37547, 21163, 53931, + 12971, 45739, 29355, 62123, 2731, 35499, 19115, 51883, 10923, 43691, 27307, + 60075, 6827, 39595, 23211, 55979, 15019, 47787, 31403, 64171, 1707, 34475, + 18091, 50859, 9899, 42667, 26283, 59051, 5803, 38571, 22187, 54955, 13995, + 46763, 30379, 63147, 3755, 36523, 20139, 52907, 11947, 44715, 28331, 61099, + 7851, 40619, 24235, 57003, 16043, 48811, 32427, 65195, 427, 33195, 16811, + 49579, 8619, 41387, 25003, 57771, 4523, 37291, 20907, 53675, 12715, 45483, + 29099, 61867, 2475, 35243, 18859, 51627, 10667, 43435, 27051, 59819, 6571, + 39339, 22955, 55723, 14763, 47531, 31147, 63915, 1451, 34219, 17835, 50603, + 9643, 42411, 26027, 58795, 5547, 38315, 21931, 54699, 13739, 46507, 30123, + 62891, 3499, 36267, 19883, 52651, 11691, 44459, 28075, 60843, 7595, 40363, + 23979, 56747, 15787, 48555, 32171, 64939, 939, 33707, 17323, 50091, 9131, + 41899, 25515, 58283, 5035, 37803, 21419, 54187, 13227, 45995, 29611, 62379, + 2987, 35755, 19371, 52139, 11179, 43947, 27563, 60331, 7083, 39851, 23467, + 56235, 15275, 48043, 31659, 64427, 1963, 34731, 18347, 51115, 10155, 42923, + 26539, 59307, 6059, 38827, 22443, 55211, 14251, 47019, 30635, 63403, 4011, + 36779, 20395, 53163, 12203, 44971, 28587, 61355, 8107, 40875, 24491, 57259, + 16299, 49067, 32683, 65451, 107, 32875, 16491, 49259, 8299, 41067, 24683, + 57451, 4203, 36971, 20587, 53355, 12395, 45163, 28779, 61547, 2155, 34923, + 18539, 51307, 10347, 43115, 26731, 59499, 6251, 39019, 22635, 55403, 14443, + 47211, 30827, 63595, 1131, 33899, 17515, 50283, 9323, 42091, 25707, 58475, + 5227, 37995, 21611, 54379, 13419, 46187, 29803, 62571, 3179, 35947, 19563, + 52331, 11371, 44139, 27755, 60523, 7275, 40043, 23659, 56427, 15467, 48235, + 31851, 64619, 619, 33387, 17003, 49771, 8811, 41579, 25195, 57963, 4715, + 37483, 21099, 53867, 12907, 45675, 29291, 62059, 2667, 35435, 19051, 51819, + 10859, 43627, 27243, 60011, 6763, 39531, 23147, 55915, 14955, 47723, 31339, + 64107, 1643, 34411, 18027, 50795, 9835, 42603, 26219, 58987, 5739, 38507, + 22123, 54891, 13931, 46699, 30315, 63083, 3691, 36459, 20075, 52843, 11883, + 44651, 28267, 61035, 7787, 40555, 24171, 56939, 15979, 48747, 32363, 65131, + 363, 33131, 16747, 49515, 8555, 41323, 24939, 57707, 4459, 37227, 20843, + 53611, 12651, 45419, 29035, 61803, 2411, 35179, 18795, 51563, 10603, 43371, + 26987, 59755, 6507, 39275, 22891, 55659, 14699, 47467, 31083, 63851, 1387, + 34155, 17771, 50539, 9579, 42347, 25963, 58731, 5483, 38251, 21867, 54635, + 13675, 46443, 30059, 62827, 3435, 36203, 19819, 52587, 11627, 44395, 28011, + 60779, 7531, 40299, 23915, 56683, 15723, 48491, 32107, 64875, 875, 33643, + 17259, 50027, 9067, 41835, 25451, 58219, 4971, 37739, 21355, 54123, 13163, + 45931, 29547, 62315, 2923, 35691, 19307, 52075, 11115, 43883, 27499, 60267, + 7019, 39787, 23403, 56171, 15211, 47979, 31595, 64363, 1899, 34667, 18283, + 51051, 10091, 42859, 26475, 59243, 5995, 38763, 22379, 55147, 14187, 46955, + 30571, 63339, 3947, 36715, 20331, 53099, 12139, 44907, 28523, 61291, 8043, + 40811, 24427, 57195, 16235, 49003, 32619, 65387, 235, 33003, 16619, 49387, + 8427, 41195, 24811, 57579, 4331, 37099, 20715, 53483, 12523, 45291, 28907, + 61675, 2283, 35051, 18667, 51435, 10475, 43243, 26859, 59627, 6379, 39147, + 22763, 55531, 14571, 47339, 30955, 63723, 1259, 34027, 17643, 50411, 9451, + 42219, 25835, 58603, 5355, 38123, 21739, 54507, 13547, 46315, 29931, 62699, + 3307, 36075, 19691, 52459, 11499, 44267, 27883, 60651, 7403, 40171, 23787, + 56555, 15595, 48363, 31979, 64747, 747, 33515, 17131, 49899, 8939, 41707, + 25323, 58091, 4843, 37611, 21227, 53995, 13035, 45803, 29419, 62187, 2795, + 35563, 19179, 51947, 10987, 43755, 27371, 60139, 6891, 39659, 23275, 56043, + 15083, 47851, 31467, 64235, 1771, 34539, 18155, 50923, 9963, 42731, 26347, + 59115, 5867, 38635, 22251, 55019, 14059, 46827, 30443, 63211, 3819, 36587, + 20203, 52971, 12011, 44779, 28395, 61163, 7915, 40683, 24299, 57067, 16107, + 48875, 32491, 65259, 491, 33259, 16875, 49643, 8683, 41451, 25067, 57835, + 4587, 37355, 20971, 53739, 12779, 45547, 29163, 61931, 2539, 35307, 18923, + 51691, 10731, 43499, 27115, 59883, 6635, 39403, 23019, 55787, 14827, 47595, + 31211, 63979, 1515, 34283, 17899, 50667, 9707, 42475, 26091, 58859, 5611, + 38379, 21995, 54763, 13803, 46571, 30187, 62955, 3563, 36331, 19947, 52715, + 11755, 44523, 28139, 60907, 7659, 40427, 24043, 56811, 15851, 48619, 32235, + 65003, 1003, 33771, 17387, 50155, 9195, 41963, 25579, 58347, 5099, 37867, + 21483, 54251, 13291, 46059, 29675, 62443, 3051, 35819, 19435, 52203, 11243, + 44011, 27627, 60395, 7147, 39915, 23531, 56299, 15339, 48107, 31723, 64491, + 2027, 34795, 18411, 51179, 10219, 42987, 26603, 59371, 6123, 38891, 22507, + 55275, 14315, 47083, 30699, 63467, 4075, 36843, 20459, 53227, 12267, 45035, + 28651, 61419, 8171, 40939, 24555, 57323, 16363, 49131, 32747, 65515, 27, + 32795, 16411, 49179, 8219, 40987, 24603, 57371, 4123, 36891, 20507, 53275, + 12315, 45083, 28699, 61467, 2075, 34843, 18459, 51227, 10267, 43035, 26651, + 59419, 6171, 38939, 22555, 55323, 14363, 47131, 30747, 63515, 1051, 33819, + 17435, 50203, 9243, 42011, 25627, 58395, 5147, 37915, 21531, 54299, 13339, + 46107, 29723, 62491, 3099, 35867, 19483, 52251, 11291, 44059, 27675, 60443, + 7195, 39963, 23579, 56347, 15387, 48155, 31771, 64539, 539, 33307, 16923, + 49691, 8731, 41499, 25115, 57883, 4635, 37403, 21019, 53787, 12827, 45595, + 29211, 61979, 2587, 35355, 18971, 51739, 10779, 43547, 27163, 59931, 6683, + 39451, 23067, 55835, 14875, 47643, 31259, 64027, 1563, 34331, 17947, 50715, + 9755, 42523, 26139, 58907, 5659, 38427, 22043, 54811, 13851, 46619, 30235, + 63003, 3611, 36379, 19995, 52763, 11803, 44571, 28187, 60955, 7707, 40475, + 24091, 56859, 15899, 48667, 32283, 65051, 283, 33051, 16667, 49435, 8475, + 41243, 24859, 57627, 4379, 37147, 20763, 53531, 12571, 45339, 28955, 61723, + 2331, 35099, 18715, 51483, 10523, 43291, 26907, 59675, 6427, 39195, 22811, + 55579, 14619, 47387, 31003, 63771, 1307, 34075, 17691, 50459, 9499, 42267, + 25883, 58651, 5403, 38171, 21787, 54555, 13595, 46363, 29979, 62747, 3355, + 36123, 19739, 52507, 11547, 44315, 27931, 60699, 7451, 40219, 23835, 56603, + 15643, 48411, 32027, 64795, 795, 33563, 17179, 49947, 8987, 41755, 25371, + 58139, 4891, 37659, 21275, 54043, 13083, 45851, 29467, 62235, 2843, 35611, + 19227, 51995, 11035, 43803, 27419, 60187, 6939, 39707, 23323, 56091, 15131, + 47899, 31515, 64283, 1819, 34587, 18203, 50971, 10011, 42779, 26395, 59163, + 5915, 38683, 22299, 55067, 14107, 46875, 30491, 63259, 3867, 36635, 20251, + 53019, 12059, 44827, 28443, 61211, 7963, 40731, 24347, 57115, 16155, 48923, + 32539, 65307, 155, 32923, 16539, 49307, 8347, 41115, 24731, 57499, 4251, + 37019, 20635, 53403, 12443, 45211, 28827, 61595, 2203, 34971, 18587, 51355, + 10395, 43163, 26779, 59547, 6299, 39067, 22683, 55451, 14491, 47259, 30875, + 63643, 1179, 33947, 17563, 50331, 9371, 42139, 25755, 58523, 5275, 38043, + 21659, 54427, 13467, 46235, 29851, 62619, 3227, 35995, 19611, 52379, 11419, + 44187, 27803, 60571, 7323, 40091, 23707, 56475, 15515, 48283, 31899, 64667, + 667, 33435, 17051, 49819, 8859, 41627, 25243, 58011, 4763, 37531, 21147, + 53915, 12955, 45723, 29339, 62107, 2715, 35483, 19099, 51867, 10907, 43675, + 27291, 60059, 6811, 39579, 23195, 55963, 15003, 47771, 31387, 64155, 1691, + 34459, 18075, 50843, 9883, 42651, 26267, 59035, 5787, 38555, 22171, 54939, + 13979, 46747, 30363, 63131, 3739, 36507, 20123, 52891, 11931, 44699, 28315, + 61083, 7835, 40603, 24219, 56987, 16027, 48795, 32411, 65179, 411, 33179, + 16795, 49563, 8603, 41371, 24987, 57755, 4507, 37275, 20891, 53659, 12699, + 45467, 29083, 61851, 2459, 35227, 18843, 51611, 10651, 43419, 27035, 59803, + 6555, 39323, 22939, 55707, 14747, 47515, 31131, 63899, 1435, 34203, 17819, + 50587, 9627, 42395, 26011, 58779, 5531, 38299, 21915, 54683, 13723, 46491, + 30107, 62875, 3483, 36251, 19867, 52635, 11675, 44443, 28059, 60827, 7579, + 40347, 23963, 56731, 15771, 48539, 32155, 64923, 923, 33691, 17307, 50075, + 9115, 41883, 25499, 58267, 5019, 37787, 21403, 54171, 13211, 45979, 29595, + 62363, 2971, 35739, 19355, 52123, 11163, 43931, 27547, 60315, 7067, 39835, + 23451, 56219, 15259, 48027, 31643, 64411, 1947, 34715, 18331, 51099, 10139, + 42907, 26523, 59291, 6043, 38811, 22427, 55195, 14235, 47003, 30619, 63387, + 3995, 36763, 20379, 53147, 12187, 44955, 28571, 61339, 8091, 40859, 24475, + 57243, 16283, 49051, 32667, 65435, 91, 32859, 16475, 49243, 8283, 41051, + 24667, 57435, 4187, 36955, 20571, 53339, 12379, 45147, 28763, 61531, 2139, + 34907, 18523, 51291, 10331, 43099, 26715, 59483, 6235, 39003, 22619, 55387, + 14427, 47195, 30811, 63579, 1115, 33883, 17499, 50267, 9307, 42075, 25691, + 58459, 5211, 37979, 21595, 54363, 13403, 46171, 29787, 62555, 3163, 35931, + 19547, 52315, 11355, 44123, 27739, 60507, 7259, 40027, 23643, 56411, 15451, + 48219, 31835, 64603, 603, 33371, 16987, 49755, 8795, 41563, 25179, 57947, + 4699, 37467, 21083, 53851, 12891, 45659, 29275, 62043, 2651, 35419, 19035, + 51803, 10843, 43611, 27227, 59995, 6747, 39515, 23131, 55899, 14939, 47707, + 31323, 64091, 1627, 34395, 18011, 50779, 9819, 42587, 26203, 58971, 5723, + 38491, 22107, 54875, 13915, 46683, 30299, 63067, 3675, 36443, 20059, 52827, + 11867, 44635, 28251, 61019, 7771, 40539, 24155, 56923, 15963, 48731, 32347, + 65115, 347, 33115, 16731, 49499, 8539, 41307, 24923, 57691, 4443, 37211, + 20827, 53595, 12635, 45403, 29019, 61787, 2395, 35163, 18779, 51547, 10587, + 43355, 26971, 59739, 6491, 39259, 22875, 55643, 14683, 47451, 31067, 63835, + 1371, 34139, 17755, 50523, 9563, 42331, 25947, 58715, 5467, 38235, 21851, + 54619, 13659, 46427, 30043, 62811, 3419, 36187, 19803, 52571, 11611, 44379, + 27995, 60763, 7515, 40283, 23899, 56667, 15707, 48475, 32091, 64859, 859, + 33627, 17243, 50011, 9051, 41819, 25435, 58203, 4955, 37723, 21339, 54107, + 13147, 45915, 29531, 62299, 2907, 35675, 19291, 52059, 11099, 43867, 27483, + 60251, 7003, 39771, 23387, 56155, 15195, 47963, 31579, 64347, 1883, 34651, + 18267, 51035, 10075, 42843, 26459, 59227, 5979, 38747, 22363, 55131, 14171, + 46939, 30555, 63323, 3931, 36699, 20315, 53083, 12123, 44891, 28507, 61275, + 8027, 40795, 24411, 57179, 16219, 48987, 32603, 65371, 219, 32987, 16603, + 49371, 8411, 41179, 24795, 57563, 4315, 37083, 20699, 53467, 12507, 45275, + 28891, 61659, 2267, 35035, 18651, 51419, 10459, 43227, 26843, 59611, 6363, + 39131, 22747, 55515, 14555, 47323, 30939, 63707, 1243, 34011, 17627, 50395, + 9435, 42203, 25819, 58587, 5339, 38107, 21723, 54491, 13531, 46299, 29915, + 62683, 3291, 36059, 19675, 52443, 11483, 44251, 27867, 60635, 7387, 40155, + 23771, 56539, 15579, 48347, 31963, 64731, 731, 33499, 17115, 49883, 8923, + 41691, 25307, 58075, 4827, 37595, 21211, 53979, 13019, 45787, 29403, 62171, + 2779, 35547, 19163, 51931, 10971, 43739, 27355, 60123, 6875, 39643, 23259, + 56027, 15067, 47835, 31451, 64219, 1755, 34523, 18139, 50907, 9947, 42715, + 26331, 59099, 5851, 38619, 22235, 55003, 14043, 46811, 30427, 63195, 3803, + 36571, 20187, 52955, 11995, 44763, 28379, 61147, 7899, 40667, 24283, 57051, + 16091, 48859, 32475, 65243, 475, 33243, 16859, 49627, 8667, 41435, 25051, + 57819, 4571, 37339, 20955, 53723, 12763, 45531, 29147, 61915, 2523, 35291, + 18907, 51675, 10715, 43483, 27099, 59867, 6619, 39387, 23003, 55771, 14811, + 47579, 31195, 63963, 1499, 34267, 17883, 50651, 9691, 42459, 26075, 58843, + 5595, 38363, 21979, 54747, 13787, 46555, 30171, 62939, 3547, 36315, 19931, + 52699, 11739, 44507, 28123, 60891, 7643, 40411, 24027, 56795, 15835, 48603, + 32219, 64987, 987, 33755, 17371, 50139, 9179, 41947, 25563, 58331, 5083, + 37851, 21467, 54235, 13275, 46043, 29659, 62427, 3035, 35803, 19419, 52187, + 11227, 43995, 27611, 60379, 7131, 39899, 23515, 56283, 15323, 48091, 31707, + 64475, 2011, 34779, 18395, 51163, 10203, 42971, 26587, 59355, 6107, 38875, + 22491, 55259, 14299, 47067, 30683, 63451, 4059, 36827, 20443, 53211, 12251, + 45019, 28635, 61403, 8155, 40923, 24539, 57307, 16347, 49115, 32731, 65499, + 59, 32827, 16443, 49211, 8251, 41019, 24635, 57403, 4155, 36923, 20539, + 53307, 12347, 45115, 28731, 61499, 2107, 34875, 18491, 51259, 10299, 43067, + 26683, 59451, 6203, 38971, 22587, 55355, 14395, 47163, 30779, 63547, 1083, + 33851, 17467, 50235, 9275, 42043, 25659, 58427, 5179, 37947, 21563, 54331, + 13371, 46139, 29755, 62523, 3131, 35899, 19515, 52283, 11323, 44091, 27707, + 60475, 7227, 39995, 23611, 56379, 15419, 48187, 31803, 64571, 571, 33339, + 16955, 49723, 8763, 41531, 25147, 57915, 4667, 37435, 21051, 53819, 12859, + 45627, 29243, 62011, 2619, 35387, 19003, 51771, 10811, 43579, 27195, 59963, + 6715, 39483, 23099, 55867, 14907, 47675, 31291, 64059, 1595, 34363, 17979, + 50747, 9787, 42555, 26171, 58939, 5691, 38459, 22075, 54843, 13883, 46651, + 30267, 63035, 3643, 36411, 20027, 52795, 11835, 44603, 28219, 60987, 7739, + 40507, 24123, 56891, 15931, 48699, 32315, 65083, 315, 33083, 16699, 49467, + 8507, 41275, 24891, 57659, 4411, 37179, 20795, 53563, 12603, 45371, 28987, + 61755, 2363, 35131, 18747, 51515, 10555, 43323, 26939, 59707, 6459, 39227, + 22843, 55611, 14651, 47419, 31035, 63803, 1339, 34107, 17723, 50491, 9531, + 42299, 25915, 58683, 5435, 38203, 21819, 54587, 13627, 46395, 30011, 62779, + 3387, 36155, 19771, 52539, 11579, 44347, 27963, 60731, 7483, 40251, 23867, + 56635, 15675, 48443, 32059, 64827, 827, 33595, 17211, 49979, 9019, 41787, + 25403, 58171, 4923, 37691, 21307, 54075, 13115, 45883, 29499, 62267, 2875, + 35643, 19259, 52027, 11067, 43835, 27451, 60219, 6971, 39739, 23355, 56123, + 15163, 47931, 31547, 64315, 1851, 34619, 18235, 51003, 10043, 42811, 26427, + 59195, 5947, 38715, 22331, 55099, 14139, 46907, 30523, 63291, 3899, 36667, + 20283, 53051, 12091, 44859, 28475, 61243, 7995, 40763, 24379, 57147, 16187, + 48955, 32571, 65339, 187, 32955, 16571, 49339, 8379, 41147, 24763, 57531, + 4283, 37051, 20667, 53435, 12475, 45243, 28859, 61627, 2235, 35003, 18619, + 51387, 10427, 43195, 26811, 59579, 6331, 39099, 22715, 55483, 14523, 47291, + 30907, 63675, 1211, 33979, 17595, 50363, 9403, 42171, 25787, 58555, 5307, + 38075, 21691, 54459, 13499, 46267, 29883, 62651, 3259, 36027, 19643, 52411, + 11451, 44219, 27835, 60603, 7355, 40123, 23739, 56507, 15547, 48315, 31931, + 64699, 699, 33467, 17083, 49851, 8891, 41659, 25275, 58043, 4795, 37563, + 21179, 53947, 12987, 45755, 29371, 62139, 2747, 35515, 19131, 51899, 10939, + 43707, 27323, 60091, 6843, 39611, 23227, 55995, 15035, 47803, 31419, 64187, + 1723, 34491, 18107, 50875, 9915, 42683, 26299, 59067, 5819, 38587, 22203, + 54971, 14011, 46779, 30395, 63163, 3771, 36539, 20155, 52923, 11963, 44731, + 28347, 61115, 7867, 40635, 24251, 57019, 16059, 48827, 32443, 65211, 443, + 33211, 16827, 49595, 8635, 41403, 25019, 57787, 4539, 37307, 20923, 53691, + 12731, 45499, 29115, 61883, 2491, 35259, 18875, 51643, 10683, 43451, 27067, + 59835, 6587, 39355, 22971, 55739, 14779, 47547, 31163, 63931, 1467, 34235, + 17851, 50619, 9659, 42427, 26043, 58811, 5563, 38331, 21947, 54715, 13755, + 46523, 30139, 62907, 3515, 36283, 19899, 52667, 11707, 44475, 28091, 60859, + 7611, 40379, 23995, 56763, 15803, 48571, 32187, 64955, 955, 33723, 17339, + 50107, 9147, 41915, 25531, 58299, 5051, 37819, 21435, 54203, 13243, 46011, + 29627, 62395, 3003, 35771, 19387, 52155, 11195, 43963, 27579, 60347, 7099, + 39867, 23483, 56251, 15291, 48059, 31675, 64443, 1979, 34747, 18363, 51131, + 10171, 42939, 26555, 59323, 6075, 38843, 22459, 55227, 14267, 47035, 30651, + 63419, 4027, 36795, 20411, 53179, 12219, 44987, 28603, 61371, 8123, 40891, + 24507, 57275, 16315, 49083, 32699, 65467, 123, 32891, 16507, 49275, 8315, + 41083, 24699, 57467, 4219, 36987, 20603, 53371, 12411, 45179, 28795, 61563, + 2171, 34939, 18555, 51323, 10363, 43131, 26747, 59515, 6267, 39035, 22651, + 55419, 14459, 47227, 30843, 63611, 1147, 33915, 17531, 50299, 9339, 42107, + 25723, 58491, 5243, 38011, 21627, 54395, 13435, 46203, 29819, 62587, 3195, + 35963, 19579, 52347, 11387, 44155, 27771, 60539, 7291, 40059, 23675, 56443, + 15483, 48251, 31867, 64635, 635, 33403, 17019, 49787, 8827, 41595, 25211, + 57979, 4731, 37499, 21115, 53883, 12923, 45691, 29307, 62075, 2683, 35451, + 19067, 51835, 10875, 43643, 27259, 60027, 6779, 39547, 23163, 55931, 14971, + 47739, 31355, 64123, 1659, 34427, 18043, 50811, 9851, 42619, 26235, 59003, + 5755, 38523, 22139, 54907, 13947, 46715, 30331, 63099, 3707, 36475, 20091, + 52859, 11899, 44667, 28283, 61051, 7803, 40571, 24187, 56955, 15995, 48763, + 32379, 65147, 379, 33147, 16763, 49531, 8571, 41339, 24955, 57723, 4475, + 37243, 20859, 53627, 12667, 45435, 29051, 61819, 2427, 35195, 18811, 51579, + 10619, 43387, 27003, 59771, 6523, 39291, 22907, 55675, 14715, 47483, 31099, + 63867, 1403, 34171, 17787, 50555, 9595, 42363, 25979, 58747, 5499, 38267, + 21883, 54651, 13691, 46459, 30075, 62843, 3451, 36219, 19835, 52603, 11643, + 44411, 28027, 60795, 7547, 40315, 23931, 56699, 15739, 48507, 32123, 64891, + 891, 33659, 17275, 50043, 9083, 41851, 25467, 58235, 4987, 37755, 21371, + 54139, 13179, 45947, 29563, 62331, 2939, 35707, 19323, 52091, 11131, 43899, + 27515, 60283, 7035, 39803, 23419, 56187, 15227, 47995, 31611, 64379, 1915, + 34683, 18299, 51067, 10107, 42875, 26491, 59259, 6011, 38779, 22395, 55163, + 14203, 46971, 30587, 63355, 3963, 36731, 20347, 53115, 12155, 44923, 28539, + 61307, 8059, 40827, 24443, 57211, 16251, 49019, 32635, 65403, 251, 33019, + 16635, 49403, 8443, 41211, 24827, 57595, 4347, 37115, 20731, 53499, 12539, + 45307, 28923, 61691, 2299, 35067, 18683, 51451, 10491, 43259, 26875, 59643, + 6395, 39163, 22779, 55547, 14587, 47355, 30971, 63739, 1275, 34043, 17659, + 50427, 9467, 42235, 25851, 58619, 5371, 38139, 21755, 54523, 13563, 46331, + 29947, 62715, 3323, 36091, 19707, 52475, 11515, 44283, 27899, 60667, 7419, + 40187, 23803, 56571, 15611, 48379, 31995, 64763, 763, 33531, 17147, 49915, + 8955, 41723, 25339, 58107, 4859, 37627, 21243, 54011, 13051, 45819, 29435, + 62203, 2811, 35579, 19195, 51963, 11003, 43771, 27387, 60155, 6907, 39675, + 23291, 56059, 15099, 47867, 31483, 64251, 1787, 34555, 18171, 50939, 9979, + 42747, 26363, 59131, 5883, 38651, 22267, 55035, 14075, 46843, 30459, 63227, + 3835, 36603, 20219, 52987, 12027, 44795, 28411, 61179, 7931, 40699, 24315, + 57083, 16123, 48891, 32507, 65275, 507, 33275, 16891, 49659, 8699, 41467, + 25083, 57851, 4603, 37371, 20987, 53755, 12795, 45563, 29179, 61947, 2555, + 35323, 18939, 51707, 10747, 43515, 27131, 59899, 6651, 39419, 23035, 55803, + 14843, 47611, 31227, 63995, 1531, 34299, 17915, 50683, 9723, 42491, 26107, + 58875, 5627, 38395, 22011, 54779, 13819, 46587, 30203, 62971, 3579, 36347, + 19963, 52731, 11771, 44539, 28155, 60923, 7675, 40443, 24059, 56827, 15867, + 48635, 32251, 65019, 1019, 33787, 17403, 50171, 9211, 41979, 25595, 58363, + 5115, 37883, 21499, 54267, 13307, 46075, 29691, 62459, 3067, 35835, 19451, + 52219, 11259, 44027, 27643, 60411, 7163, 39931, 23547, 56315, 15355, 48123, + 31739, 64507, 2043, 34811, 18427, 51195, 10235, 43003, 26619, 59387, 6139, + 38907, 22523, 55291, 14331, 47099, 30715, 63483, 4091, 36859, 20475, 53243, + 12283, 45051, 28667, 61435, 8187, 40955, 24571, 57339, 16379, 49147, 32763, + 65531, 7, 32775, 16391, 49159, 8199, 40967, 24583, 57351, 4103, 36871, + 20487, 53255, 12295, 45063, 28679, 61447, 2055, 34823, 18439, 51207, 10247, + 43015, 26631, 59399, 6151, 38919, 22535, 55303, 14343, 47111, 30727, 63495, + 1031, 33799, 17415, 50183, 9223, 41991, 25607, 58375, 5127, 37895, 21511, + 54279, 13319, 46087, 29703, 62471, 3079, 35847, 19463, 52231, 11271, 44039, + 27655, 60423, 7175, 39943, 23559, 56327, 15367, 48135, 31751, 64519, 519, + 33287, 16903, 49671, 8711, 41479, 25095, 57863, 4615, 37383, 20999, 53767, + 12807, 45575, 29191, 61959, 2567, 35335, 18951, 51719, 10759, 43527, 27143, + 59911, 6663, 39431, 23047, 55815, 14855, 47623, 31239, 64007, 1543, 34311, + 17927, 50695, 9735, 42503, 26119, 58887, 5639, 38407, 22023, 54791, 13831, + 46599, 30215, 62983, 3591, 36359, 19975, 52743, 11783, 44551, 28167, 60935, + 7687, 40455, 24071, 56839, 15879, 48647, 32263, 65031, 263, 33031, 16647, + 49415, 8455, 41223, 24839, 57607, 4359, 37127, 20743, 53511, 12551, 45319, + 28935, 61703, 2311, 35079, 18695, 51463, 10503, 43271, 26887, 59655, 6407, + 39175, 22791, 55559, 14599, 47367, 30983, 63751, 1287, 34055, 17671, 50439, + 9479, 42247, 25863, 58631, 5383, 38151, 21767, 54535, 13575, 46343, 29959, + 62727, 3335, 36103, 19719, 52487, 11527, 44295, 27911, 60679, 7431, 40199, + 23815, 56583, 15623, 48391, 32007, 64775, 775, 33543, 17159, 49927, 8967, + 41735, 25351, 58119, 4871, 37639, 21255, 54023, 13063, 45831, 29447, 62215, + 2823, 35591, 19207, 51975, 11015, 43783, 27399, 60167, 6919, 39687, 23303, + 56071, 15111, 47879, 31495, 64263, 1799, 34567, 18183, 50951, 9991, 42759, + 26375, 59143, 5895, 38663, 22279, 55047, 14087, 46855, 30471, 63239, 3847, + 36615, 20231, 52999, 12039, 44807, 28423, 61191, 7943, 40711, 24327, 57095, + 16135, 48903, 32519, 65287, 135, 32903, 16519, 49287, 8327, 41095, 24711, + 57479, 4231, 36999, 20615, 53383, 12423, 45191, 28807, 61575, 2183, 34951, + 18567, 51335, 10375, 43143, 26759, 59527, 6279, 39047, 22663, 55431, 14471, + 47239, 30855, 63623, 1159, 33927, 17543, 50311, 9351, 42119, 25735, 58503, + 5255, 38023, 21639, 54407, 13447, 46215, 29831, 62599, 3207, 35975, 19591, + 52359, 11399, 44167, 27783, 60551, 7303, 40071, 23687, 56455, 15495, 48263, + 31879, 64647, 647, 33415, 17031, 49799, 8839, 41607, 25223, 57991, 4743, + 37511, 21127, 53895, 12935, 45703, 29319, 62087, 2695, 35463, 19079, 51847, + 10887, 43655, 27271, 60039, 6791, 39559, 23175, 55943, 14983, 47751, 31367, + 64135, 1671, 34439, 18055, 50823, 9863, 42631, 26247, 59015, 5767, 38535, + 22151, 54919, 13959, 46727, 30343, 63111, 3719, 36487, 20103, 52871, 11911, + 44679, 28295, 61063, 7815, 40583, 24199, 56967, 16007, 48775, 32391, 65159, + 391, 33159, 16775, 49543, 8583, 41351, 24967, 57735, 4487, 37255, 20871, + 53639, 12679, 45447, 29063, 61831, 2439, 35207, 18823, 51591, 10631, 43399, + 27015, 59783, 6535, 39303, 22919, 55687, 14727, 47495, 31111, 63879, 1415, + 34183, 17799, 50567, 9607, 42375, 25991, 58759, 5511, 38279, 21895, 54663, + 13703, 46471, 30087, 62855, 3463, 36231, 19847, 52615, 11655, 44423, 28039, + 60807, 7559, 40327, 23943, 56711, 15751, 48519, 32135, 64903, 903, 33671, + 17287, 50055, 9095, 41863, 25479, 58247, 4999, 37767, 21383, 54151, 13191, + 45959, 29575, 62343, 2951, 35719, 19335, 52103, 11143, 43911, 27527, 60295, + 7047, 39815, 23431, 56199, 15239, 48007, 31623, 64391, 1927, 34695, 18311, + 51079, 10119, 42887, 26503, 59271, 6023, 38791, 22407, 55175, 14215, 46983, + 30599, 63367, 3975, 36743, 20359, 53127, 12167, 44935, 28551, 61319, 8071, + 40839, 24455, 57223, 16263, 49031, 32647, 65415, 71, 32839, 16455, 49223, + 8263, 41031, 24647, 57415, 4167, 36935, 20551, 53319, 12359, 45127, 28743, + 61511, 2119, 34887, 18503, 51271, 10311, 43079, 26695, 59463, 6215, 38983, + 22599, 55367, 14407, 47175, 30791, 63559, 1095, 33863, 17479, 50247, 9287, + 42055, 25671, 58439, 5191, 37959, 21575, 54343, 13383, 46151, 29767, 62535, + 3143, 35911, 19527, 52295, 11335, 44103, 27719, 60487, 7239, 40007, 23623, + 56391, 15431, 48199, 31815, 64583, 583, 33351, 16967, 49735, 8775, 41543, + 25159, 57927, 4679, 37447, 21063, 53831, 12871, 45639, 29255, 62023, 2631, + 35399, 19015, 51783, 10823, 43591, 27207, 59975, 6727, 39495, 23111, 55879, + 14919, 47687, 31303, 64071, 1607, 34375, 17991, 50759, 9799, 42567, 26183, + 58951, 5703, 38471, 22087, 54855, 13895, 46663, 30279, 63047, 3655, 36423, + 20039, 52807, 11847, 44615, 28231, 60999, 7751, 40519, 24135, 56903, 15943, + 48711, 32327, 65095, 327, 33095, 16711, 49479, 8519, 41287, 24903, 57671, + 4423, 37191, 20807, 53575, 12615, 45383, 28999, 61767, 2375, 35143, 18759, + 51527, 10567, 43335, 26951, 59719, 6471, 39239, 22855, 55623, 14663, 47431, + 31047, 63815, 1351, 34119, 17735, 50503, 9543, 42311, 25927, 58695, 5447, + 38215, 21831, 54599, 13639, 46407, 30023, 62791, 3399, 36167, 19783, 52551, + 11591, 44359, 27975, 60743, 7495, 40263, 23879, 56647, 15687, 48455, 32071, + 64839, 839, 33607, 17223, 49991, 9031, 41799, 25415, 58183, 4935, 37703, + 21319, 54087, 13127, 45895, 29511, 62279, 2887, 35655, 19271, 52039, 11079, + 43847, 27463, 60231, 6983, 39751, 23367, 56135, 15175, 47943, 31559, 64327, + 1863, 34631, 18247, 51015, 10055, 42823, 26439, 59207, 5959, 38727, 22343, + 55111, 14151, 46919, 30535, 63303, 3911, 36679, 20295, 53063, 12103, 44871, + 28487, 61255, 8007, 40775, 24391, 57159, 16199, 48967, 32583, 65351, 199, + 32967, 16583, 49351, 8391, 41159, 24775, 57543, 4295, 37063, 20679, 53447, + 12487, 45255, 28871, 61639, 2247, 35015, 18631, 51399, 10439, 43207, 26823, + 59591, 6343, 39111, 22727, 55495, 14535, 47303, 30919, 63687, 1223, 33991, + 17607, 50375, 9415, 42183, 25799, 58567, 5319, 38087, 21703, 54471, 13511, + 46279, 29895, 62663, 3271, 36039, 19655, 52423, 11463, 44231, 27847, 60615, + 7367, 40135, 23751, 56519, 15559, 48327, 31943, 64711, 711, 33479, 17095, + 49863, 8903, 41671, 25287, 58055, 4807, 37575, 21191, 53959, 12999, 45767, + 29383, 62151, 2759, 35527, 19143, 51911, 10951, 43719, 27335, 60103, 6855, + 39623, 23239, 56007, 15047, 47815, 31431, 64199, 1735, 34503, 18119, 50887, + 9927, 42695, 26311, 59079, 5831, 38599, 22215, 54983, 14023, 46791, 30407, + 63175, 3783, 36551, 20167, 52935, 11975, 44743, 28359, 61127, 7879, 40647, + 24263, 57031, 16071, 48839, 32455, 65223, 455, 33223, 16839, 49607, 8647, + 41415, 25031, 57799, 4551, 37319, 20935, 53703, 12743, 45511, 29127, 61895, + 2503, 35271, 18887, 51655, 10695, 43463, 27079, 59847, 6599, 39367, 22983, + 55751, 14791, 47559, 31175, 63943, 1479, 34247, 17863, 50631, 9671, 42439, + 26055, 58823, 5575, 38343, 21959, 54727, 13767, 46535, 30151, 62919, 3527, + 36295, 19911, 52679, 11719, 44487, 28103, 60871, 7623, 40391, 24007, 56775, + 15815, 48583, 32199, 64967, 967, 33735, 17351, 50119, 9159, 41927, 25543, + 58311, 5063, 37831, 21447, 54215, 13255, 46023, 29639, 62407, 3015, 35783, + 19399, 52167, 11207, 43975, 27591, 60359, 7111, 39879, 23495, 56263, 15303, + 48071, 31687, 64455, 1991, 34759, 18375, 51143, 10183, 42951, 26567, 59335, + 6087, 38855, 22471, 55239, 14279, 47047, 30663, 63431, 4039, 36807, 20423, + 53191, 12231, 44999, 28615, 61383, 8135, 40903, 24519, 57287, 16327, 49095, + 32711, 65479, 39, 32807, 16423, 49191, 8231, 40999, 24615, 57383, 4135, + 36903, 20519, 53287, 12327, 45095, 28711, 61479, 2087, 34855, 18471, 51239, + 10279, 43047, 26663, 59431, 6183, 38951, 22567, 55335, 14375, 47143, 30759, + 63527, 1063, 33831, 17447, 50215, 9255, 42023, 25639, 58407, 5159, 37927, + 21543, 54311, 13351, 46119, 29735, 62503, 3111, 35879, 19495, 52263, 11303, + 44071, 27687, 60455, 7207, 39975, 23591, 56359, 15399, 48167, 31783, 64551, + 551, 33319, 16935, 49703, 8743, 41511, 25127, 57895, 4647, 37415, 21031, + 53799, 12839, 45607, 29223, 61991, 2599, 35367, 18983, 51751, 10791, 43559, + 27175, 59943, 6695, 39463, 23079, 55847, 14887, 47655, 31271, 64039, 1575, + 34343, 17959, 50727, 9767, 42535, 26151, 58919, 5671, 38439, 22055, 54823, + 13863, 46631, 30247, 63015, 3623, 36391, 20007, 52775, 11815, 44583, 28199, + 60967, 7719, 40487, 24103, 56871, 15911, 48679, 32295, 65063, 295, 33063, + 16679, 49447, 8487, 41255, 24871, 57639, 4391, 37159, 20775, 53543, 12583, + 45351, 28967, 61735, 2343, 35111, 18727, 51495, 10535, 43303, 26919, 59687, + 6439, 39207, 22823, 55591, 14631, 47399, 31015, 63783, 1319, 34087, 17703, + 50471, 9511, 42279, 25895, 58663, 5415, 38183, 21799, 54567, 13607, 46375, + 29991, 62759, 3367, 36135, 19751, 52519, 11559, 44327, 27943, 60711, 7463, + 40231, 23847, 56615, 15655, 48423, 32039, 64807, 807, 33575, 17191, 49959, + 8999, 41767, 25383, 58151, 4903, 37671, 21287, 54055, 13095, 45863, 29479, + 62247, 2855, 35623, 19239, 52007, 11047, 43815, 27431, 60199, 6951, 39719, + 23335, 56103, 15143, 47911, 31527, 64295, 1831, 34599, 18215, 50983, 10023, + 42791, 26407, 59175, 5927, 38695, 22311, 55079, 14119, 46887, 30503, 63271, + 3879, 36647, 20263, 53031, 12071, 44839, 28455, 61223, 7975, 40743, 24359, + 57127, 16167, 48935, 32551, 65319, 167, 32935, 16551, 49319, 8359, 41127, + 24743, 57511, 4263, 37031, 20647, 53415, 12455, 45223, 28839, 61607, 2215, + 34983, 18599, 51367, 10407, 43175, 26791, 59559, 6311, 39079, 22695, 55463, + 14503, 47271, 30887, 63655, 1191, 33959, 17575, 50343, 9383, 42151, 25767, + 58535, 5287, 38055, 21671, 54439, 13479, 46247, 29863, 62631, 3239, 36007, + 19623, 52391, 11431, 44199, 27815, 60583, 7335, 40103, 23719, 56487, 15527, + 48295, 31911, 64679, 679, 33447, 17063, 49831, 8871, 41639, 25255, 58023, + 4775, 37543, 21159, 53927, 12967, 45735, 29351, 62119, 2727, 35495, 19111, + 51879, 10919, 43687, 27303, 60071, 6823, 39591, 23207, 55975, 15015, 47783, + 31399, 64167, 1703, 34471, 18087, 50855, 9895, 42663, 26279, 59047, 5799, + 38567, 22183, 54951, 13991, 46759, 30375, 63143, 3751, 36519, 20135, 52903, + 11943, 44711, 28327, 61095, 7847, 40615, 24231, 56999, 16039, 48807, 32423, + 65191, 423, 33191, 16807, 49575, 8615, 41383, 24999, 57767, 4519, 37287, + 20903, 53671, 12711, 45479, 29095, 61863, 2471, 35239, 18855, 51623, 10663, + 43431, 27047, 59815, 6567, 39335, 22951, 55719, 14759, 47527, 31143, 63911, + 1447, 34215, 17831, 50599, 9639, 42407, 26023, 58791, 5543, 38311, 21927, + 54695, 13735, 46503, 30119, 62887, 3495, 36263, 19879, 52647, 11687, 44455, + 28071, 60839, 7591, 40359, 23975, 56743, 15783, 48551, 32167, 64935, 935, + 33703, 17319, 50087, 9127, 41895, 25511, 58279, 5031, 37799, 21415, 54183, + 13223, 45991, 29607, 62375, 2983, 35751, 19367, 52135, 11175, 43943, 27559, + 60327, 7079, 39847, 23463, 56231, 15271, 48039, 31655, 64423, 1959, 34727, + 18343, 51111, 10151, 42919, 26535, 59303, 6055, 38823, 22439, 55207, 14247, + 47015, 30631, 63399, 4007, 36775, 20391, 53159, 12199, 44967, 28583, 61351, + 8103, 40871, 24487, 57255, 16295, 49063, 32679, 65447, 103, 32871, 16487, + 49255, 8295, 41063, 24679, 57447, 4199, 36967, 20583, 53351, 12391, 45159, + 28775, 61543, 2151, 34919, 18535, 51303, 10343, 43111, 26727, 59495, 6247, + 39015, 22631, 55399, 14439, 47207, 30823, 63591, 1127, 33895, 17511, 50279, + 9319, 42087, 25703, 58471, 5223, 37991, 21607, 54375, 13415, 46183, 29799, + 62567, 3175, 35943, 19559, 52327, 11367, 44135, 27751, 60519, 7271, 40039, + 23655, 56423, 15463, 48231, 31847, 64615, 615, 33383, 16999, 49767, 8807, + 41575, 25191, 57959, 4711, 37479, 21095, 53863, 12903, 45671, 29287, 62055, + 2663, 35431, 19047, 51815, 10855, 43623, 27239, 60007, 6759, 39527, 23143, + 55911, 14951, 47719, 31335, 64103, 1639, 34407, 18023, 50791, 9831, 42599, + 26215, 58983, 5735, 38503, 22119, 54887, 13927, 46695, 30311, 63079, 3687, + 36455, 20071, 52839, 11879, 44647, 28263, 61031, 7783, 40551, 24167, 56935, + 15975, 48743, 32359, 65127, 359, 33127, 16743, 49511, 8551, 41319, 24935, + 57703, 4455, 37223, 20839, 53607, 12647, 45415, 29031, 61799, 2407, 35175, + 18791, 51559, 10599, 43367, 26983, 59751, 6503, 39271, 22887, 55655, 14695, + 47463, 31079, 63847, 1383, 34151, 17767, 50535, 9575, 42343, 25959, 58727, + 5479, 38247, 21863, 54631, 13671, 46439, 30055, 62823, 3431, 36199, 19815, + 52583, 11623, 44391, 28007, 60775, 7527, 40295, 23911, 56679, 15719, 48487, + 32103, 64871, 871, 33639, 17255, 50023, 9063, 41831, 25447, 58215, 4967, + 37735, 21351, 54119, 13159, 45927, 29543, 62311, 2919, 35687, 19303, 52071, + 11111, 43879, 27495, 60263, 7015, 39783, 23399, 56167, 15207, 47975, 31591, + 64359, 1895, 34663, 18279, 51047, 10087, 42855, 26471, 59239, 5991, 38759, + 22375, 55143, 14183, 46951, 30567, 63335, 3943, 36711, 20327, 53095, 12135, + 44903, 28519, 61287, 8039, 40807, 24423, 57191, 16231, 48999, 32615, 65383, + 231, 32999, 16615, 49383, 8423, 41191, 24807, 57575, 4327, 37095, 20711, + 53479, 12519, 45287, 28903, 61671, 2279, 35047, 18663, 51431, 10471, 43239, + 26855, 59623, 6375, 39143, 22759, 55527, 14567, 47335, 30951, 63719, 1255, + 34023, 17639, 50407, 9447, 42215, 25831, 58599, 5351, 38119, 21735, 54503, + 13543, 46311, 29927, 62695, 3303, 36071, 19687, 52455, 11495, 44263, 27879, + 60647, 7399, 40167, 23783, 56551, 15591, 48359, 31975, 64743, 743, 33511, + 17127, 49895, 8935, 41703, 25319, 58087, 4839, 37607, 21223, 53991, 13031, + 45799, 29415, 62183, 2791, 35559, 19175, 51943, 10983, 43751, 27367, 60135, + 6887, 39655, 23271, 56039, 15079, 47847, 31463, 64231, 1767, 34535, 18151, + 50919, 9959, 42727, 26343, 59111, 5863, 38631, 22247, 55015, 14055, 46823, + 30439, 63207, 3815, 36583, 20199, 52967, 12007, 44775, 28391, 61159, 7911, + 40679, 24295, 57063, 16103, 48871, 32487, 65255, 487, 33255, 16871, 49639, + 8679, 41447, 25063, 57831, 4583, 37351, 20967, 53735, 12775, 45543, 29159, + 61927, 2535, 35303, 18919, 51687, 10727, 43495, 27111, 59879, 6631, 39399, + 23015, 55783, 14823, 47591, 31207, 63975, 1511, 34279, 17895, 50663, 9703, + 42471, 26087, 58855, 5607, 38375, 21991, 54759, 13799, 46567, 30183, 62951, + 3559, 36327, 19943, 52711, 11751, 44519, 28135, 60903, 7655, 40423, 24039, + 56807, 15847, 48615, 32231, 64999, 999, 33767, 17383, 50151, 9191, 41959, + 25575, 58343, 5095, 37863, 21479, 54247, 13287, 46055, 29671, 62439, 3047, + 35815, 19431, 52199, 11239, 44007, 27623, 60391, 7143, 39911, 23527, 56295, + 15335, 48103, 31719, 64487, 2023, 34791, 18407, 51175, 10215, 42983, 26599, + 59367, 6119, 38887, 22503, 55271, 14311, 47079, 30695, 63463, 4071, 36839, + 20455, 53223, 12263, 45031, 28647, 61415, 8167, 40935, 24551, 57319, 16359, + 49127, 32743, 65511, 23, 32791, 16407, 49175, 8215, 40983, 24599, 57367, + 4119, 36887, 20503, 53271, 12311, 45079, 28695, 61463, 2071, 34839, 18455, + 51223, 10263, 43031, 26647, 59415, 6167, 38935, 22551, 55319, 14359, 47127, + 30743, 63511, 1047, 33815, 17431, 50199, 9239, 42007, 25623, 58391, 5143, + 37911, 21527, 54295, 13335, 46103, 29719, 62487, 3095, 35863, 19479, 52247, + 11287, 44055, 27671, 60439, 7191, 39959, 23575, 56343, 15383, 48151, 31767, + 64535, 535, 33303, 16919, 49687, 8727, 41495, 25111, 57879, 4631, 37399, + 21015, 53783, 12823, 45591, 29207, 61975, 2583, 35351, 18967, 51735, 10775, + 43543, 27159, 59927, 6679, 39447, 23063, 55831, 14871, 47639, 31255, 64023, + 1559, 34327, 17943, 50711, 9751, 42519, 26135, 58903, 5655, 38423, 22039, + 54807, 13847, 46615, 30231, 62999, 3607, 36375, 19991, 52759, 11799, 44567, + 28183, 60951, 7703, 40471, 24087, 56855, 15895, 48663, 32279, 65047, 279, + 33047, 16663, 49431, 8471, 41239, 24855, 57623, 4375, 37143, 20759, 53527, + 12567, 45335, 28951, 61719, 2327, 35095, 18711, 51479, 10519, 43287, 26903, + 59671, 6423, 39191, 22807, 55575, 14615, 47383, 30999, 63767, 1303, 34071, + 17687, 50455, 9495, 42263, 25879, 58647, 5399, 38167, 21783, 54551, 13591, + 46359, 29975, 62743, 3351, 36119, 19735, 52503, 11543, 44311, 27927, 60695, + 7447, 40215, 23831, 56599, 15639, 48407, 32023, 64791, 791, 33559, 17175, + 49943, 8983, 41751, 25367, 58135, 4887, 37655, 21271, 54039, 13079, 45847, + 29463, 62231, 2839, 35607, 19223, 51991, 11031, 43799, 27415, 60183, 6935, + 39703, 23319, 56087, 15127, 47895, 31511, 64279, 1815, 34583, 18199, 50967, + 10007, 42775, 26391, 59159, 5911, 38679, 22295, 55063, 14103, 46871, 30487, + 63255, 3863, 36631, 20247, 53015, 12055, 44823, 28439, 61207, 7959, 40727, + 24343, 57111, 16151, 48919, 32535, 65303, 151, 32919, 16535, 49303, 8343, + 41111, 24727, 57495, 4247, 37015, 20631, 53399, 12439, 45207, 28823, 61591, + 2199, 34967, 18583, 51351, 10391, 43159, 26775, 59543, 6295, 39063, 22679, + 55447, 14487, 47255, 30871, 63639, 1175, 33943, 17559, 50327, 9367, 42135, + 25751, 58519, 5271, 38039, 21655, 54423, 13463, 46231, 29847, 62615, 3223, + 35991, 19607, 52375, 11415, 44183, 27799, 60567, 7319, 40087, 23703, 56471, + 15511, 48279, 31895, 64663, 663, 33431, 17047, 49815, 8855, 41623, 25239, + 58007, 4759, 37527, 21143, 53911, 12951, 45719, 29335, 62103, 2711, 35479, + 19095, 51863, 10903, 43671, 27287, 60055, 6807, 39575, 23191, 55959, 14999, + 47767, 31383, 64151, 1687, 34455, 18071, 50839, 9879, 42647, 26263, 59031, + 5783, 38551, 22167, 54935, 13975, 46743, 30359, 63127, 3735, 36503, 20119, + 52887, 11927, 44695, 28311, 61079, 7831, 40599, 24215, 56983, 16023, 48791, + 32407, 65175, 407, 33175, 16791, 49559, 8599, 41367, 24983, 57751, 4503, + 37271, 20887, 53655, 12695, 45463, 29079, 61847, 2455, 35223, 18839, 51607, + 10647, 43415, 27031, 59799, 6551, 39319, 22935, 55703, 14743, 47511, 31127, + 63895, 1431, 34199, 17815, 50583, 9623, 42391, 26007, 58775, 5527, 38295, + 21911, 54679, 13719, 46487, 30103, 62871, 3479, 36247, 19863, 52631, 11671, + 44439, 28055, 60823, 7575, 40343, 23959, 56727, 15767, 48535, 32151, 64919, + 919, 33687, 17303, 50071, 9111, 41879, 25495, 58263, 5015, 37783, 21399, + 54167, 13207, 45975, 29591, 62359, 2967, 35735, 19351, 52119, 11159, 43927, + 27543, 60311, 7063, 39831, 23447, 56215, 15255, 48023, 31639, 64407, 1943, + 34711, 18327, 51095, 10135, 42903, 26519, 59287, 6039, 38807, 22423, 55191, + 14231, 46999, 30615, 63383, 3991, 36759, 20375, 53143, 12183, 44951, 28567, + 61335, 8087, 40855, 24471, 57239, 16279, 49047, 32663, 65431, 87, 32855, + 16471, 49239, 8279, 41047, 24663, 57431, 4183, 36951, 20567, 53335, 12375, + 45143, 28759, 61527, 2135, 34903, 18519, 51287, 10327, 43095, 26711, 59479, + 6231, 38999, 22615, 55383, 14423, 47191, 30807, 63575, 1111, 33879, 17495, + 50263, 9303, 42071, 25687, 58455, 5207, 37975, 21591, 54359, 13399, 46167, + 29783, 62551, 3159, 35927, 19543, 52311, 11351, 44119, 27735, 60503, 7255, + 40023, 23639, 56407, 15447, 48215, 31831, 64599, 599, 33367, 16983, 49751, + 8791, 41559, 25175, 57943, 4695, 37463, 21079, 53847, 12887, 45655, 29271, + 62039, 2647, 35415, 19031, 51799, 10839, 43607, 27223, 59991, 6743, 39511, + 23127, 55895, 14935, 47703, 31319, 64087, 1623, 34391, 18007, 50775, 9815, + 42583, 26199, 58967, 5719, 38487, 22103, 54871, 13911, 46679, 30295, 63063, + 3671, 36439, 20055, 52823, 11863, 44631, 28247, 61015, 7767, 40535, 24151, + 56919, 15959, 48727, 32343, 65111, 343, 33111, 16727, 49495, 8535, 41303, + 24919, 57687, 4439, 37207, 20823, 53591, 12631, 45399, 29015, 61783, 2391, + 35159, 18775, 51543, 10583, 43351, 26967, 59735, 6487, 39255, 22871, 55639, + 14679, 47447, 31063, 63831, 1367, 34135, 17751, 50519, 9559, 42327, 25943, + 58711, 5463, 38231, 21847, 54615, 13655, 46423, 30039, 62807, 3415, 36183, + 19799, 52567, 11607, 44375, 27991, 60759, 7511, 40279, 23895, 56663, 15703, + 48471, 32087, 64855, 855, 33623, 17239, 50007, 9047, 41815, 25431, 58199, + 4951, 37719, 21335, 54103, 13143, 45911, 29527, 62295, 2903, 35671, 19287, + 52055, 11095, 43863, 27479, 60247, 6999, 39767, 23383, 56151, 15191, 47959, + 31575, 64343, 1879, 34647, 18263, 51031, 10071, 42839, 26455, 59223, 5975, + 38743, 22359, 55127, 14167, 46935, 30551, 63319, 3927, 36695, 20311, 53079, + 12119, 44887, 28503, 61271, 8023, 40791, 24407, 57175, 16215, 48983, 32599, + 65367, 215, 32983, 16599, 49367, 8407, 41175, 24791, 57559, 4311, 37079, + 20695, 53463, 12503, 45271, 28887, 61655, 2263, 35031, 18647, 51415, 10455, + 43223, 26839, 59607, 6359, 39127, 22743, 55511, 14551, 47319, 30935, 63703, + 1239, 34007, 17623, 50391, 9431, 42199, 25815, 58583, 5335, 38103, 21719, + 54487, 13527, 46295, 29911, 62679, 3287, 36055, 19671, 52439, 11479, 44247, + 27863, 60631, 7383, 40151, 23767, 56535, 15575, 48343, 31959, 64727, 727, + 33495, 17111, 49879, 8919, 41687, 25303, 58071, 4823, 37591, 21207, 53975, + 13015, 45783, 29399, 62167, 2775, 35543, 19159, 51927, 10967, 43735, 27351, + 60119, 6871, 39639, 23255, 56023, 15063, 47831, 31447, 64215, 1751, 34519, + 18135, 50903, 9943, 42711, 26327, 59095, 5847, 38615, 22231, 54999, 14039, + 46807, 30423, 63191, 3799, 36567, 20183, 52951, 11991, 44759, 28375, 61143, + 7895, 40663, 24279, 57047, 16087, 48855, 32471, 65239, 471, 33239, 16855, + 49623, 8663, 41431, 25047, 57815, 4567, 37335, 20951, 53719, 12759, 45527, + 29143, 61911, 2519, 35287, 18903, 51671, 10711, 43479, 27095, 59863, 6615, + 39383, 22999, 55767, 14807, 47575, 31191, 63959, 1495, 34263, 17879, 50647, + 9687, 42455, 26071, 58839, 5591, 38359, 21975, 54743, 13783, 46551, 30167, + 62935, 3543, 36311, 19927, 52695, 11735, 44503, 28119, 60887, 7639, 40407, + 24023, 56791, 15831, 48599, 32215, 64983, 983, 33751, 17367, 50135, 9175, + 41943, 25559, 58327, 5079, 37847, 21463, 54231, 13271, 46039, 29655, 62423, + 3031, 35799, 19415, 52183, 11223, 43991, 27607, 60375, 7127, 39895, 23511, + 56279, 15319, 48087, 31703, 64471, 2007, 34775, 18391, 51159, 10199, 42967, + 26583, 59351, 6103, 38871, 22487, 55255, 14295, 47063, 30679, 63447, 4055, + 36823, 20439, 53207, 12247, 45015, 28631, 61399, 8151, 40919, 24535, 57303, + 16343, 49111, 32727, 65495, 55, 32823, 16439, 49207, 8247, 41015, 24631, + 57399, 4151, 36919, 20535, 53303, 12343, 45111, 28727, 61495, 2103, 34871, + 18487, 51255, 10295, 43063, 26679, 59447, 6199, 38967, 22583, 55351, 14391, + 47159, 30775, 63543, 1079, 33847, 17463, 50231, 9271, 42039, 25655, 58423, + 5175, 37943, 21559, 54327, 13367, 46135, 29751, 62519, 3127, 35895, 19511, + 52279, 11319, 44087, 27703, 60471, 7223, 39991, 23607, 56375, 15415, 48183, + 31799, 64567, 567, 33335, 16951, 49719, 8759, 41527, 25143, 57911, 4663, + 37431, 21047, 53815, 12855, 45623, 29239, 62007, 2615, 35383, 18999, 51767, + 10807, 43575, 27191, 59959, 6711, 39479, 23095, 55863, 14903, 47671, 31287, + 64055, 1591, 34359, 17975, 50743, 9783, 42551, 26167, 58935, 5687, 38455, + 22071, 54839, 13879, 46647, 30263, 63031, 3639, 36407, 20023, 52791, 11831, + 44599, 28215, 60983, 7735, 40503, 24119, 56887, 15927, 48695, 32311, 65079, + 311, 33079, 16695, 49463, 8503, 41271, 24887, 57655, 4407, 37175, 20791, + 53559, 12599, 45367, 28983, 61751, 2359, 35127, 18743, 51511, 10551, 43319, + 26935, 59703, 6455, 39223, 22839, 55607, 14647, 47415, 31031, 63799, 1335, + 34103, 17719, 50487, 9527, 42295, 25911, 58679, 5431, 38199, 21815, 54583, + 13623, 46391, 30007, 62775, 3383, 36151, 19767, 52535, 11575, 44343, 27959, + 60727, 7479, 40247, 23863, 56631, 15671, 48439, 32055, 64823, 823, 33591, + 17207, 49975, 9015, 41783, 25399, 58167, 4919, 37687, 21303, 54071, 13111, + 45879, 29495, 62263, 2871, 35639, 19255, 52023, 11063, 43831, 27447, 60215, + 6967, 39735, 23351, 56119, 15159, 47927, 31543, 64311, 1847, 34615, 18231, + 50999, 10039, 42807, 26423, 59191, 5943, 38711, 22327, 55095, 14135, 46903, + 30519, 63287, 3895, 36663, 20279, 53047, 12087, 44855, 28471, 61239, 7991, + 40759, 24375, 57143, 16183, 48951, 32567, 65335, 183, 32951, 16567, 49335, + 8375, 41143, 24759, 57527, 4279, 37047, 20663, 53431, 12471, 45239, 28855, + 61623, 2231, 34999, 18615, 51383, 10423, 43191, 26807, 59575, 6327, 39095, + 22711, 55479, 14519, 47287, 30903, 63671, 1207, 33975, 17591, 50359, 9399, + 42167, 25783, 58551, 5303, 38071, 21687, 54455, 13495, 46263, 29879, 62647, + 3255, 36023, 19639, 52407, 11447, 44215, 27831, 60599, 7351, 40119, 23735, + 56503, 15543, 48311, 31927, 64695, 695, 33463, 17079, 49847, 8887, 41655, + 25271, 58039, 4791, 37559, 21175, 53943, 12983, 45751, 29367, 62135, 2743, + 35511, 19127, 51895, 10935, 43703, 27319, 60087, 6839, 39607, 23223, 55991, + 15031, 47799, 31415, 64183, 1719, 34487, 18103, 50871, 9911, 42679, 26295, + 59063, 5815, 38583, 22199, 54967, 14007, 46775, 30391, 63159, 3767, 36535, + 20151, 52919, 11959, 44727, 28343, 61111, 7863, 40631, 24247, 57015, 16055, + 48823, 32439, 65207, 439, 33207, 16823, 49591, 8631, 41399, 25015, 57783, + 4535, 37303, 20919, 53687, 12727, 45495, 29111, 61879, 2487, 35255, 18871, + 51639, 10679, 43447, 27063, 59831, 6583, 39351, 22967, 55735, 14775, 47543, + 31159, 63927, 1463, 34231, 17847, 50615, 9655, 42423, 26039, 58807, 5559, + 38327, 21943, 54711, 13751, 46519, 30135, 62903, 3511, 36279, 19895, 52663, + 11703, 44471, 28087, 60855, 7607, 40375, 23991, 56759, 15799, 48567, 32183, + 64951, 951, 33719, 17335, 50103, 9143, 41911, 25527, 58295, 5047, 37815, + 21431, 54199, 13239, 46007, 29623, 62391, 2999, 35767, 19383, 52151, 11191, + 43959, 27575, 60343, 7095, 39863, 23479, 56247, 15287, 48055, 31671, 64439, + 1975, 34743, 18359, 51127, 10167, 42935, 26551, 59319, 6071, 38839, 22455, + 55223, 14263, 47031, 30647, 63415, 4023, 36791, 20407, 53175, 12215, 44983, + 28599, 61367, 8119, 40887, 24503, 57271, 16311, 49079, 32695, 65463, 119, + 32887, 16503, 49271, 8311, 41079, 24695, 57463, 4215, 36983, 20599, 53367, + 12407, 45175, 28791, 61559, 2167, 34935, 18551, 51319, 10359, 43127, 26743, + 59511, 6263, 39031, 22647, 55415, 14455, 47223, 30839, 63607, 1143, 33911, + 17527, 50295, 9335, 42103, 25719, 58487, 5239, 38007, 21623, 54391, 13431, + 46199, 29815, 62583, 3191, 35959, 19575, 52343, 11383, 44151, 27767, 60535, + 7287, 40055, 23671, 56439, 15479, 48247, 31863, 64631, 631, 33399, 17015, + 49783, 8823, 41591, 25207, 57975, 4727, 37495, 21111, 53879, 12919, 45687, + 29303, 62071, 2679, 35447, 19063, 51831, 10871, 43639, 27255, 60023, 6775, + 39543, 23159, 55927, 14967, 47735, 31351, 64119, 1655, 34423, 18039, 50807, + 9847, 42615, 26231, 58999, 5751, 38519, 22135, 54903, 13943, 46711, 30327, + 63095, 3703, 36471, 20087, 52855, 11895, 44663, 28279, 61047, 7799, 40567, + 24183, 56951, 15991, 48759, 32375, 65143, 375, 33143, 16759, 49527, 8567, + 41335, 24951, 57719, 4471, 37239, 20855, 53623, 12663, 45431, 29047, 61815, + 2423, 35191, 18807, 51575, 10615, 43383, 26999, 59767, 6519, 39287, 22903, + 55671, 14711, 47479, 31095, 63863, 1399, 34167, 17783, 50551, 9591, 42359, + 25975, 58743, 5495, 38263, 21879, 54647, 13687, 46455, 30071, 62839, 3447, + 36215, 19831, 52599, 11639, 44407, 28023, 60791, 7543, 40311, 23927, 56695, + 15735, 48503, 32119, 64887, 887, 33655, 17271, 50039, 9079, 41847, 25463, + 58231, 4983, 37751, 21367, 54135, 13175, 45943, 29559, 62327, 2935, 35703, + 19319, 52087, 11127, 43895, 27511, 60279, 7031, 39799, 23415, 56183, 15223, + 47991, 31607, 64375, 1911, 34679, 18295, 51063, 10103, 42871, 26487, 59255, + 6007, 38775, 22391, 55159, 14199, 46967, 30583, 63351, 3959, 36727, 20343, + 53111, 12151, 44919, 28535, 61303, 8055, 40823, 24439, 57207, 16247, 49015, + 32631, 65399, 247, 33015, 16631, 49399, 8439, 41207, 24823, 57591, 4343, + 37111, 20727, 53495, 12535, 45303, 28919, 61687, 2295, 35063, 18679, 51447, + 10487, 43255, 26871, 59639, 6391, 39159, 22775, 55543, 14583, 47351, 30967, + 63735, 1271, 34039, 17655, 50423, 9463, 42231, 25847, 58615, 5367, 38135, + 21751, 54519, 13559, 46327, 29943, 62711, 3319, 36087, 19703, 52471, 11511, + 44279, 27895, 60663, 7415, 40183, 23799, 56567, 15607, 48375, 31991, 64759, + 759, 33527, 17143, 49911, 8951, 41719, 25335, 58103, 4855, 37623, 21239, + 54007, 13047, 45815, 29431, 62199, 2807, 35575, 19191, 51959, 10999, 43767, + 27383, 60151, 6903, 39671, 23287, 56055, 15095, 47863, 31479, 64247, 1783, + 34551, 18167, 50935, 9975, 42743, 26359, 59127, 5879, 38647, 22263, 55031, + 14071, 46839, 30455, 63223, 3831, 36599, 20215, 52983, 12023, 44791, 28407, + 61175, 7927, 40695, 24311, 57079, 16119, 48887, 32503, 65271, 503, 33271, + 16887, 49655, 8695, 41463, 25079, 57847, 4599, 37367, 20983, 53751, 12791, + 45559, 29175, 61943, 2551, 35319, 18935, 51703, 10743, 43511, 27127, 59895, + 6647, 39415, 23031, 55799, 14839, 47607, 31223, 63991, 1527, 34295, 17911, + 50679, 9719, 42487, 26103, 58871, 5623, 38391, 22007, 54775, 13815, 46583, + 30199, 62967, 3575, 36343, 19959, 52727, 11767, 44535, 28151, 60919, 7671, + 40439, 24055, 56823, 15863, 48631, 32247, 65015, 1015, 33783, 17399, 50167, + 9207, 41975, 25591, 58359, 5111, 37879, 21495, 54263, 13303, 46071, 29687, + 62455, 3063, 35831, 19447, 52215, 11255, 44023, 27639, 60407, 7159, 39927, + 23543, 56311, 15351, 48119, 31735, 64503, 2039, 34807, 18423, 51191, 10231, + 42999, 26615, 59383, 6135, 38903, 22519, 55287, 14327, 47095, 30711, 63479, + 4087, 36855, 20471, 53239, 12279, 45047, 28663, 61431, 8183, 40951, 24567, + 57335, 16375, 49143, 32759, 65527, 15, 32783, 16399, 49167, 8207, 40975, + 24591, 57359, 4111, 36879, 20495, 53263, 12303, 45071, 28687, 61455, 2063, + 34831, 18447, 51215, 10255, 43023, 26639, 59407, 6159, 38927, 22543, 55311, + 14351, 47119, 30735, 63503, 1039, 33807, 17423, 50191, 9231, 41999, 25615, + 58383, 5135, 37903, 21519, 54287, 13327, 46095, 29711, 62479, 3087, 35855, + 19471, 52239, 11279, 44047, 27663, 60431, 7183, 39951, 23567, 56335, 15375, + 48143, 31759, 64527, 527, 33295, 16911, 49679, 8719, 41487, 25103, 57871, + 4623, 37391, 21007, 53775, 12815, 45583, 29199, 61967, 2575, 35343, 18959, + 51727, 10767, 43535, 27151, 59919, 6671, 39439, 23055, 55823, 14863, 47631, + 31247, 64015, 1551, 34319, 17935, 50703, 9743, 42511, 26127, 58895, 5647, + 38415, 22031, 54799, 13839, 46607, 30223, 62991, 3599, 36367, 19983, 52751, + 11791, 44559, 28175, 60943, 7695, 40463, 24079, 56847, 15887, 48655, 32271, + 65039, 271, 33039, 16655, 49423, 8463, 41231, 24847, 57615, 4367, 37135, + 20751, 53519, 12559, 45327, 28943, 61711, 2319, 35087, 18703, 51471, 10511, + 43279, 26895, 59663, 6415, 39183, 22799, 55567, 14607, 47375, 30991, 63759, + 1295, 34063, 17679, 50447, 9487, 42255, 25871, 58639, 5391, 38159, 21775, + 54543, 13583, 46351, 29967, 62735, 3343, 36111, 19727, 52495, 11535, 44303, + 27919, 60687, 7439, 40207, 23823, 56591, 15631, 48399, 32015, 64783, 783, + 33551, 17167, 49935, 8975, 41743, 25359, 58127, 4879, 37647, 21263, 54031, + 13071, 45839, 29455, 62223, 2831, 35599, 19215, 51983, 11023, 43791, 27407, + 60175, 6927, 39695, 23311, 56079, 15119, 47887, 31503, 64271, 1807, 34575, + 18191, 50959, 9999, 42767, 26383, 59151, 5903, 38671, 22287, 55055, 14095, + 46863, 30479, 63247, 3855, 36623, 20239, 53007, 12047, 44815, 28431, 61199, + 7951, 40719, 24335, 57103, 16143, 48911, 32527, 65295, 143, 32911, 16527, + 49295, 8335, 41103, 24719, 57487, 4239, 37007, 20623, 53391, 12431, 45199, + 28815, 61583, 2191, 34959, 18575, 51343, 10383, 43151, 26767, 59535, 6287, + 39055, 22671, 55439, 14479, 47247, 30863, 63631, 1167, 33935, 17551, 50319, + 9359, 42127, 25743, 58511, 5263, 38031, 21647, 54415, 13455, 46223, 29839, + 62607, 3215, 35983, 19599, 52367, 11407, 44175, 27791, 60559, 7311, 40079, + 23695, 56463, 15503, 48271, 31887, 64655, 655, 33423, 17039, 49807, 8847, + 41615, 25231, 57999, 4751, 37519, 21135, 53903, 12943, 45711, 29327, 62095, + 2703, 35471, 19087, 51855, 10895, 43663, 27279, 60047, 6799, 39567, 23183, + 55951, 14991, 47759, 31375, 64143, 1679, 34447, 18063, 50831, 9871, 42639, + 26255, 59023, 5775, 38543, 22159, 54927, 13967, 46735, 30351, 63119, 3727, + 36495, 20111, 52879, 11919, 44687, 28303, 61071, 7823, 40591, 24207, 56975, + 16015, 48783, 32399, 65167, 399, 33167, 16783, 49551, 8591, 41359, 24975, + 57743, 4495, 37263, 20879, 53647, 12687, 45455, 29071, 61839, 2447, 35215, + 18831, 51599, 10639, 43407, 27023, 59791, 6543, 39311, 22927, 55695, 14735, + 47503, 31119, 63887, 1423, 34191, 17807, 50575, 9615, 42383, 25999, 58767, + 5519, 38287, 21903, 54671, 13711, 46479, 30095, 62863, 3471, 36239, 19855, + 52623, 11663, 44431, 28047, 60815, 7567, 40335, 23951, 56719, 15759, 48527, + 32143, 64911, 911, 33679, 17295, 50063, 9103, 41871, 25487, 58255, 5007, + 37775, 21391, 54159, 13199, 45967, 29583, 62351, 2959, 35727, 19343, 52111, + 11151, 43919, 27535, 60303, 7055, 39823, 23439, 56207, 15247, 48015, 31631, + 64399, 1935, 34703, 18319, 51087, 10127, 42895, 26511, 59279, 6031, 38799, + 22415, 55183, 14223, 46991, 30607, 63375, 3983, 36751, 20367, 53135, 12175, + 44943, 28559, 61327, 8079, 40847, 24463, 57231, 16271, 49039, 32655, 65423, + 79, 32847, 16463, 49231, 8271, 41039, 24655, 57423, 4175, 36943, 20559, + 53327, 12367, 45135, 28751, 61519, 2127, 34895, 18511, 51279, 10319, 43087, + 26703, 59471, 6223, 38991, 22607, 55375, 14415, 47183, 30799, 63567, 1103, + 33871, 17487, 50255, 9295, 42063, 25679, 58447, 5199, 37967, 21583, 54351, + 13391, 46159, 29775, 62543, 3151, 35919, 19535, 52303, 11343, 44111, 27727, + 60495, 7247, 40015, 23631, 56399, 15439, 48207, 31823, 64591, 591, 33359, + 16975, 49743, 8783, 41551, 25167, 57935, 4687, 37455, 21071, 53839, 12879, + 45647, 29263, 62031, 2639, 35407, 19023, 51791, 10831, 43599, 27215, 59983, + 6735, 39503, 23119, 55887, 14927, 47695, 31311, 64079, 1615, 34383, 17999, + 50767, 9807, 42575, 26191, 58959, 5711, 38479, 22095, 54863, 13903, 46671, + 30287, 63055, 3663, 36431, 20047, 52815, 11855, 44623, 28239, 61007, 7759, + 40527, 24143, 56911, 15951, 48719, 32335, 65103, 335, 33103, 16719, 49487, + 8527, 41295, 24911, 57679, 4431, 37199, 20815, 53583, 12623, 45391, 29007, + 61775, 2383, 35151, 18767, 51535, 10575, 43343, 26959, 59727, 6479, 39247, + 22863, 55631, 14671, 47439, 31055, 63823, 1359, 34127, 17743, 50511, 9551, + 42319, 25935, 58703, 5455, 38223, 21839, 54607, 13647, 46415, 30031, 62799, + 3407, 36175, 19791, 52559, 11599, 44367, 27983, 60751, 7503, 40271, 23887, + 56655, 15695, 48463, 32079, 64847, 847, 33615, 17231, 49999, 9039, 41807, + 25423, 58191, 4943, 37711, 21327, 54095, 13135, 45903, 29519, 62287, 2895, + 35663, 19279, 52047, 11087, 43855, 27471, 60239, 6991, 39759, 23375, 56143, + 15183, 47951, 31567, 64335, 1871, 34639, 18255, 51023, 10063, 42831, 26447, + 59215, 5967, 38735, 22351, 55119, 14159, 46927, 30543, 63311, 3919, 36687, + 20303, 53071, 12111, 44879, 28495, 61263, 8015, 40783, 24399, 57167, 16207, + 48975, 32591, 65359, 207, 32975, 16591, 49359, 8399, 41167, 24783, 57551, + 4303, 37071, 20687, 53455, 12495, 45263, 28879, 61647, 2255, 35023, 18639, + 51407, 10447, 43215, 26831, 59599, 6351, 39119, 22735, 55503, 14543, 47311, + 30927, 63695, 1231, 33999, 17615, 50383, 9423, 42191, 25807, 58575, 5327, + 38095, 21711, 54479, 13519, 46287, 29903, 62671, 3279, 36047, 19663, 52431, + 11471, 44239, 27855, 60623, 7375, 40143, 23759, 56527, 15567, 48335, 31951, + 64719, 719, 33487, 17103, 49871, 8911, 41679, 25295, 58063, 4815, 37583, + 21199, 53967, 13007, 45775, 29391, 62159, 2767, 35535, 19151, 51919, 10959, + 43727, 27343, 60111, 6863, 39631, 23247, 56015, 15055, 47823, 31439, 64207, + 1743, 34511, 18127, 50895, 9935, 42703, 26319, 59087, 5839, 38607, 22223, + 54991, 14031, 46799, 30415, 63183, 3791, 36559, 20175, 52943, 11983, 44751, + 28367, 61135, 7887, 40655, 24271, 57039, 16079, 48847, 32463, 65231, 463, + 33231, 16847, 49615, 8655, 41423, 25039, 57807, 4559, 37327, 20943, 53711, + 12751, 45519, 29135, 61903, 2511, 35279, 18895, 51663, 10703, 43471, 27087, + 59855, 6607, 39375, 22991, 55759, 14799, 47567, 31183, 63951, 1487, 34255, + 17871, 50639, 9679, 42447, 26063, 58831, 5583, 38351, 21967, 54735, 13775, + 46543, 30159, 62927, 3535, 36303, 19919, 52687, 11727, 44495, 28111, 60879, + 7631, 40399, 24015, 56783, 15823, 48591, 32207, 64975, 975, 33743, 17359, + 50127, 9167, 41935, 25551, 58319, 5071, 37839, 21455, 54223, 13263, 46031, + 29647, 62415, 3023, 35791, 19407, 52175, 11215, 43983, 27599, 60367, 7119, + 39887, 23503, 56271, 15311, 48079, 31695, 64463, 1999, 34767, 18383, 51151, + 10191, 42959, 26575, 59343, 6095, 38863, 22479, 55247, 14287, 47055, 30671, + 63439, 4047, 36815, 20431, 53199, 12239, 45007, 28623, 61391, 8143, 40911, + 24527, 57295, 16335, 49103, 32719, 65487, 47, 32815, 16431, 49199, 8239, + 41007, 24623, 57391, 4143, 36911, 20527, 53295, 12335, 45103, 28719, 61487, + 2095, 34863, 18479, 51247, 10287, 43055, 26671, 59439, 6191, 38959, 22575, + 55343, 14383, 47151, 30767, 63535, 1071, 33839, 17455, 50223, 9263, 42031, + 25647, 58415, 5167, 37935, 21551, 54319, 13359, 46127, 29743, 62511, 3119, + 35887, 19503, 52271, 11311, 44079, 27695, 60463, 7215, 39983, 23599, 56367, + 15407, 48175, 31791, 64559, 559, 33327, 16943, 49711, 8751, 41519, 25135, + 57903, 4655, 37423, 21039, 53807, 12847, 45615, 29231, 61999, 2607, 35375, + 18991, 51759, 10799, 43567, 27183, 59951, 6703, 39471, 23087, 55855, 14895, + 47663, 31279, 64047, 1583, 34351, 17967, 50735, 9775, 42543, 26159, 58927, + 5679, 38447, 22063, 54831, 13871, 46639, 30255, 63023, 3631, 36399, 20015, + 52783, 11823, 44591, 28207, 60975, 7727, 40495, 24111, 56879, 15919, 48687, + 32303, 65071, 303, 33071, 16687, 49455, 8495, 41263, 24879, 57647, 4399, + 37167, 20783, 53551, 12591, 45359, 28975, 61743, 2351, 35119, 18735, 51503, + 10543, 43311, 26927, 59695, 6447, 39215, 22831, 55599, 14639, 47407, 31023, + 63791, 1327, 34095, 17711, 50479, 9519, 42287, 25903, 58671, 5423, 38191, + 21807, 54575, 13615, 46383, 29999, 62767, 3375, 36143, 19759, 52527, 11567, + 44335, 27951, 60719, 7471, 40239, 23855, 56623, 15663, 48431, 32047, 64815, + 815, 33583, 17199, 49967, 9007, 41775, 25391, 58159, 4911, 37679, 21295, + 54063, 13103, 45871, 29487, 62255, 2863, 35631, 19247, 52015, 11055, 43823, + 27439, 60207, 6959, 39727, 23343, 56111, 15151, 47919, 31535, 64303, 1839, + 34607, 18223, 50991, 10031, 42799, 26415, 59183, 5935, 38703, 22319, 55087, + 14127, 46895, 30511, 63279, 3887, 36655, 20271, 53039, 12079, 44847, 28463, + 61231, 7983, 40751, 24367, 57135, 16175, 48943, 32559, 65327, 175, 32943, + 16559, 49327, 8367, 41135, 24751, 57519, 4271, 37039, 20655, 53423, 12463, + 45231, 28847, 61615, 2223, 34991, 18607, 51375, 10415, 43183, 26799, 59567, + 6319, 39087, 22703, 55471, 14511, 47279, 30895, 63663, 1199, 33967, 17583, + 50351, 9391, 42159, 25775, 58543, 5295, 38063, 21679, 54447, 13487, 46255, + 29871, 62639, 3247, 36015, 19631, 52399, 11439, 44207, 27823, 60591, 7343, + 40111, 23727, 56495, 15535, 48303, 31919, 64687, 687, 33455, 17071, 49839, + 8879, 41647, 25263, 58031, 4783, 37551, 21167, 53935, 12975, 45743, 29359, + 62127, 2735, 35503, 19119, 51887, 10927, 43695, 27311, 60079, 6831, 39599, + 23215, 55983, 15023, 47791, 31407, 64175, 1711, 34479, 18095, 50863, 9903, + 42671, 26287, 59055, 5807, 38575, 22191, 54959, 13999, 46767, 30383, 63151, + 3759, 36527, 20143, 52911, 11951, 44719, 28335, 61103, 7855, 40623, 24239, + 57007, 16047, 48815, 32431, 65199, 431, 33199, 16815, 49583, 8623, 41391, + 25007, 57775, 4527, 37295, 20911, 53679, 12719, 45487, 29103, 61871, 2479, + 35247, 18863, 51631, 10671, 43439, 27055, 59823, 6575, 39343, 22959, 55727, + 14767, 47535, 31151, 63919, 1455, 34223, 17839, 50607, 9647, 42415, 26031, + 58799, 5551, 38319, 21935, 54703, 13743, 46511, 30127, 62895, 3503, 36271, + 19887, 52655, 11695, 44463, 28079, 60847, 7599, 40367, 23983, 56751, 15791, + 48559, 32175, 64943, 943, 33711, 17327, 50095, 9135, 41903, 25519, 58287, + 5039, 37807, 21423, 54191, 13231, 45999, 29615, 62383, 2991, 35759, 19375, + 52143, 11183, 43951, 27567, 60335, 7087, 39855, 23471, 56239, 15279, 48047, + 31663, 64431, 1967, 34735, 18351, 51119, 10159, 42927, 26543, 59311, 6063, + 38831, 22447, 55215, 14255, 47023, 30639, 63407, 4015, 36783, 20399, 53167, + 12207, 44975, 28591, 61359, 8111, 40879, 24495, 57263, 16303, 49071, 32687, + 65455, 111, 32879, 16495, 49263, 8303, 41071, 24687, 57455, 4207, 36975, + 20591, 53359, 12399, 45167, 28783, 61551, 2159, 34927, 18543, 51311, 10351, + 43119, 26735, 59503, 6255, 39023, 22639, 55407, 14447, 47215, 30831, 63599, + 1135, 33903, 17519, 50287, 9327, 42095, 25711, 58479, 5231, 37999, 21615, + 54383, 13423, 46191, 29807, 62575, 3183, 35951, 19567, 52335, 11375, 44143, + 27759, 60527, 7279, 40047, 23663, 56431, 15471, 48239, 31855, 64623, 623, + 33391, 17007, 49775, 8815, 41583, 25199, 57967, 4719, 37487, 21103, 53871, + 12911, 45679, 29295, 62063, 2671, 35439, 19055, 51823, 10863, 43631, 27247, + 60015, 6767, 39535, 23151, 55919, 14959, 47727, 31343, 64111, 1647, 34415, + 18031, 50799, 9839, 42607, 26223, 58991, 5743, 38511, 22127, 54895, 13935, + 46703, 30319, 63087, 3695, 36463, 20079, 52847, 11887, 44655, 28271, 61039, + 7791, 40559, 24175, 56943, 15983, 48751, 32367, 65135, 367, 33135, 16751, + 49519, 8559, 41327, 24943, 57711, 4463, 37231, 20847, 53615, 12655, 45423, + 29039, 61807, 2415, 35183, 18799, 51567, 10607, 43375, 26991, 59759, 6511, + 39279, 22895, 55663, 14703, 47471, 31087, 63855, 1391, 34159, 17775, 50543, + 9583, 42351, 25967, 58735, 5487, 38255, 21871, 54639, 13679, 46447, 30063, + 62831, 3439, 36207, 19823, 52591, 11631, 44399, 28015, 60783, 7535, 40303, + 23919, 56687, 15727, 48495, 32111, 64879, 879, 33647, 17263, 50031, 9071, + 41839, 25455, 58223, 4975, 37743, 21359, 54127, 13167, 45935, 29551, 62319, + 2927, 35695, 19311, 52079, 11119, 43887, 27503, 60271, 7023, 39791, 23407, + 56175, 15215, 47983, 31599, 64367, 1903, 34671, 18287, 51055, 10095, 42863, + 26479, 59247, 5999, 38767, 22383, 55151, 14191, 46959, 30575, 63343, 3951, + 36719, 20335, 53103, 12143, 44911, 28527, 61295, 8047, 40815, 24431, 57199, + 16239, 49007, 32623, 65391, 239, 33007, 16623, 49391, 8431, 41199, 24815, + 57583, 4335, 37103, 20719, 53487, 12527, 45295, 28911, 61679, 2287, 35055, + 18671, 51439, 10479, 43247, 26863, 59631, 6383, 39151, 22767, 55535, 14575, + 47343, 30959, 63727, 1263, 34031, 17647, 50415, 9455, 42223, 25839, 58607, + 5359, 38127, 21743, 54511, 13551, 46319, 29935, 62703, 3311, 36079, 19695, + 52463, 11503, 44271, 27887, 60655, 7407, 40175, 23791, 56559, 15599, 48367, + 31983, 64751, 751, 33519, 17135, 49903, 8943, 41711, 25327, 58095, 4847, + 37615, 21231, 53999, 13039, 45807, 29423, 62191, 2799, 35567, 19183, 51951, + 10991, 43759, 27375, 60143, 6895, 39663, 23279, 56047, 15087, 47855, 31471, + 64239, 1775, 34543, 18159, 50927, 9967, 42735, 26351, 59119, 5871, 38639, + 22255, 55023, 14063, 46831, 30447, 63215, 3823, 36591, 20207, 52975, 12015, + 44783, 28399, 61167, 7919, 40687, 24303, 57071, 16111, 48879, 32495, 65263, + 495, 33263, 16879, 49647, 8687, 41455, 25071, 57839, 4591, 37359, 20975, + 53743, 12783, 45551, 29167, 61935, 2543, 35311, 18927, 51695, 10735, 43503, + 27119, 59887, 6639, 39407, 23023, 55791, 14831, 47599, 31215, 63983, 1519, + 34287, 17903, 50671, 9711, 42479, 26095, 58863, 5615, 38383, 21999, 54767, + 13807, 46575, 30191, 62959, 3567, 36335, 19951, 52719, 11759, 44527, 28143, + 60911, 7663, 40431, 24047, 56815, 15855, 48623, 32239, 65007, 1007, 33775, + 17391, 50159, 9199, 41967, 25583, 58351, 5103, 37871, 21487, 54255, 13295, + 46063, 29679, 62447, 3055, 35823, 19439, 52207, 11247, 44015, 27631, 60399, + 7151, 39919, 23535, 56303, 15343, 48111, 31727, 64495, 2031, 34799, 18415, + 51183, 10223, 42991, 26607, 59375, 6127, 38895, 22511, 55279, 14319, 47087, + 30703, 63471, 4079, 36847, 20463, 53231, 12271, 45039, 28655, 61423, 8175, + 40943, 24559, 57327, 16367, 49135, 32751, 65519, 31, 32799, 16415, 49183, + 8223, 40991, 24607, 57375, 4127, 36895, 20511, 53279, 12319, 45087, 28703, + 61471, 2079, 34847, 18463, 51231, 10271, 43039, 26655, 59423, 6175, 38943, + 22559, 55327, 14367, 47135, 30751, 63519, 1055, 33823, 17439, 50207, 9247, + 42015, 25631, 58399, 5151, 37919, 21535, 54303, 13343, 46111, 29727, 62495, + 3103, 35871, 19487, 52255, 11295, 44063, 27679, 60447, 7199, 39967, 23583, + 56351, 15391, 48159, 31775, 64543, 543, 33311, 16927, 49695, 8735, 41503, + 25119, 57887, 4639, 37407, 21023, 53791, 12831, 45599, 29215, 61983, 2591, + 35359, 18975, 51743, 10783, 43551, 27167, 59935, 6687, 39455, 23071, 55839, + 14879, 47647, 31263, 64031, 1567, 34335, 17951, 50719, 9759, 42527, 26143, + 58911, 5663, 38431, 22047, 54815, 13855, 46623, 30239, 63007, 3615, 36383, + 19999, 52767, 11807, 44575, 28191, 60959, 7711, 40479, 24095, 56863, 15903, + 48671, 32287, 65055, 287, 33055, 16671, 49439, 8479, 41247, 24863, 57631, + 4383, 37151, 20767, 53535, 12575, 45343, 28959, 61727, 2335, 35103, 18719, + 51487, 10527, 43295, 26911, 59679, 6431, 39199, 22815, 55583, 14623, 47391, + 31007, 63775, 1311, 34079, 17695, 50463, 9503, 42271, 25887, 58655, 5407, + 38175, 21791, 54559, 13599, 46367, 29983, 62751, 3359, 36127, 19743, 52511, + 11551, 44319, 27935, 60703, 7455, 40223, 23839, 56607, 15647, 48415, 32031, + 64799, 799, 33567, 17183, 49951, 8991, 41759, 25375, 58143, 4895, 37663, + 21279, 54047, 13087, 45855, 29471, 62239, 2847, 35615, 19231, 51999, 11039, + 43807, 27423, 60191, 6943, 39711, 23327, 56095, 15135, 47903, 31519, 64287, + 1823, 34591, 18207, 50975, 10015, 42783, 26399, 59167, 5919, 38687, 22303, + 55071, 14111, 46879, 30495, 63263, 3871, 36639, 20255, 53023, 12063, 44831, + 28447, 61215, 7967, 40735, 24351, 57119, 16159, 48927, 32543, 65311, 159, + 32927, 16543, 49311, 8351, 41119, 24735, 57503, 4255, 37023, 20639, 53407, + 12447, 45215, 28831, 61599, 2207, 34975, 18591, 51359, 10399, 43167, 26783, + 59551, 6303, 39071, 22687, 55455, 14495, 47263, 30879, 63647, 1183, 33951, + 17567, 50335, 9375, 42143, 25759, 58527, 5279, 38047, 21663, 54431, 13471, + 46239, 29855, 62623, 3231, 35999, 19615, 52383, 11423, 44191, 27807, 60575, + 7327, 40095, 23711, 56479, 15519, 48287, 31903, 64671, 671, 33439, 17055, + 49823, 8863, 41631, 25247, 58015, 4767, 37535, 21151, 53919, 12959, 45727, + 29343, 62111, 2719, 35487, 19103, 51871, 10911, 43679, 27295, 60063, 6815, + 39583, 23199, 55967, 15007, 47775, 31391, 64159, 1695, 34463, 18079, 50847, + 9887, 42655, 26271, 59039, 5791, 38559, 22175, 54943, 13983, 46751, 30367, + 63135, 3743, 36511, 20127, 52895, 11935, 44703, 28319, 61087, 7839, 40607, + 24223, 56991, 16031, 48799, 32415, 65183, 415, 33183, 16799, 49567, 8607, + 41375, 24991, 57759, 4511, 37279, 20895, 53663, 12703, 45471, 29087, 61855, + 2463, 35231, 18847, 51615, 10655, 43423, 27039, 59807, 6559, 39327, 22943, + 55711, 14751, 47519, 31135, 63903, 1439, 34207, 17823, 50591, 9631, 42399, + 26015, 58783, 5535, 38303, 21919, 54687, 13727, 46495, 30111, 62879, 3487, + 36255, 19871, 52639, 11679, 44447, 28063, 60831, 7583, 40351, 23967, 56735, + 15775, 48543, 32159, 64927, 927, 33695, 17311, 50079, 9119, 41887, 25503, + 58271, 5023, 37791, 21407, 54175, 13215, 45983, 29599, 62367, 2975, 35743, + 19359, 52127, 11167, 43935, 27551, 60319, 7071, 39839, 23455, 56223, 15263, + 48031, 31647, 64415, 1951, 34719, 18335, 51103, 10143, 42911, 26527, 59295, + 6047, 38815, 22431, 55199, 14239, 47007, 30623, 63391, 3999, 36767, 20383, + 53151, 12191, 44959, 28575, 61343, 8095, 40863, 24479, 57247, 16287, 49055, + 32671, 65439, 95, 32863, 16479, 49247, 8287, 41055, 24671, 57439, 4191, + 36959, 20575, 53343, 12383, 45151, 28767, 61535, 2143, 34911, 18527, 51295, + 10335, 43103, 26719, 59487, 6239, 39007, 22623, 55391, 14431, 47199, 30815, + 63583, 1119, 33887, 17503, 50271, 9311, 42079, 25695, 58463, 5215, 37983, + 21599, 54367, 13407, 46175, 29791, 62559, 3167, 35935, 19551, 52319, 11359, + 44127, 27743, 60511, 7263, 40031, 23647, 56415, 15455, 48223, 31839, 64607, + 607, 33375, 16991, 49759, 8799, 41567, 25183, 57951, 4703, 37471, 21087, + 53855, 12895, 45663, 29279, 62047, 2655, 35423, 19039, 51807, 10847, 43615, + 27231, 59999, 6751, 39519, 23135, 55903, 14943, 47711, 31327, 64095, 1631, + 34399, 18015, 50783, 9823, 42591, 26207, 58975, 5727, 38495, 22111, 54879, + 13919, 46687, 30303, 63071, 3679, 36447, 20063, 52831, 11871, 44639, 28255, + 61023, 7775, 40543, 24159, 56927, 15967, 48735, 32351, 65119, 351, 33119, + 16735, 49503, 8543, 41311, 24927, 57695, 4447, 37215, 20831, 53599, 12639, + 45407, 29023, 61791, 2399, 35167, 18783, 51551, 10591, 43359, 26975, 59743, + 6495, 39263, 22879, 55647, 14687, 47455, 31071, 63839, 1375, 34143, 17759, + 50527, 9567, 42335, 25951, 58719, 5471, 38239, 21855, 54623, 13663, 46431, + 30047, 62815, 3423, 36191, 19807, 52575, 11615, 44383, 27999, 60767, 7519, + 40287, 23903, 56671, 15711, 48479, 32095, 64863, 863, 33631, 17247, 50015, + 9055, 41823, 25439, 58207, 4959, 37727, 21343, 54111, 13151, 45919, 29535, + 62303, 2911, 35679, 19295, 52063, 11103, 43871, 27487, 60255, 7007, 39775, + 23391, 56159, 15199, 47967, 31583, 64351, 1887, 34655, 18271, 51039, 10079, + 42847, 26463, 59231, 5983, 38751, 22367, 55135, 14175, 46943, 30559, 63327, + 3935, 36703, 20319, 53087, 12127, 44895, 28511, 61279, 8031, 40799, 24415, + 57183, 16223, 48991, 32607, 65375, 223, 32991, 16607, 49375, 8415, 41183, + 24799, 57567, 4319, 37087, 20703, 53471, 12511, 45279, 28895, 61663, 2271, + 35039, 18655, 51423, 10463, 43231, 26847, 59615, 6367, 39135, 22751, 55519, + 14559, 47327, 30943, 63711, 1247, 34015, 17631, 50399, 9439, 42207, 25823, + 58591, 5343, 38111, 21727, 54495, 13535, 46303, 29919, 62687, 3295, 36063, + 19679, 52447, 11487, 44255, 27871, 60639, 7391, 40159, 23775, 56543, 15583, + 48351, 31967, 64735, 735, 33503, 17119, 49887, 8927, 41695, 25311, 58079, + 4831, 37599, 21215, 53983, 13023, 45791, 29407, 62175, 2783, 35551, 19167, + 51935, 10975, 43743, 27359, 60127, 6879, 39647, 23263, 56031, 15071, 47839, + 31455, 64223, 1759, 34527, 18143, 50911, 9951, 42719, 26335, 59103, 5855, + 38623, 22239, 55007, 14047, 46815, 30431, 63199, 3807, 36575, 20191, 52959, + 11999, 44767, 28383, 61151, 7903, 40671, 24287, 57055, 16095, 48863, 32479, + 65247, 479, 33247, 16863, 49631, 8671, 41439, 25055, 57823, 4575, 37343, + 20959, 53727, 12767, 45535, 29151, 61919, 2527, 35295, 18911, 51679, 10719, + 43487, 27103, 59871, 6623, 39391, 23007, 55775, 14815, 47583, 31199, 63967, + 1503, 34271, 17887, 50655, 9695, 42463, 26079, 58847, 5599, 38367, 21983, + 54751, 13791, 46559, 30175, 62943, 3551, 36319, 19935, 52703, 11743, 44511, + 28127, 60895, 7647, 40415, 24031, 56799, 15839, 48607, 32223, 64991, 991, + 33759, 17375, 50143, 9183, 41951, 25567, 58335, 5087, 37855, 21471, 54239, + 13279, 46047, 29663, 62431, 3039, 35807, 19423, 52191, 11231, 43999, 27615, + 60383, 7135, 39903, 23519, 56287, 15327, 48095, 31711, 64479, 2015, 34783, + 18399, 51167, 10207, 42975, 26591, 59359, 6111, 38879, 22495, 55263, 14303, + 47071, 30687, 63455, 4063, 36831, 20447, 53215, 12255, 45023, 28639, 61407, + 8159, 40927, 24543, 57311, 16351, 49119, 32735, 65503, 63, 32831, 16447, + 49215, 8255, 41023, 24639, 57407, 4159, 36927, 20543, 53311, 12351, 45119, + 28735, 61503, 2111, 34879, 18495, 51263, 10303, 43071, 26687, 59455, 6207, + 38975, 22591, 55359, 14399, 47167, 30783, 63551, 1087, 33855, 17471, 50239, + 9279, 42047, 25663, 58431, 5183, 37951, 21567, 54335, 13375, 46143, 29759, + 62527, 3135, 35903, 19519, 52287, 11327, 44095, 27711, 60479, 7231, 39999, + 23615, 56383, 15423, 48191, 31807, 64575, 575, 33343, 16959, 49727, 8767, + 41535, 25151, 57919, 4671, 37439, 21055, 53823, 12863, 45631, 29247, 62015, + 2623, 35391, 19007, 51775, 10815, 43583, 27199, 59967, 6719, 39487, 23103, + 55871, 14911, 47679, 31295, 64063, 1599, 34367, 17983, 50751, 9791, 42559, + 26175, 58943, 5695, 38463, 22079, 54847, 13887, 46655, 30271, 63039, 3647, + 36415, 20031, 52799, 11839, 44607, 28223, 60991, 7743, 40511, 24127, 56895, + 15935, 48703, 32319, 65087, 319, 33087, 16703, 49471, 8511, 41279, 24895, + 57663, 4415, 37183, 20799, 53567, 12607, 45375, 28991, 61759, 2367, 35135, + 18751, 51519, 10559, 43327, 26943, 59711, 6463, 39231, 22847, 55615, 14655, + 47423, 31039, 63807, 1343, 34111, 17727, 50495, 9535, 42303, 25919, 58687, + 5439, 38207, 21823, 54591, 13631, 46399, 30015, 62783, 3391, 36159, 19775, + 52543, 11583, 44351, 27967, 60735, 7487, 40255, 23871, 56639, 15679, 48447, + 32063, 64831, 831, 33599, 17215, 49983, 9023, 41791, 25407, 58175, 4927, + 37695, 21311, 54079, 13119, 45887, 29503, 62271, 2879, 35647, 19263, 52031, + 11071, 43839, 27455, 60223, 6975, 39743, 23359, 56127, 15167, 47935, 31551, + 64319, 1855, 34623, 18239, 51007, 10047, 42815, 26431, 59199, 5951, 38719, + 22335, 55103, 14143, 46911, 30527, 63295, 3903, 36671, 20287, 53055, 12095, + 44863, 28479, 61247, 7999, 40767, 24383, 57151, 16191, 48959, 32575, 65343, + 191, 32959, 16575, 49343, 8383, 41151, 24767, 57535, 4287, 37055, 20671, + 53439, 12479, 45247, 28863, 61631, 2239, 35007, 18623, 51391, 10431, 43199, + 26815, 59583, 6335, 39103, 22719, 55487, 14527, 47295, 30911, 63679, 1215, + 33983, 17599, 50367, 9407, 42175, 25791, 58559, 5311, 38079, 21695, 54463, + 13503, 46271, 29887, 62655, 3263, 36031, 19647, 52415, 11455, 44223, 27839, + 60607, 7359, 40127, 23743, 56511, 15551, 48319, 31935, 64703, 703, 33471, + 17087, 49855, 8895, 41663, 25279, 58047, 4799, 37567, 21183, 53951, 12991, + 45759, 29375, 62143, 2751, 35519, 19135, 51903, 10943, 43711, 27327, 60095, + 6847, 39615, 23231, 55999, 15039, 47807, 31423, 64191, 1727, 34495, 18111, + 50879, 9919, 42687, 26303, 59071, 5823, 38591, 22207, 54975, 14015, 46783, + 30399, 63167, 3775, 36543, 20159, 52927, 11967, 44735, 28351, 61119, 7871, + 40639, 24255, 57023, 16063, 48831, 32447, 65215, 447, 33215, 16831, 49599, + 8639, 41407, 25023, 57791, 4543, 37311, 20927, 53695, 12735, 45503, 29119, + 61887, 2495, 35263, 18879, 51647, 10687, 43455, 27071, 59839, 6591, 39359, + 22975, 55743, 14783, 47551, 31167, 63935, 1471, 34239, 17855, 50623, 9663, + 42431, 26047, 58815, 5567, 38335, 21951, 54719, 13759, 46527, 30143, 62911, + 3519, 36287, 19903, 52671, 11711, 44479, 28095, 60863, 7615, 40383, 23999, + 56767, 15807, 48575, 32191, 64959, 959, 33727, 17343, 50111, 9151, 41919, + 25535, 58303, 5055, 37823, 21439, 54207, 13247, 46015, 29631, 62399, 3007, + 35775, 19391, 52159, 11199, 43967, 27583, 60351, 7103, 39871, 23487, 56255, + 15295, 48063, 31679, 64447, 1983, 34751, 18367, 51135, 10175, 42943, 26559, + 59327, 6079, 38847, 22463, 55231, 14271, 47039, 30655, 63423, 4031, 36799, + 20415, 53183, 12223, 44991, 28607, 61375, 8127, 40895, 24511, 57279, 16319, + 49087, 32703, 65471, 127, 32895, 16511, 49279, 8319, 41087, 24703, 57471, + 4223, 36991, 20607, 53375, 12415, 45183, 28799, 61567, 2175, 34943, 18559, + 51327, 10367, 43135, 26751, 59519, 6271, 39039, 22655, 55423, 14463, 47231, + 30847, 63615, 1151, 33919, 17535, 50303, 9343, 42111, 25727, 58495, 5247, + 38015, 21631, 54399, 13439, 46207, 29823, 62591, 3199, 35967, 19583, 52351, + 11391, 44159, 27775, 60543, 7295, 40063, 23679, 56447, 15487, 48255, 31871, + 64639, 639, 33407, 17023, 49791, 8831, 41599, 25215, 57983, 4735, 37503, + 21119, 53887, 12927, 45695, 29311, 62079, 2687, 35455, 19071, 51839, 10879, + 43647, 27263, 60031, 6783, 39551, 23167, 55935, 14975, 47743, 31359, 64127, + 1663, 34431, 18047, 50815, 9855, 42623, 26239, 59007, 5759, 38527, 22143, + 54911, 13951, 46719, 30335, 63103, 3711, 36479, 20095, 52863, 11903, 44671, + 28287, 61055, 7807, 40575, 24191, 56959, 15999, 48767, 32383, 65151, 383, + 33151, 16767, 49535, 8575, 41343, 24959, 57727, 4479, 37247, 20863, 53631, + 12671, 45439, 29055, 61823, 2431, 35199, 18815, 51583, 10623, 43391, 27007, + 59775, 6527, 39295, 22911, 55679, 14719, 47487, 31103, 63871, 1407, 34175, + 17791, 50559, 9599, 42367, 25983, 58751, 5503, 38271, 21887, 54655, 13695, + 46463, 30079, 62847, 3455, 36223, 19839, 52607, 11647, 44415, 28031, 60799, + 7551, 40319, 23935, 56703, 15743, 48511, 32127, 64895, 895, 33663, 17279, + 50047, 9087, 41855, 25471, 58239, 4991, 37759, 21375, 54143, 13183, 45951, + 29567, 62335, 2943, 35711, 19327, 52095, 11135, 43903, 27519, 60287, 7039, + 39807, 23423, 56191, 15231, 47999, 31615, 64383, 1919, 34687, 18303, 51071, + 10111, 42879, 26495, 59263, 6015, 38783, 22399, 55167, 14207, 46975, 30591, + 63359, 3967, 36735, 20351, 53119, 12159, 44927, 28543, 61311, 8063, 40831, + 24447, 57215, 16255, 49023, 32639, 65407, 255, 33023, 16639, 49407, 8447, + 41215, 24831, 57599, 4351, 37119, 20735, 53503, 12543, 45311, 28927, 61695, + 2303, 35071, 18687, 51455, 10495, 43263, 26879, 59647, 6399, 39167, 22783, + 55551, 14591, 47359, 30975, 63743, 1279, 34047, 17663, 50431, 9471, 42239, + 25855, 58623, 5375, 38143, 21759, 54527, 13567, 46335, 29951, 62719, 3327, + 36095, 19711, 52479, 11519, 44287, 27903, 60671, 7423, 40191, 23807, 56575, + 15615, 48383, 31999, 64767, 767, 33535, 17151, 49919, 8959, 41727, 25343, + 58111, 4863, 37631, 21247, 54015, 13055, 45823, 29439, 62207, 2815, 35583, + 19199, 51967, 11007, 43775, 27391, 60159, 6911, 39679, 23295, 56063, 15103, + 47871, 31487, 64255, 1791, 34559, 18175, 50943, 9983, 42751, 26367, 59135, + 5887, 38655, 22271, 55039, 14079, 46847, 30463, 63231, 3839, 36607, 20223, + 52991, 12031, 44799, 28415, 61183, 7935, 40703, 24319, 57087, 16127, 48895, + 32511, 65279, 511, 33279, 16895, 49663, 8703, 41471, 25087, 57855, 4607, + 37375, 20991, 53759, 12799, 45567, 29183, 61951, 2559, 35327, 18943, 51711, + 10751, 43519, 27135, 59903, 6655, 39423, 23039, 55807, 14847, 47615, 31231, + 63999, 1535, 34303, 17919, 50687, 9727, 42495, 26111, 58879, 5631, 38399, + 22015, 54783, 13823, 46591, 30207, 62975, 3583, 36351, 19967, 52735, 11775, + 44543, 28159, 60927, 7679, 40447, 24063, 56831, 15871, 48639, 32255, 65023, + 1023, 33791, 17407, 50175, 9215, 41983, 25599, 58367, 5119, 37887, 21503, + 54271, 13311, 46079, 29695, 62463, 3071, 35839, 19455, 52223, 11263, 44031, + 27647, 60415, 7167, 39935, 23551, 56319, 15359, 48127, 31743, 64511, 2047, + 34815, 18431, 51199, 10239, 43007, 26623, 59391, 6143, 38911, 22527, 55295, + 14335, 47103, 30719, 63487, 4095, 36863, 20479, 53247, 12287, 45055, 28671, + 61439, 8191, 40959, 24575, 57343, 16383, 49151, 32767, 65535}; + +unsigned long long ReverseBits(unsigned long long x) { + const int kMaskSize = 16; + const int kBitMask = 0xFFFF; + return precomputed_reverse[x & kBitMask] << (3 * kMaskSize) | + precomputed_reverse[(x >> kMaskSize) & kBitMask] << (2 * kMaskSize) | + precomputed_reverse[(x >> (2 * kMaskSize)) & kBitMask] << kMaskSize | + precomputed_reverse[(x >> (3 * kMaskSize)) & kBitMask]; +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"x"}; + return GenericTestMain(args, "reverse_bits.tsv", &ReverseBits, + DefaultComparator{}, param_names); +} diff --git a/epi_judge_cpp_solutions/reverse_digits.cc b/epi_judge_cpp_solutions/reverse_digits.cc new file mode 100644 index 000000000..aa1030ff1 --- /dev/null +++ b/epi_judge_cpp_solutions/reverse_digits.cc @@ -0,0 +1,18 @@ +#include +#include "test_framework/generic_test.h" + +long long Reverse(int x) { + long long result = 0, x_remaining = abs(x); + while (x_remaining) { + result = result * 10 + x_remaining % 10; + x_remaining /= 10; + } + return x < 0 ? -result : result; +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"x"}; + return GenericTestMain(args, "reverse_digits.tsv", &Reverse, + DefaultComparator{}, param_names); +} diff --git a/epi_judge_cpp_solutions/reverse_linked_list_iterative.h b/epi_judge_cpp_solutions/reverse_linked_list_iterative.h new file mode 100644 index 000000000..f0ccbf7f4 --- /dev/null +++ b/epi_judge_cpp_solutions/reverse_linked_list_iterative.h @@ -0,0 +1,17 @@ +#include +#include "list_node.h" +#pragma once + +using std::shared_ptr; + +shared_ptr> ReverseLinkedList( + const shared_ptr>& head) { + shared_ptr> prev = nullptr, curr = head; + while (curr) { + auto next = curr->next; + curr->next = prev; + prev = curr; + curr = next; + } + return prev; +} diff --git a/epi_judge_cpp_solutions/reverse_sublist.cc b/epi_judge_cpp_solutions/reverse_sublist.cc new file mode 100644 index 000000000..3e16790b9 --- /dev/null +++ b/epi_judge_cpp_solutions/reverse_sublist.cc @@ -0,0 +1,29 @@ +#include "list_node.h" +#include "test_framework/generic_test.h" + +shared_ptr> ReverseSublist(shared_ptr> L, int start, + int finish) { + auto dummy_head = make_shared>(ListNode{0, L}); + auto sublist_head = dummy_head; + int k = 1; + while (k++ < start) { + sublist_head = sublist_head->next; + } + + // Reverses sublist. + auto sublist_iter = sublist_head->next; + while (start++ < finish) { + auto temp = sublist_iter->next; + sublist_iter->next = temp->next; + temp->next = sublist_head->next; + sublist_head->next = temp; + } + return dummy_head->next; +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"L", "start", "finish"}; + return GenericTestMain(args, "reverse_sublist.tsv", &ReverseSublist, + DefaultComparator{}, param_names); +} diff --git a/epi_judge_cpp_solutions/reverse_words.cc b/epi_judge_cpp_solutions/reverse_words.cc new file mode 100644 index 000000000..e6db826c4 --- /dev/null +++ b/epi_judge_cpp_solutions/reverse_words.cc @@ -0,0 +1,36 @@ +#include +#include + +#include "test_framework/generic_test.h" +#include "test_framework/timed_executor.h" + +using std::string; + +void ReverseWords(string* s) { + // First, reverses the whole string. + reverse(begin(*s), end(*s)); + + size_t start = 0, finish; + while ((finish = s->find(" ", start)) != string::npos) { + // Reverses each word in the string. + reverse(begin(*s) + start, begin(*s) + finish); + start = finish + 1; + } + // Reverses the last word. + reverse(begin(*s) + start, end(*s)); +} + +string ReverseWordsWrapper(TimedExecutor& executor, string s) { + string s_copy = s; + + executor.Run([&] { ReverseWords(&s_copy); }); + + return s_copy; +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"executor", "s"}; + return GenericTestMain(args, "reverse_words.tsv", &ReverseWordsWrapper, + DefaultComparator{}, param_names); +} diff --git a/epi_judge_cpp_solutions/road_network.cc b/epi_judge_cpp_solutions/road_network.cc new file mode 100644 index 000000000..a063440a4 --- /dev/null +++ b/epi_judge_cpp_solutions/road_network.cc @@ -0,0 +1,87 @@ +#include +#include +#include + +#include "test_framework/fmt_print.h" +#include "test_framework/generic_test.h" +#include "test_framework/test_utils_serialization_traits.h" + +using std::max; +using std::min; +using std::numeric_limits; +using std::vector; + +void FloydWarshall(vector>* G_ptr); + +struct HighwaySection { + int x, y, distance; +}; + +HighwaySection FindBestProposals(const vector& H, + const vector& P, int n) { + // graph stores the shortest path distances between all pairs of vertices. + vector> graph(n, vector(n, numeric_limits::max())); + for (int i = 0; i < n; ++i) { + graph[i][i] = 0; + } + // Builds an undirected graph graph based on existing highway sections H. + for (const HighwaySection& h : H) { + graph[h.x][h.y] = graph[h.y][h.x] = h.distance; + } + + // Performs Floyd Warshall to build the shortest path between vertices. + FloydWarshall(&graph); + + // Examines each proposal for shorter distance for all pairs. + int best_distance_saving = numeric_limits::min(); + HighwaySection best_proposal = {-1, -1, 0}; // Default. + for (const HighwaySection& p : P) { + int proposal_saving = 0; + for (int a = 0; a < n; ++a) { + for (int b = 0; b < n; ++b) { + int saving = + graph[a][b] - min(graph[a][p.x] + p.distance + graph[p.y][b], + graph[a][p.y] + p.distance + graph[p.x][b]); + proposal_saving += max(saving, 0); + } + } + if (proposal_saving > best_distance_saving) { + best_distance_saving = proposal_saving; + best_proposal = p; + } + } + return best_proposal; +} + +void FloydWarshall(vector>* G_ptr) { + vector>& graph = *G_ptr; + for (int k = 0; k < size(graph); ++k) { + for (int i = 0; i < size(graph); ++i) { + for (int j = 0; j < size(graph); ++j) { + if (graph[i][k] != numeric_limits::max() && + graph[k][j] != numeric_limits::max()) { + graph[i][j] = min(graph[i][j], graph[i][k] + graph[k][j]); + } + } + } + } +} + +template <> +struct SerializationTraits + : UserSerTraits {}; + +bool operator==(const HighwaySection& lhs, const HighwaySection& rhs) { + return lhs.x == rhs.x && lhs.y == rhs.y && lhs.distance == rhs.distance; +} + +std::ostream& operator<<(std::ostream& out, const HighwaySection& hs) { + return PrintTo(out, std::make_tuple(hs.x, hs.y, hs.distance)); +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"H", "P", "n"}; + return GenericTestMain(args, "road_network.tsv", &FindBestProposals, + DefaultComparator{}, param_names); +} diff --git a/epi_judge_cpp_solutions/roman_to_integer.cc b/epi_judge_cpp_solutions/roman_to_integer.cc new file mode 100644 index 000000000..3ea994ca9 --- /dev/null +++ b/epi_judge_cpp_solutions/roman_to_integer.cc @@ -0,0 +1,28 @@ +#include +#include +#include "test_framework/generic_test.h" + +using std::string; +using std::unordered_map; + +int RomanToInteger(const string& s) { + unordered_map T = {{'I', 1}, {'V', 5}, {'X', 10}, {'L', 50}, + {'C', 100}, {'D', 500}, {'M', 1000}}; + + int sum = T[s.back()]; + for (int i = s.length() - 2; i >= 0; --i) { + if (T[s[i]] < T[s[i + 1]]) { + sum -= T[s[i]]; + } else { + sum += T[s[i]]; + } + } + return sum; +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"s"}; + return GenericTestMain(args, "roman_to_integer.tsv", &RomanToInteger, + DefaultComparator{}, param_names); +} diff --git a/epi_judge_cpp_solutions/rook_attack.cc b/epi_judge_cpp_solutions/rook_attack.cc new file mode 100644 index 000000000..4702c217c --- /dev/null +++ b/epi_judge_cpp_solutions/rook_attack.cc @@ -0,0 +1,55 @@ +#include +#include +#include "test_framework/generic_test.h" + +using std::begin; +using std::end; +using std::vector; + +void RookAttack(vector>* A_ptr) { + vector>& A = *A_ptr; + int m = size(A), n = size(A[0]); + bool has_first_row_zero = find(begin(A[0]), end(A[0]), 0) != end(A[0]); + bool has_first_column_zero = any_of( + begin(A), end(A), [](const vector& row) { return row[0] == 0; }); + + for (int i = 1; i < m; ++i) { + for (int j = 1; j < n; ++j) { + if (!A[i][j]) { + A[i][0] = A[0][j] = 0; + } + } + } + + for (int i = 1; i < m; ++i) { + if (!A[i][0]) { + fill(next(begin(A[i])), end(A[i]), 0); + } + } + + for (int j = 1; j < n; ++j) { + if (!A[0][j]) { + for_each(next(begin(A)), end(A), [j](vector& row) { row[j] = 0; }); + } + } + + if (has_first_row_zero) { + fill(begin(A[0]), end(A[0]), 0); + } + if (has_first_column_zero) { + for_each(begin(A), end(A), [](vector& row) { row[0] = 0; }); + } +} + +vector> RookAttackWrapper(vector> A) { + vector> a_copy = A; + RookAttack(&a_copy); + return a_copy; +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"A"}; + return GenericTestMain(args, "rook_attack.tsv", &RookAttackWrapper, + DefaultComparator{}, param_names); +} diff --git a/epi_judge_cpp_solutions/rotate_array.cc b/epi_judge_cpp_solutions/rotate_array.cc new file mode 100644 index 000000000..d823358f5 --- /dev/null +++ b/epi_judge_cpp_solutions/rotate_array.cc @@ -0,0 +1,27 @@ +#include +#include + +#include "test_framework/generic_test.h" +#include "test_framework/timed_executor.h" + +using std::vector; + +void RotateArray(int rotate_amount, vector* A) { + rotate_amount %= size(*A); + reverse(begin(*A), end(*A)); + reverse(begin(*A), begin(*A) + rotate_amount); + reverse(begin(*A) + rotate_amount, end(*A)); +} + +vector RotateArrayWrapper(TimedExecutor& executor, vector A, + int rotate_amount) { + executor.Run([&] { RotateArray(rotate_amount, &A); }); + return A; +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"executor", "A", "rotate_amount"}; + return GenericTestMain(args, "rotate_array.tsv", &RotateArrayWrapper, + DefaultComparator{}, param_names); +} diff --git a/epi_judge_cpp_solutions/run_length_compression.cc b/epi_judge_cpp_solutions/run_length_compression.cc new file mode 100644 index 000000000..1ec07dd4f --- /dev/null +++ b/epi_judge_cpp_solutions/run_length_compression.cc @@ -0,0 +1,52 @@ +#include +#include + +#include "test_framework/generic_test.h" +#include "test_framework/test_failure.h" + +using std::string; +using std::to_string; + +string Decoding(const string &s) { + int count = 0; + string result; + for (const char &c : s) { + if (isdigit(c)) { + count = count * 10 + c - '0'; + } else { // c is a letter of alphabet. + result.append(count, c); // Appends count copies of c to result. + count = 0; + } + } + return result; +} + +string Encoding(const string &s) { + string result; + for (int i = 1, count = 1; i <= size(s); ++i) { + if (i == size(s) || s[i] != s[i - 1]) { + // Found new character so write the count of previous character. + result += to_string(count) + s[i - 1]; + count = 1; + } else { // s[i] == s[i - 1]. + ++count; + } + } + return result; +} + +void RleTester(const string &encoded, const string &decoded) { + if (Decoding(encoded) != decoded) { + throw TestFailure("Decoding failed"); + } + if (Encoding(decoded) != encoded) { + throw TestFailure("Encoding failed"); + } +} + +int main(int argc, char *argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"encoded", "decoded"}; + return GenericTestMain(args, "run_length_compression.tsv", &RleTester, + DefaultComparator{}, param_names); +} diff --git a/epi_judge_cpp_solutions/search_entry_equal_to_index.cc b/epi_judge_cpp_solutions/search_entry_equal_to_index.cc new file mode 100644 index 000000000..a48de50df --- /dev/null +++ b/epi_judge_cpp_solutions/search_entry_equal_to_index.cc @@ -0,0 +1,50 @@ +#include + +#include "test_framework/generic_test.h" +#include "test_framework/test_failure.h" +#include "test_framework/timed_executor.h" + +using std::vector; + +int SearchEntryEqualToItsIndex(const vector& A) { + int left = 0, right = size(A) - 1; + while (left <= right) { + int mid = left + ((right - left) / 2); + // A[mid] == mid if and only if difference == 0. + if (int difference = A[mid] - mid; difference == 0) { + return mid; + } else if (difference > 0) { + right = mid - 1; + } else { // difference < 0. + left = mid + 1; + } + } + return -1; +} + +void SearchEntryEqualToItsIndexWrapper(TimedExecutor& executor, + const vector& A) { + int result = executor.Run([&] { return SearchEntryEqualToItsIndex(A); }); + + if (result != -1) { + if (A[result] != result) { + throw TestFailure("Entry does not equal to its index"); + } + } else { + for (int i = 0; i < A.size(); ++i) { + if (A[i] == i) { + throw TestFailure("There are entries which equal to its index"); + } + } + } +} + +// clang-format off + + +int main(int argc, char* argv[]) { + std::vector args {argv + 1, argv + argc}; + std::vector param_names {"executor", "A"}; + return GenericTestMain(args, "search_entry_equal_to_index.tsv", &SearchEntryEqualToItsIndexWrapper, DefaultComparator{}, param_names); +} +// clang-format on diff --git a/epi_judge_cpp_solutions/search_first_greater_value_in_bst.cc b/epi_judge_cpp_solutions/search_first_greater_value_in_bst.cc new file mode 100644 index 000000000..f68aa0a75 --- /dev/null +++ b/epi_judge_cpp_solutions/search_first_greater_value_in_bst.cc @@ -0,0 +1,35 @@ +#include + +#include "bst_node.h" +#include "test_framework/generic_test.h" + +using std::unique_ptr; + +BstNode* FindFirstGreaterThanK(const unique_ptr>& tree, + int k) { + BstNode*subtree = tree.get(), *first_so_far = nullptr; + while (subtree) { + if (subtree->data > k) { + first_so_far = subtree; + subtree = subtree->left.get(); + } else { // Root and all keys in left subtree are <= k, so skip them. + subtree = subtree->right.get(); + } + } + return first_so_far; +} + +int FindFirstGreaterThanKWrapper(const unique_ptr>& tree, int k) { + auto result = FindFirstGreaterThanK(tree, k); + return result ? result->data : -1; +} + +// clang-format off + + +int main(int argc, char* argv[]) { + std::vector args {argv + 1, argv + argc}; + std::vector param_names {"tree", "k"}; + return GenericTestMain(args, "search_first_greater_value_in_bst.tsv", &FindFirstGreaterThanKWrapper, DefaultComparator{}, param_names); +} +// clang-format on diff --git a/epi_judge_cpp_solutions/search_first_key.cc b/epi_judge_cpp_solutions/search_first_key.cc new file mode 100644 index 000000000..672b6e7f6 --- /dev/null +++ b/epi_judge_cpp_solutions/search_first_key.cc @@ -0,0 +1,34 @@ +#include +#include +#include "test_framework/generic_test.h" + +using std::vector; + +int SearchFirstOfK(const vector& A, int k) { + int left = 0, right = size(A) - 1, result = -1; + // A[left, right] is the candidate set. + while (left <= right) { + if (int mid = left + ((right - left) / 2); A[mid] > k) { + right = mid - 1; + } else if (A[mid] == k) { + result = mid; + // Nothing to the right of mid can be the first occurrence of k. + right = mid - 1; + } else { // A[mid] < k. + left = mid + 1; + } + } + return result; +} + +int SearchFirstOfKAlternative(const vector& A, int k) { + auto result = std::lower_bound(begin(A), end(A), k); + return *result == k ? distance(begin(A), result) : -1; +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"A", "k"}; + return GenericTestMain(args, "search_first_key.tsv", &SearchFirstOfK, + DefaultComparator{}, param_names); +} diff --git a/epi_judge_cpp_solutions/search_for_min_max_in_array.cc b/epi_judge_cpp_solutions/search_for_min_max_in_array.cc new file mode 100644 index 000000000..0405bccc1 --- /dev/null +++ b/epi_judge_cpp_solutions/search_for_min_max_in_array.cc @@ -0,0 +1,59 @@ +#include +#include +#include +#include + +#include "test_framework/generic_test.h" +#include "test_framework/test_utils_serialization_traits.h" + +using std::max; +using std::min; +using std::minmax; +using std::pair; +using std::tie; +using std::vector; + +struct MinMax { + int smallest, largest; +}; + +MinMax FindMinMax(const vector& A) { + if (size(A) <= 1) { + return {A.front(), A.front()}; + } + + int global_min, global_max; + tie(global_min, global_max) = minmax(A[0], A[1]); + // Process two elements at a time. + for (int i = 2; i + 1 < size(A); i += 2) { + const auto & [ local_min, local_max ] = minmax(A[i], A[i + 1]); + global_min = min(global_min, local_min); + global_max = max(global_max, local_max); + } + // If there is odd number of elements in the array, we still + // need to compare the last element with the existing answer. + if (size(A) % 2) { + global_min = min(global_min, A.back()); + global_max = max(global_max, A.back()); + } + return {global_min, global_max}; +} + +template <> +struct SerializationTraits : UserSerTraits {}; + +bool operator==(const MinMax& lhs, const MinMax& rhs) { + return std::tie(lhs.smallest, lhs.largest) == + std::tie(rhs.smallest, rhs.largest); +} + +std::ostream& operator<<(std::ostream& out, const MinMax& x) { + return out << "min: " << x.smallest << ", max: " << x.largest; +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"A"}; + return GenericTestMain(args, "search_for_min_max_in_array.tsv", &FindMinMax, + DefaultComparator{}, param_names); +} diff --git a/epi_judge_cpp_solutions/search_for_missing_element.cc b/epi_judge_cpp_solutions/search_for_missing_element.cc new file mode 100644 index 000000000..4613bc970 --- /dev/null +++ b/epi_judge_cpp_solutions/search_for_missing_element.cc @@ -0,0 +1,65 @@ +#include + +#include "test_framework/generic_test.h" +#include "test_framework/test_utils_serialization_traits.h" + +using std::vector; + +struct DuplicateAndMissing { + int duplicate, missing; +}; + +DuplicateAndMissing FindDuplicateMissing(const vector& A) { + // Compute the XOR of all numbers from 0 to |A| - 1 and all entries in A. + int miss_XOR_dup = 0; + for (int i = 0; i < size(A); ++i) { + miss_XOR_dup ^= i ^ A[i]; + } + + // We need to find a bit that's set to 1 in miss_XOR_dup. Such a bit + // must exist if there is a single missing number and a single duplicated + // number in A. + // + // The bit-fiddling assignment below sets all of bits in differ_bit to 0 + // except for the least significant bit in miss_XOR_dup that's 1. + int differ_bit = miss_XOR_dup & (~(miss_XOR_dup - 1)); + int miss_or_dup = 0; + for (int i = 0; i < size(A); ++i) { + // Focus on entries and numbers in which the differ_bit-th bit is 1. + if (i & differ_bit) { + miss_or_dup ^= i; + } + if (A[i] & differ_bit) { + miss_or_dup ^= A[i]; + } + } + + // miss_or_dup is either the missing value or the duplicated entry. + if (find(begin(A), end(A), miss_or_dup) != end(A)) { + return {miss_or_dup, miss_or_dup ^ miss_XOR_dup}; + } + // miss_or_dup is the missing value. + return {miss_or_dup ^ miss_XOR_dup, miss_or_dup}; +} + +template <> +struct SerializationTraits + : UserSerTraits {}; + +bool operator==(const DuplicateAndMissing& lhs, + const DuplicateAndMissing& rhs) { + return std::tie(lhs.duplicate, lhs.missing) == + std::tie(rhs.duplicate, rhs.missing); +} + +std::ostream& operator<<(std::ostream& out, const DuplicateAndMissing& x) { + return out << "duplicate: " << x.duplicate << ", missing: " << x.missing; +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"A"}; + return GenericTestMain(args, "find_missing_and_duplicate.tsv", + &FindDuplicateMissing, DefaultComparator{}, + param_names); +} diff --git a/epi_judge_cpp_solutions/search_frequent_items.cc b/epi_judge_cpp_solutions/search_frequent_items.cc new file mode 100644 index 000000000..e52938b20 --- /dev/null +++ b/epi_judge_cpp_solutions/search_frequent_items.cc @@ -0,0 +1,71 @@ +#include +#include +#include +#include +#include +#include "test_framework/generic_test.h" + +using std::for_each; +using std::string; +using std::unordered_map; +using std::vector; + +// Finds the candidates which may occur > n / k times. +vector SearchFrequentItems( + int k, vector::const_iterator stream_begin, + const vector::const_iterator stream_end) { + vector::const_iterator stream_begin_copy = stream_begin; + unordered_map table; + int n = 0; // Count the number of strings. + + while (stream_begin != stream_end) { + ++table[*stream_begin++], ++n; + // Detecting k items in table, at least one of them must have exactly + // one in it. We will discard those k items by one for each. + if (size(table) == k) { + auto it = begin(table); + while (it != end(table)) { + if (--(it->second) == 0) { + table.erase(it++); + } else { + ++it; + } + } + } + } + + // Resets table for the following counting. + for_each(begin(table), end(table), [](auto& it) { it.second = 0; }); + + // Resets the stream and read it again. + stream_begin = stream_begin_copy; + // Counts the occurrence of each candidate word. + while (stream_begin != stream_end) { + if (auto it = table.find(*stream_begin++); it != end(table)) { + ++it->second; + } + } + + // Selects the word which occurs > n / k times. + vector result; + for_each(begin(table), end(table), [&](const auto& it) { + if (it.second > static_cast(n) / k) { + result.emplace_back(it.first); + } + }); + return result; +} + +vector SearchFrequentItemsWrapper(int k, vector& stream) { + return SearchFrequentItems(k, begin(stream), end(stream)); +} + +// clang-format off + + +int main(int argc, char* argv[]) { + std::vector args {argv + 1, argv + argc}; + std::vector param_names {"k", "stream"}; + return GenericTestMain(args, "search_frequent_items.tsv", &SearchFrequentItemsWrapper, &UnorderedComparator>, param_names); +} +// clang-format on diff --git a/epi_judge_cpp_solutions/search_in_list.cc b/epi_judge_cpp_solutions/search_in_list.cc new file mode 100644 index 000000000..3e3f84223 --- /dev/null +++ b/epi_judge_cpp_solutions/search_in_list.cc @@ -0,0 +1,26 @@ +#include + +#include "list_node.h" +#include "test_framework/generic_test.h" + +using std::shared_ptr; + +shared_ptr> SearchList(shared_ptr> L, int key) { + while (L && L->data != key) { + L = L->next; + } + // If key was not present in the list, L will have become null. + return L; +} + +int SearchListWrapper(shared_ptr> L, int key) { + auto result = SearchList(L, key); + return result ? result->data : -1; +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"L", "key"}; + return GenericTestMain(args, "search_in_list.tsv", &SearchListWrapper, + DefaultComparator{}, param_names); +} diff --git a/epi_judge_cpp_solutions/search_maze.cc b/epi_judge_cpp_solutions/search_maze.cc new file mode 100644 index 000000000..ffe023319 --- /dev/null +++ b/epi_judge_cpp_solutions/search_maze.cc @@ -0,0 +1,123 @@ +#include +#include +#include +#include + +#include "test_framework/generic_test.h" +#include "test_framework/test_failure.h" +#include "test_framework/test_utils_serialization_traits.h" +#include "test_framework/timed_executor.h" + +using std::vector; + +typedef enum { kWhite, kBlack } Color; + +struct Coordinate; +bool SearchMazeHelper(const Coordinate&, const Coordinate&, + vector>*, vector*); +bool IsFeasible(const Coordinate&, const vector>&); + +struct Coordinate { + bool operator==(const Coordinate& that) const { + return x == that.x && y == that.y; + } + + int x, y; +}; + +vector SearchMaze(vector> maze, const Coordinate& s, + const Coordinate& e) { + vector path; + SearchMazeHelper(s, e, &maze, &path); + return path; +} + +// Perform DFS to find a feasible path. +bool SearchMazeHelper(const Coordinate& cur, const Coordinate& e, + vector>* maze_ptr, + vector* path_ptr) { + auto& maze = *maze_ptr; + // Checks cur is within maze and is a white pixel. + if (cur.x < 0 || cur.x >= size(maze) || cur.y < 0 || + cur.y >= size(maze[cur.x]) || maze[cur.x][cur.y] != kWhite) { + return false; + } + auto& path = *path_ptr; + path.emplace_back(cur); + maze[cur.x][cur.y] = kBlack; + if (cur == e) { + return true; + } + + for (const Coordinate& next_move : + {Coordinate{cur.x, cur.y + 1}, Coordinate{cur.x, cur.y - 1}, + Coordinate{cur.x + 1, cur.y}, Coordinate{cur.x - 1, cur.y}}) { + if (SearchMazeHelper(next_move, e, maze_ptr, path_ptr)) { + return true; + } + } + // Cannot find a path, remove the entry added in path.emplace_back(cur). + path.pop_back(); + return false; +} + +template <> +struct SerializationTraits : SerializationTraits { + using serialization_type = Color; + + static serialization_type Parse(const std::string& str) { + return static_cast( + SerializationTraits::Parse(str)); + } + + static serialization_type JsonParse(std::istream& in) { + return static_cast( + SerializationTraits::JsonParse(in)); + } +}; + +template <> +struct SerializationTraits : UserSerTraits {}; + +bool PathElementIsFeasible(const vector>& maze, + const Coordinate& prev, const Coordinate& cur) { + if (!(0 <= cur.x && cur.x < maze.size() && 0 <= cur.y && + cur.y < maze[cur.x].size() && maze[cur.x][cur.y] == kWhite)) { + return false; + } + return cur == Coordinate{prev.x + 1, prev.y} || + cur == Coordinate{prev.x - 1, prev.y} || + cur == Coordinate{prev.x, prev.y + 1} || + cur == Coordinate{prev.x, prev.y - 1}; +} + +bool SearchMazeWrapper(TimedExecutor& executor, + const vector>& maze, const Coordinate& s, + const Coordinate& e) { + vector> copy = maze; + + auto path = executor.Run([&] { return SearchMaze(copy, s, e); }); + + if (path.empty()) { + return s == e; + } + + if (!(path.front() == s) || !(path.back() == e)) { + throw TestFailure("Path doesn't lay between start and end points"); + } + + for (size_t i = 1; i < path.size(); i++) { + if (!PathElementIsFeasible(maze, path[i - 1], path[i])) { + throw TestFailure("Path contains invalid segments"); + } + } + + return true; +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"executor", "maze", "s", "e"}; + return GenericTestMain(args, "search_maze.tsv", &SearchMazeWrapper, + DefaultComparator{}, param_names); +} diff --git a/epi_judge_cpp_solutions/search_row_col_sorted_matrix.cc b/epi_judge_cpp_solutions/search_row_col_sorted_matrix.cc new file mode 100644 index 000000000..0828a8212 --- /dev/null +++ b/epi_judge_cpp_solutions/search_row_col_sorted_matrix.cc @@ -0,0 +1,26 @@ +#include +#include "test_framework/generic_test.h" + +using std::vector; + +bool MatrixSearch(const vector>& A, int x) { + int row = 0, col = size(A[0]) - 1; // Start from the top-right corner. + // Keeps searching while there are unclassified rows and columns. + while (row < size(A) && col >= 0) { + if (A[row][col] == x) { + return true; + } else if (A[row][col] < x) { + ++row; // Eliminate this row. + } else { // A[row][col] > x. + --col; // Eliminate this column. + } + } + return false; +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"A", "x"}; + return GenericTestMain(args, "search_row_col_sorted_matrix.tsv", + &MatrixSearch, DefaultComparator{}, param_names); +} diff --git a/epi_judge_cpp_solutions/search_shifted_sorted_array.cc b/epi_judge_cpp_solutions/search_shifted_sorted_array.cc new file mode 100644 index 000000000..97f490d27 --- /dev/null +++ b/epi_judge_cpp_solutions/search_shifted_sorted_array.cc @@ -0,0 +1,26 @@ +#include +#include "test_framework/generic_test.h" + +using std::vector; + +int SearchSmallest(const vector& A) { + int left = 0, right = size(A) - 1; + while (left < right) { + if (int mid = left + ((right - left) / 2); A[mid] > A[right]) { + // Minimum must be in A[mid + 1, right]. + left = mid + 1; + } else { // A[mid] < A[right]. + // Minimum cannot be in A[mid + 1, right] so it must be in A[left, mid]. + right = mid; + } + } + // Loop ends when left == right. + return left; +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"A"}; + return GenericTestMain(args, "search_shifted_sorted_array.tsv", + &SearchSmallest, DefaultComparator{}, param_names); +} diff --git a/epi_judge_cpp_solutions/search_unknown_length_array.cc b/epi_judge_cpp_solutions/search_unknown_length_array.cc new file mode 100644 index 000000000..e62be0ae1 --- /dev/null +++ b/epi_judge_cpp_solutions/search_unknown_length_array.cc @@ -0,0 +1,52 @@ +#include +#include +#include "test_framework/generic_test.h" + +using std::exception; +using std::max; +using std::vector; + +int BinarySearchUnknownLength(const vector& A, int k) { + // Find the possible range where k exists. + int p = 0; + while (true) { + try { + if (int idx = (1 << p) - 1; A.at(idx) == k) { + return idx; + } else if (A.at(idx) > k) { + break; + } + } catch (const exception& e) { + break; + } + ++p; + } + + // Binary search between indices 2^(p - 1) and 2^p - 2, inclusive. + int left = max(0, 1 << (p - 1)), right = (1 << p) - 2; + while (left <= right) { + int mid = left + ((right - left) / 2); + try { + if (A.at(mid) == k) { + return mid; + } else if (A.at(mid) > k) { + right = mid - 1; + } else { // A.at(mid) < k + left = mid + 1; + } + } catch (const exception& e) { + right = mid - 1; // Search the left part if out-of-bound. + } + } + return -1; // Nothing matched k. +} + +// clang-format off + + +int main(int argc, char* argv[]) { + std::vector args {argv + 1, argv + argc}; + std::vector param_names {"A", "k"}; + return GenericTestMain(args, "search_unknown_length_array.tsv", &BinarySearchUnknownLength, DefaultComparator{}, param_names); +} +// clang-format on diff --git a/epi_judge_cpp_solutions/smallest_nonconstructible_value.cc b/epi_judge_cpp_solutions/smallest_nonconstructible_value.cc new file mode 100644 index 000000000..a0b5530dd --- /dev/null +++ b/epi_judge_cpp_solutions/smallest_nonconstructible_value.cc @@ -0,0 +1,28 @@ +#include +#include +#include +#include "test_framework/generic_test.h" + +using std::vector; + +int SmallestNonconstructibleValue(vector A) { + sort(begin(A), end(A)); + int max_constructible_value = 0; + for (int a : A) { + if (a > max_constructible_value + 1) { + break; + } + max_constructible_value += a; + } + return max_constructible_value + 1; +} + +// clang-format off + + +int main(int argc, char* argv[]) { + std::vector args {argv + 1, argv + argc}; + std::vector param_names {"A"}; + return GenericTestMain(args, "smallest_nonconstructible_value.tsv", &SmallestNonconstructibleValue, DefaultComparator{}, param_names); +} +// clang-format on diff --git a/epi_judge_cpp_solutions/smallest_subarray_covering_all_values.cc b/epi_judge_cpp_solutions/smallest_subarray_covering_all_values.cc new file mode 100644 index 000000000..d687a2db8 --- /dev/null +++ b/epi_judge_cpp_solutions/smallest_subarray_covering_all_values.cc @@ -0,0 +1,102 @@ +#include +#include +#include +#include + +#include "test_framework/generic_test.h" +#include "test_framework/test_failure.h" +#include "test_framework/timed_executor.h" + +using std::numeric_limits; +using std::string; +using std::unordered_map; +using std::vector; + +struct Subarray { + // Represent subarray by starting and ending indices, inclusive. + int start, end; +}; + +Subarray FindSmallestSequentiallyCoveringSubset( + const vector& paragraph, const vector& keywords) { + // Maps each keyword to its index in the keywords array. + unordered_map keyword_to_idx; + // Initializes keyword_to_idx. + for (int i = 0; i < size(keywords); ++i) { + keyword_to_idx.emplace(keywords[i], i); + } + + // Since keywords are uniquely identified by their indices in keywords + // array, we can use those indices as keys to lookup in a vector. + vector latest_occurrence(size(keywords), -1); + // For each keyword (identified by its index in keywords array), storesult + // the length of the shortest subarray ending at the most recent occurrence + // of that keyword that sequentially cover all keywords up to that keyword. + vector shortest_subarray_length(size(keywords), + numeric_limits::max()); + + int shortest_distance = numeric_limits::max(); + Subarray result = Subarray{-1, -1}; + for (int i = 0; i < size(paragraph); ++i) { + if (keyword_to_idx.count(paragraph[i])) { + int keyword_idx = keyword_to_idx.find(paragraph[i])->second; + if (keyword_idx == 0) { // First keyword. + shortest_subarray_length[keyword_idx] = 1; + } else if (shortest_subarray_length[keyword_idx - 1] != + numeric_limits::max()) { + int distance_to_previous_keyword = + i - latest_occurrence[keyword_idx - 1]; + shortest_subarray_length[keyword_idx] = + distance_to_previous_keyword + + shortest_subarray_length[keyword_idx - 1]; + } + latest_occurrence[keyword_idx] = i; + + // Last keyword, look for improved subarray. + if (keyword_idx == size(keywords) - 1 && + shortest_subarray_length.back() < shortest_distance) { + shortest_distance = shortest_subarray_length.back(); + result = {i - shortest_subarray_length.back() + 1, i}; + } + } + } + return result; +} + +int FindSmallestSequentiallyCoveringSubsetWrapper( + TimedExecutor& executor, const vector& paragraph, + const vector& keywords) { + auto result = executor.Run([&] { + return FindSmallestSequentiallyCoveringSubset(paragraph, keywords); + }); + + int kw_idx = 0; + if (result.start < 0) { + throw TestFailure("Subarray start index is negative"); + } + int para_idx = result.start; + + while (kw_idx < keywords.size()) { + if (para_idx >= paragraph.size()) { + throw TestFailure("Not all keywords are in the generated subarray"); + } + if (para_idx >= paragraph.size()) { + throw TestFailure("Subarray end index exceeds array size"); + } + if (paragraph[para_idx] == keywords[kw_idx]) { + kw_idx++; + } + para_idx++; + } + return result.end - result.start + 1; +} + +// clang-format off + + +int main(int argc, char* argv[]) { + std::vector args {argv + 1, argv + argc}; + std::vector param_names {"executor", "paragraph", "keywords"}; + return GenericTestMain(args, "smallest_subarray_covering_all_values.tsv", &FindSmallestSequentiallyCoveringSubsetWrapper, DefaultComparator{}, param_names); +} +// clang-format on diff --git a/epi_judge_cpp_solutions/smallest_subarray_covering_set.cc b/epi_judge_cpp_solutions/smallest_subarray_covering_set.cc new file mode 100644 index 000000000..521f17c92 --- /dev/null +++ b/epi_judge_cpp_solutions/smallest_subarray_covering_set.cc @@ -0,0 +1,83 @@ +#include +#include +#include +#include + +#include "test_framework/generic_test.h" +#include "test_framework/test_failure.h" +#include "test_framework/timed_executor.h" + +using std::string; +using std::unordered_map; +using std::unordered_set; +using std::vector; + +struct Subarray { + int start, end; +}; + +Subarray FindSmallestSubarrayCoveringSet( + const vector ¶graph, const unordered_set &keywords) { + unordered_map keywords_to_cover; + for (const string &keyword : keywords) { + ++keywords_to_cover[keyword]; + } + + Subarray result = Subarray{-1, -1}; + int remaining_to_cover = size(keywords); + for (int left = 0, right = 0; right < size(paragraph); ++right) { + if (keywords.count(paragraph[right]) && + --keywords_to_cover[paragraph[right]] >= 0) { + --remaining_to_cover; + } + + // Keeps advancing left until keywords_to_cover does not contain all + // keywords. + while (remaining_to_cover == 0) { + if ((result.start == -1 && result.end == -1) || + right - left < result.end - result.start) { + result = {left, right}; + } + if (keywords.count(paragraph[left]) && + ++keywords_to_cover[paragraph[left]] > 0) { + ++remaining_to_cover; + } + ++left; + } + } + return result; +} + +int FindSmallestSubarrayCoveringSetWrapper( + TimedExecutor &executor, const vector ¶graph, + const unordered_set &keywords) { + unordered_set copy = keywords; + + auto result = executor.Run( + [&] { return FindSmallestSubarrayCoveringSet(paragraph, keywords); }); + + if (result.start < 0 || result.start >= paragraph.size() || result.end < 0 || + result.end >= paragraph.size() || result.start > result.end) { + throw TestFailure("Index out of range"); + } + + for (int i = result.start; i <= result.end; i++) { + copy.erase(paragraph[i]); + } + + if (!copy.empty()) { + throw TestFailure("Not all keywords are in the range"); + } + + return result.end - result.start + 1; +} + +// clang-format off + + +int main(int argc, char* argv[]) { + std::vector args {argv + 1, argv + argc}; + std::vector param_names {"executor", "paragraph", "keywords"}; + return GenericTestMain(args, "smallest_subarray_covering_set.tsv", &FindSmallestSubarrayCoveringSetWrapper, DefaultComparator{}, param_names); +} +// clang-format on diff --git a/epi_judge_cpp_solutions/snake_string.cc b/epi_judge_cpp_solutions/snake_string.cc new file mode 100644 index 000000000..64bf74932 --- /dev/null +++ b/epi_judge_cpp_solutions/snake_string.cc @@ -0,0 +1,28 @@ +#include +#include "test_framework/generic_test.h" + +using std::string; + +string SnakeString(const string& s) { + string result; + // Outputs the first row, i.e., s[1], s[5], s[9], ... + for (int i = 1; i < size(s); i += 4) { + result += s[i]; + } + // Outputs the second row, i.e., s[0], s[2], s[4], ... + for (int i = 0; i < size(s); i += 2) { + result += s[i]; + } + // Outputs the third row, i.e., s[3], s[7], s[11], ... + for (int i = 3; i < size(s); i += 4) { + result += s[i]; + } + return result; +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"s"}; + return GenericTestMain(args, "snake_string.tsv", &SnakeString, + DefaultComparator{}, param_names); +} diff --git a/epi_judge_cpp_solutions/sort_almost_sorted_array.cc b/epi_judge_cpp_solutions/sort_almost_sorted_array.cc new file mode 100644 index 000000000..32b6301c4 --- /dev/null +++ b/epi_judge_cpp_solutions/sort_almost_sorted_array.cc @@ -0,0 +1,52 @@ +#include +#include +#include +#include +#include "test_framework/generic_test.h" + +using std::greater; +using std::priority_queue; +using std::string; +using std::vector; + +vector SortApproximatelySortedData( + vector::const_iterator sequence_begin, + const vector::const_iterator& sequence_end, int k) { + priority_queue, greater<>> min_heap; + // Adds the first k elements into min_heap. Stop if there are fewer than k + // elements. + for (int i = 0; i < k && sequence_begin != sequence_end; ++i) { + min_heap.push(*sequence_begin++); + } + + vector result; + // For every new element, add it to min_heap and extract the smallest. + while (sequence_begin != sequence_end) { + min_heap.push(*sequence_begin++); + result.push_back(min_heap.top()); + min_heap.pop(); + } + + // sequence is exhausted, iteratively extracts the remaining elements. + while (!empty(min_heap)) { + result.push_back(min_heap.top()); + min_heap.pop(); + } + + return result; +} + +vector SortApproximatelySortedDataWrapper(const vector& sequence, + int k) { + return SortApproximatelySortedData(cbegin(sequence), cend(sequence), k); +} + +// clang-format off + + +int main(int argc, char* argv[]) { + std::vector args {argv + 1, argv + argc}; + std::vector param_names {"sequence", "k"}; + return GenericTestMain(args, "sort_almost_sorted_array.tsv", &SortApproximatelySortedDataWrapper, DefaultComparator{}, param_names); +} +// clang-format on diff --git a/epi_judge_cpp_solutions/sort_increasing_decreasing_array.cc b/epi_judge_cpp_solutions/sort_increasing_decreasing_array.cc new file mode 100644 index 000000000..31889cb52 --- /dev/null +++ b/epi_judge_cpp_solutions/sort_increasing_decreasing_array.cc @@ -0,0 +1,42 @@ +#include + +#define main _main +#include "sorted_arrays_merge.cc" +#undef main +#include "test_framework/generic_test.h" + +using std::vector; + +vector SortKIncreasingDecreasingArray(const vector& A) { + // Decomposes A into a set of sorted arrays. + vector> sorted_subarrays; + typedef enum { kIncreasing, kDecreasing } SubarrayType; + SubarrayType subarray_type = kIncreasing; + int start_idx = 0; + for (int i = 1; i <= size(A); ++i) { + if (i == size(A) || // A is ended. Adds the last subarray. + (A[i - 1] < A[i] && subarray_type == kDecreasing) || + (A[i - 1] >= A[i] && subarray_type == kIncreasing)) { + if (subarray_type == kIncreasing) { + sorted_subarrays.emplace_back(cbegin(A) + start_idx, cbegin(A) + i); + } else { + sorted_subarrays.emplace_back(crbegin(A) + size(A) - i, + crbegin(A) + size(A) - start_idx); + } + start_idx = i; + subarray_type = subarray_type == kIncreasing ? kDecreasing : kIncreasing; + } + } + + return MergeSortedArrays(sorted_subarrays); +} + +// clang-format off + + +int main(int argc, char* argv[]) { + std::vector args {argv + 1, argv + argc}; + std::vector param_names {"A"}; + return GenericTestMain(args, "sort_increasing_decreasing_array.tsv", &SortKIncreasingDecreasingArray, DefaultComparator{}, param_names); +} +// clang-format on diff --git a/epi_judge_cpp_solutions/sort_list.cc b/epi_judge_cpp_solutions/sort_list.cc new file mode 100644 index 000000000..e64b680af --- /dev/null +++ b/epi_judge_cpp_solutions/sort_list.cc @@ -0,0 +1,32 @@ +#include + +#include "list_node.h" +#define main _main +#include "sorted_lists_merge.cc" +#undef main +#include "test_framework/generic_test.h" + +shared_ptr> StableSortList(shared_ptr> L) { + // Base cases: L is empty or a single node, nothing to do. + if (L == nullptr || L->next == nullptr) { + return L; + } + + // Find the midpoint of L using a slow and a fast pointer. + shared_ptr> pre_slow = nullptr, slow = L, fast = L; + while (fast && fast->next) { + pre_slow = slow; + fast = fast->next->next, slow = slow->next; + } + + pre_slow->next = nullptr; // Splits the list into two equal-sized lists. + + return MergeTwoSortedLists(StableSortList(L), StableSortList(slow)); +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"L"}; + return GenericTestMain(args, "sort_list.tsv", &StableSortList, + DefaultComparator{}, param_names); +} diff --git a/epi_judge_cpp_solutions/sorted_array_remove_dups.cc b/epi_judge_cpp_solutions/sorted_array_remove_dups.cc new file mode 100644 index 000000000..74bc8c01f --- /dev/null +++ b/epi_judge_cpp_solutions/sorted_array_remove_dups.cc @@ -0,0 +1,38 @@ +#include + +#include "test_framework/generic_test.h" +#include "test_framework/timed_executor.h" + +using std::vector; + +// Returns the number of valid entries after deletion. +int DeleteDuplicates(vector* A_ptr) { + vector& A = *A_ptr; + if (empty(A)) { + return 0; + } + + int write_index = 1; + for (int i = 1; i < size(A); ++i) { + if (A[write_index - 1] != A[i]) { + A[write_index++] = A[i]; + } + } + return write_index; +} + +vector DeleteDuplicatesWrapper(TimedExecutor& executor, vector A) { + int end = executor.Run([&] { return DeleteDuplicates(&A); }); + A.resize(end); + return A; +} + +// clang-format off + + +int main(int argc, char* argv[]) { + std::vector args {argv + 1, argv + argc}; + std::vector param_names {"executor", "A"}; + return GenericTestMain(args, "sorted_array_remove_dups.tsv", &DeleteDuplicatesWrapper, DefaultComparator{}, param_names); +} +// clang-format on diff --git a/epi_judge_cpp_solutions/sorted_arrays_merge.cc b/epi_judge_cpp_solutions/sorted_arrays_merge.cc new file mode 100644 index 000000000..bb63cf0d8 --- /dev/null +++ b/epi_judge_cpp_solutions/sorted_arrays_merge.cc @@ -0,0 +1,51 @@ +#include +#include +#include +#include +#include "test_framework/generic_test.h" + +using std::greater; +using std::next; +using std::priority_queue; +using std::vector; + +struct IteratorCurrentAndEnd { + bool operator>(const IteratorCurrentAndEnd& that) const { + return *current > *that.current; + } + + vector::const_iterator current; + vector::const_iterator end; +}; + +vector MergeSortedArrays(const vector>& sorted_arrays) { + priority_queue, + greater<>> + min_heap; + + for (const vector& sorted_array : sorted_arrays) { + if (!empty(sorted_array)) { + min_heap.emplace( + IteratorCurrentAndEnd{cbegin(sorted_array), cend(sorted_array)}); + } + } + + vector result; + while (!empty(min_heap)) { + IteratorCurrentAndEnd smallest_array = min_heap.top(); + min_heap.pop(); + result.emplace_back(*smallest_array.current); + if (next(smallest_array.current) != smallest_array.end) { + min_heap.emplace(IteratorCurrentAndEnd{next(smallest_array.current), + smallest_array.end}); + } + } + return result; +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"sorted_arrays"}; + return GenericTestMain(args, "sorted_arrays_merge.tsv", &MergeSortedArrays, + DefaultComparator{}, param_names); +} diff --git a/epi_judge_cpp_solutions/sorted_list_to_bst.cc b/epi_judge_cpp_solutions/sorted_list_to_bst.cc new file mode 100644 index 000000000..694a9c9ff --- /dev/null +++ b/epi_judge_cpp_solutions/sorted_list_to_bst.cc @@ -0,0 +1,97 @@ +#include +#include +#include + +#include "doubly_list_node.h" +#include "test_framework/generic_test.h" +#include "test_framework/test_failure.h" +#include "test_framework/timed_executor.h" + +using std::make_shared; +using std::vector; + +shared_ptr> BuildBSTFromSortedDoublyListHelper( + shared_ptr>*, int, int); + +// Returns the root of the corresponding BST. The prev and next fields of the +// list nodes are used as the BST nodes left and right fields, respectively. +// The length of the list is given. +shared_ptr> BuildBSTFromSortedDoublyList( + shared_ptr> l, int length) { + return BuildBSTFromSortedDoublyListHelper(&l, 0, length); +} + +// Builds a BST from the (start + 1)-th to the end-th node, inclusive, in l, +// and returns the root. +shared_ptr> BuildBSTFromSortedDoublyListHelper( + shared_ptr>* l_ptr, int start, int end) { + if (start >= end) { + return nullptr; + } + + int mid = start + ((end - start) / 2); + auto left = BuildBSTFromSortedDoublyListHelper(l_ptr, start, mid); + // The last function call sets l_ptr to the successor of the maximum node in + // the tree rooted at left. + auto curr = *l_ptr; + *l_ptr = (*l_ptr)->next; + curr->prev = left; + curr->next = BuildBSTFromSortedDoublyListHelper(l_ptr, mid + 1, end); + return curr; +} + +void CompareVectorAndTree(const shared_ptr>& tree, + vector::const_iterator& current, + const vector::const_iterator& end) { + if (!tree) { + return; + } + + CompareVectorAndTree(tree->prev, current, end); + + if (current == end) { + throw TestFailure("Too few values in the tree"); + } + if (*current != tree->data) { + throw TestFailure("Unexpected value"); + } + ++current; + + CompareVectorAndTree(tree->next, current, end); +} + +void BuildBSTFromSortedDoublyListWrapper(TimedExecutor& executor, + const vector& l) { + shared_ptr> input_list; + for (auto it = rbegin(l); it != rend(l); ++it) { + input_list = make_shared>(*it, nullptr, input_list); + if (input_list->next) { + input_list->next->prev = input_list; + } + } + + input_list = executor.Run([&] { + return BuildBSTFromSortedDoublyList(input_list, static_cast(l.size())); + }); + + auto current = begin(l); + CompareVectorAndTree(input_list, current, end(l)); + if (current != end(l)) { + throw TestFailure("Too many values in the tree"); + } + + while (input_list) { + input_list->prev.reset(); + input_list = input_list->next; + } +} + +// clang-format off + + +int main(int argc, char* argv[]) { + std::vector args {argv + 1, argv + argc}; + std::vector param_names {"executor", "l"}; + return GenericTestMain(args, "sorted_list_to_bst.tsv", &BuildBSTFromSortedDoublyListWrapper, DefaultComparator{}, param_names); +} +// clang-format on diff --git a/epi_judge_cpp_solutions/sorted_lists_merge.cc b/epi_judge_cpp_solutions/sorted_lists_merge.cc new file mode 100644 index 000000000..cd5236acc --- /dev/null +++ b/epi_judge_cpp_solutions/sorted_lists_merge.cc @@ -0,0 +1,33 @@ +#include "list_node.h" +#include "test_framework/generic_test.h" + +void AppendNode(shared_ptr> *, shared_ptr> *); + +shared_ptr> MergeTwoSortedLists(shared_ptr> L1, + shared_ptr> L2) { + // Creates a placeholder for the result. + shared_ptr> dummy_head(new ListNode); + auto tail = dummy_head; + + while (L1 && L2) { + AppendNode(L1->data <= L2->data ? &L1 : &L2, &tail); + } + + // Appends the remaining nodes of L1 or L2. + tail->next = L1 ? L1 : L2; + return dummy_head->next; +} + +void AppendNode(shared_ptr> *node, + shared_ptr> *tail) { + (*tail)->next = *node; + *tail = *node; // Updates tail. + *node = (*node)->next; +} + +int main(int argc, char *argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"L1", "L2"}; + return GenericTestMain(args, "sorted_lists_merge.tsv", &MergeTwoSortedLists, + DefaultComparator{}, param_names); +} diff --git a/epi_judge_cpp_solutions/spiral_ordering_segments.cc b/epi_judge_cpp_solutions/spiral_ordering_segments.cc new file mode 100644 index 000000000..1a03abf04 --- /dev/null +++ b/epi_judge_cpp_solutions/spiral_ordering_segments.cc @@ -0,0 +1,33 @@ +#include +#include +#include "test_framework/generic_test.h" + +using std::array; +using std::vector; + +vector MatrixInSpiralOrder(vector> square_matrix) { + const array, 4> kShift = {{{0, 1}, {1, 0}, {0, -1}, {-1, 0}}}; + int dir = 0, x = 0, y = 0; + vector spiral_ordering; + + for (int i = 0; i < size(square_matrix) * size(square_matrix); ++i) { + spiral_ordering.emplace_back(square_matrix[x][y]); + square_matrix[x][y] = 0; + int next_x = x + kShift[dir][0], next_y = y + kShift[dir][1]; + if (next_x < 0 || next_x >= size(square_matrix) || next_y < 0 || + next_y >= size(square_matrix) || square_matrix[next_x][next_y] == 0) { + dir = (dir + 1) % 4; + next_x = x + kShift[dir][0], next_y = y + kShift[dir][1]; + } + x = next_x, y = next_y; + } + return spiral_ordering; +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"square_matrix"}; + return GenericTestMain(args, "spiral_ordering_segments.tsv", + &MatrixInSpiralOrder, DefaultComparator{}, + param_names); +} diff --git a/epi_judge_cpp_solutions/spreadsheet_encoding.cc b/epi_judge_cpp_solutions/spreadsheet_encoding.cc new file mode 100644 index 000000000..ac9057997 --- /dev/null +++ b/epi_judge_cpp_solutions/spreadsheet_encoding.cc @@ -0,0 +1,19 @@ +#include +#include +#include "test_framework/generic_test.h" + +using std::accumulate; +using std::string; + +int SSDecodeColID(const string& col) { + return accumulate(begin(col), end(col), 0, [](int result, char c) { + return result * 26 + c - 'A' + 1; + }); +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"col"}; + return GenericTestMain(args, "spreadsheet_encoding.tsv", &SSDecodeColID, + DefaultComparator{}, param_names); +} diff --git a/epi_judge_cpp_solutions/stack_with_max.cc b/epi_judge_cpp_solutions/stack_with_max.cc new file mode 100644 index 000000000..2e7c9fc8d --- /dev/null +++ b/epi_judge_cpp_solutions/stack_with_max.cc @@ -0,0 +1,94 @@ +#include +#include +#include + +#include "test_framework/generic_test.h" +#include "test_framework/test_failure.h" +#include "test_framework/test_utils_serialization_traits.h" + +using std::length_error; +using std::max; +using std::stack; + +class Stack { + public: + bool Empty() const { return empty(element_with_cached_max_); } + + int Max() const { + if (Empty()) { + throw length_error("Max(): empty stack"); + } + return element_with_cached_max_.top().max; + } + + int Pop() { + if (Empty()) { + throw length_error("Pop(): empty stack"); + } + int pop_element = element_with_cached_max_.top().element; + element_with_cached_max_.pop(); + return pop_element; + } + + void Push(int x) { + element_with_cached_max_.emplace( + ElementWithCachedMax{x, max(x, Empty() ? x : Max())}); + } + + private: + struct ElementWithCachedMax { + int element, max; + }; + stack element_with_cached_max_; +}; + +struct StackOp { + std::string op; + int argument; +}; + +template <> +struct SerializationTraits : UserSerTraits { +}; + +void StackTester(const std::vector& ops) { + try { + Stack s; + for (auto& x : ops) { + if (x.op == "Stack") { + continue; + } else if (x.op == "push") { + s.Push(x.argument); + } else if (x.op == "pop") { + int result = s.Pop(); + if (result != x.argument) { + throw TestFailure("Pop: expected " + std::to_string(x.argument) + + ", got " + std::to_string(result)); + } + } else if (x.op == "max") { + int result = s.Max(); + if (result != x.argument) { + throw TestFailure("Max: expected " + std::to_string(x.argument) + + ", got " + std::to_string(result)); + } + } else if (x.op == "empty") { + int result = s.Empty(); + if (result != x.argument) { + throw TestFailure("Empty: expected " + std::to_string(x.argument) + + ", got " + std::to_string(result)); + } + } else { + throw std::runtime_error("Unsupported stack operation: " + x.op); + } + } + } catch (length_error&) { + throw TestFailure("Unexpected length_error exception"); + } +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"ops"}; + return GenericTestMain(args, "stack_with_max.tsv", &StackTester, + DefaultComparator{}, param_names); +} diff --git a/epi_judge_cpp_solutions/string_decompositions_into_dictionary_words.cc b/epi_judge_cpp_solutions/string_decompositions_into_dictionary_words.cc new file mode 100644 index 000000000..1c39dd4d8 --- /dev/null +++ b/epi_judge_cpp_solutions/string_decompositions_into_dictionary_words.cc @@ -0,0 +1,56 @@ +#include +#include +#include +#include "test_framework/generic_test.h" + +using std::string; +using std::unordered_map; +using std::vector; + +bool MatchAllWordsInDict(const string&, const unordered_map&, int, + int, int); + +vector FindAllSubstrings(const string& s, const vector& words) { + unordered_map word_to_freq; + for (const string& word : words) { + ++word_to_freq[word]; + } + + int unit_size = size(words.front()); + vector result; + for (int i = 0; i + unit_size * size(words) <= size(s); ++i) { + if (MatchAllWordsInDict(s, word_to_freq, i, size(words), unit_size)) { + result.emplace_back(i); + } + } + return result; +} + +bool MatchAllWordsInDict(const string& s, + const unordered_map& word_to_freq, + int start, int num_words, int unit_size) { + unordered_map curr_string_to_freq; + for (int i = 0; i < num_words; ++i) { + string curr_word = s.substr(start + i * unit_size, unit_size); + if (auto iter = word_to_freq.find(curr_word); iter == end(word_to_freq)) { + return false; + } else { + ++curr_string_to_freq[curr_word]; + if (curr_string_to_freq[curr_word] > iter->second) { + // curr_word occurs too many times for a match to be possible. + return false; + } + } + } + return true; +} + +// clang-format off + + +int main(int argc, char* argv[]) { + std::vector args {argv + 1, argv + argc}; + std::vector param_names {"s", "words"}; + return GenericTestMain(args, "string_decompositions_into_dictionary_words.tsv", &FindAllSubstrings, DefaultComparator{}, param_names); +} +// clang-format on diff --git a/epi_judge_cpp_solutions/string_integer_interconversion.cc b/epi_judge_cpp_solutions/string_integer_interconversion.cc new file mode 100644 index 000000000..d7e5df6ad --- /dev/null +++ b/epi_judge_cpp_solutions/string_integer_interconversion.cc @@ -0,0 +1,49 @@ +#include +#include + +#include "test_framework/generic_test.h" +#include "test_framework/test_failure.h" + +using std::accumulate; +using std::string; + +string IntToString(int x) { + bool is_negative = false; + if (x < 0) { + is_negative = true; + } + + string s; + do { + s += '0' + abs(x % 10); + x /= 10; + } while (x); + + s += is_negative ? "-" : ""; // Adds the negative sign back if is_negative. + return {rbegin(s), rend(s)}; +} + +int StringToInt(const string& s) { + return (s[0] == '-' ? -1 : 1) * accumulate(begin(s) + (s[0] == '-'), end(s), + 0, [](int running_sum, char c) { + return running_sum * 10 + c - + '0'; + }); +} + +void Wrapper(int x, const string& s) { + if (IntToString(x) != s) { + throw TestFailure("Int to string conversion failed"); + } + + if (StringToInt(s) != x) { + throw TestFailure("String to int conversion failed"); + } +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"x", "s"}; + return GenericTestMain(args, "string_integer_interconversion.tsv", &Wrapper, + DefaultComparator{}, param_names); +} diff --git a/epi_judge_cpp_solutions/string_transformability.cc b/epi_judge_cpp_solutions/string_transformability.cc new file mode 100644 index 000000000..c8188dd55 --- /dev/null +++ b/epi_judge_cpp_solutions/string_transformability.cc @@ -0,0 +1,51 @@ +#include +#include +#include +#include +#include "test_framework/generic_test.h" + +using std::queue; +using std::string; +using std::unordered_set; + +// Uses BFS to find the least steps of transformation. +int TransformString(unordered_set D, const string& s, const string& t) { + struct StringWithDistance { + string candidate_string; + int distance; + }; + queue q; + D.erase(s); // Marks s as visited by erasing it in D. + q.emplace(StringWithDistance{s, 0}); + + while (!empty(q)) { + StringWithDistance f(q.front()); + // Returns if we find a match. + if (f.candidate_string == t) { + return f.distance; // Number of steps reaches t. + } + + // Tries all possible transformations of f.candidate_string. + string str = f.candidate_string; + for (int i = 0; i < size(str); ++i) { + for (int c = 0; c < 26; ++c) { // Iterates through 'a' ~ 'z'. + str[i] = 'a' + c; + if (auto it = D.find(str); it != end(D)) { + D.erase(it); + q.emplace(StringWithDistance{str, f.distance + 1}); + } + } + str[i] = f.candidate_string[i]; // Reverts the change of str. + } + q.pop(); + } + + return -1; // Cannot find a possible transformations. +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"D", "s", "t"}; + return GenericTestMain(args, "string_transformability.tsv", &TransformString, + DefaultComparator{}, param_names); +} diff --git a/epi_judge_cpp_solutions/substring_match.cc b/epi_judge_cpp_solutions/substring_match.cc new file mode 100644 index 000000000..2e3444ca0 --- /dev/null +++ b/epi_judge_cpp_solutions/substring_match.cc @@ -0,0 +1,46 @@ +#include +#include "test_framework/generic_test.h" + +using std::string; + +// Returns the index of the first character of the substring if found, -1 +// otherwise. +int RabinKarp(const string &t, const string &s) { + if (size(s) > size(t)) { + return -1; // s is not a substring of t. + } + + const int kBase = 26; + int t_hash = 0, s_hash = 0; // Hash codes for the substring of t and s. + int power_s = 1; // kBase^|s-1|. + for (int i = 0; i < size(s); ++i) { + power_s = i ? power_s * kBase : 1; + t_hash = t_hash * kBase + t[i]; + s_hash = s_hash * kBase + s[i]; + } + + for (int i = size(s); i < size(t); ++i) { + // Checks the two substrings are actually equal or not, to protect + // against hash collision. + if (t_hash == s_hash && !t.compare(i - size(s), size(s), s)) { + return i - size(s); // Found a match. + } + + // Uses rolling hash to compute the new hash code. + t_hash -= t[i - size(s)] * power_s; + t_hash = t_hash * kBase + t[i]; + } + + // Tries to match s and t[size(t) - size(s), size(t) - 1]. + if (t_hash == s_hash && t.compare(size(t) - size(s), size(s), s) == 0) { + return size(t) - size(s); + } + return -1; // s is not a substring of t. +} + +int main(int argc, char *argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"t", "s"}; + return GenericTestMain(args, "substring_match.tsv", &RabinKarp, + DefaultComparator{}, param_names); +} diff --git a/epi_judge_cpp_solutions/successor_in_tree.cc b/epi_judge_cpp_solutions/successor_in_tree.cc new file mode 100644 index 000000000..b4258b4e6 --- /dev/null +++ b/epi_judge_cpp_solutions/successor_in_tree.cc @@ -0,0 +1,37 @@ +#include "binary_tree_with_parent_prototype.h" +#include "test_framework/binary_tree_utils.h" +#include "test_framework/generic_test.h" + +BinaryTreeNode* FindSuccessor( + const unique_ptr>& node) { + auto* iter = node.get(); + if (iter->right != nullptr) { + // Successor is the leftmost element in node's right subtree. + iter = iter->right.get(); + while (iter->left) { + iter = iter->left.get(); + } + return iter; + } + + // Find the closest ancestor whose left subtree contains node. + while (iter->parent != nullptr && iter->parent->right.get() == iter) { + iter = iter->parent; + } + // A return value of nullptr means node does not have successor, i.e., it is + // the rightmost node in the tree. + return iter->parent; +} + +int FindSuccessorWrapper(const unique_ptr>& tree, + int node_idx) { + auto result = FindSuccessor(MustFindNode(tree, node_idx)); + return result ? result->data : -1; +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"tree", "node_idx"}; + return GenericTestMain(args, "successor_in_tree.tsv", &FindSuccessorWrapper, + DefaultComparator{}, param_names); +} diff --git a/epi_judge_cpp_solutions/sudoku_solve.cc b/epi_judge_cpp_solutions/sudoku_solve.cc new file mode 100644 index 000000000..a474fe4ce --- /dev/null +++ b/epi_judge_cpp_solutions/sudoku_solve.cc @@ -0,0 +1,148 @@ +#include +#include +#include +#include + +#include "test_framework/generic_test.h" +#include "test_framework/test_failure.h" +#include "test_framework/timed_executor.h" + +using std::begin; +using std::end; +using std::vector; + +bool SolvePartialSudoku(int, int, vector>*); +bool ValidToAddVal(const vector>&, int, int, int); + +const int kEmptyEntry = 0; + +bool SolveSudoku(vector>* partial_assignment) { + return SolvePartialSudoku(0, 0, partial_assignment); +} + +bool SolvePartialSudoku(int i, int j, vector>* partial_assignment) { + if (i == size(*partial_assignment)) { + i = 0; // Starts a new row. + if (++j == size((*partial_assignment)[i])) { + return true; // Entire matrix has been filled without conflict. + } + } + + // Skips nonempty entries. + if ((*partial_assignment)[i][j] != kEmptyEntry) { + return SolvePartialSudoku(i + 1, j, partial_assignment); + } + + for (int val = 1; val <= size(*partial_assignment); ++val) { + // It's substantially quicker to check if entry val conflicts + // with any of the constraints if we add it at (i,j) before + // adding it, rather than adding it and then checking all constraints. + // The reason is that we know we are starting with a valid configuration, + // and the only entry which can cause a problem is entry val at (i,j). + if (ValidToAddVal(*partial_assignment, i, j, val)) { + (*partial_assignment)[i][j] = val; + if (SolvePartialSudoku(i + 1, j, partial_assignment)) { + return true; + } + } + } + + (*partial_assignment)[i][j] = kEmptyEntry; // Undo assignment. + return false; +} + +bool ValidToAddVal(const vector>& partial_assignment, int i, int j, + int val) { + // Check row constraints. + if (any_of(begin(partial_assignment), end(partial_assignment), + [val, j](const vector& row) { return val == row[j]; })) { + return false; + } + + // Check column constraints. + if (find(begin(partial_assignment[i]), end(partial_assignment[i]), val) != + end(partial_assignment[i])) { + return false; + } + + // Check region constraints. + int region_size = sqrt(size(partial_assignment)); + int I = i / region_size, J = j / region_size; + for (int a = 0; a < region_size; ++a) { + for (int b = 0; b < region_size; ++b) { + if (val == partial_assignment[region_size * I + a][region_size * J + b]) { + return false; + } + } + } + return true; +} + +vector GatherColumn(const vector>& data, size_t i) { + vector result; + for (auto& row : data) { + result.push_back(row[i]); + } + return result; +} + +vector GatherSquareBlock(const vector>& data, + size_t block_size, size_t n) { + vector result; + size_t block_x = n % block_size; + size_t block_y = n / block_size; + for (size_t i = block_x * block_size; i < (block_x + 1) * block_size; i++) { + for (size_t j = block_y * block_size; j < (block_y + 1) * block_size; j++) { + result.push_back(data[i][j]); + } + } + + return result; +} + +void AssertUniqueSeq(const vector& seq) { + vector seen(seq.size(), false); + for (auto& x : seq) { + if (x == 0) { + throw TestFailure("Cell left uninitialized"); + } + if (x < 0 || x > seq.size()) { + throw TestFailure("Cell value out of range"); + } + if (seen[x - 1]) { + throw TestFailure("Duplicate value in section"); + } + seen[x - 1] = true; + } +} + +void SolveSudokuWrapper(TimedExecutor& executor, + const vector>& partial_assignment) { + vector> solved = partial_assignment; + + executor.Run([&] { SolveSudoku(&solved); }); + + if (!std::equal(begin(partial_assignment), end(partial_assignment), + begin(solved), end(solved), [](auto br, auto cr) { + return std::equal(begin(br), end(br), begin(cr), end(cr), + [](int bcell, int ccell) { + return bcell == 0 || bcell == ccell; + }); + })) + throw TestFailure("Initial cell assignment has been changed"); + + auto block_size = static_cast(sqrt(solved.size())); + + for (size_t i = 0; i < solved.size(); i++) { + AssertUniqueSeq(solved[i]); + AssertUniqueSeq(GatherColumn(solved, i)); + AssertUniqueSeq(GatherSquareBlock(solved, block_size, i)); + } +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"executor", "partial_assignment"}; + return GenericTestMain(args, "sudoku_solve.tsv", &SolveSudokuWrapper, + DefaultComparator{}, param_names); +} diff --git a/epi_judge_cpp_solutions/sum_root_to_leaf.cc b/epi_judge_cpp_solutions/sum_root_to_leaf.cc new file mode 100644 index 000000000..7f4fb619b --- /dev/null +++ b/epi_judge_cpp_solutions/sum_root_to_leaf.cc @@ -0,0 +1,30 @@ +#include "binary_tree_node.h" +#include "test_framework/generic_test.h" + +int SumRootToLeafHelper(const unique_ptr>&, int); + +int SumRootToLeaf(const unique_ptr>& tree) { + return SumRootToLeafHelper(tree, 0); +} + +int SumRootToLeafHelper(const unique_ptr>& tree, + int partial_path_sum) { + if (tree == nullptr) { + return 0; + } + + partial_path_sum = partial_path_sum * 2 + tree->data; + if (tree->left == nullptr && tree->right == nullptr) { // Leaf. + return partial_path_sum; + } + // Non-leaf. + return SumRootToLeafHelper(tree->left, partial_path_sum) + + SumRootToLeafHelper(tree->right, partial_path_sum); +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"tree"}; + return GenericTestMain(args, "sum_root_to_leaf.tsv", &SumRootToLeaf, + DefaultComparator{}, param_names); +} diff --git a/epi_judge_cpp_solutions/sunset_view.cc b/epi_judge_cpp_solutions/sunset_view.cc new file mode 100644 index 000000000..0a5af2d4a --- /dev/null +++ b/epi_judge_cpp_solutions/sunset_view.cc @@ -0,0 +1,43 @@ +#include +#include +#include +#include "test_framework/generic_test.h" + +using std::stack; +using std::vector; + +vector ExamineBuildingsWithSunset( + vector::const_iterator sequence_begin, + const vector::const_iterator& sequence_end) { + int building_idx = 0; + struct BuildingWithHeight { + int id, height; + }; + stack candidates; + while (sequence_begin != sequence_end) { + int building_height = *sequence_begin++; + while (!empty(candidates) && building_height >= candidates.top().height) { + candidates.pop(); + } + candidates.emplace(BuildingWithHeight{building_idx++, building_height}); + } + + vector buildings_with_sunset; + while (!empty(candidates)) { + buildings_with_sunset.emplace_back(candidates.top().id); + candidates.pop(); + } + return buildings_with_sunset; +} + +vector ExamineBuildingsWithSunsetWrapper(const vector& sequence) { + return ExamineBuildingsWithSunset(cbegin(sequence), cend(sequence)); +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"sequence"}; + return GenericTestMain(args, "sunset_view.tsv", + &ExamineBuildingsWithSunsetWrapper, + DefaultComparator{}, param_names); +} diff --git a/epi_judge_cpp_solutions/swap_bits.cc b/epi_judge_cpp_solutions/swap_bits.cc new file mode 100644 index 000000000..e3eef35b1 --- /dev/null +++ b/epi_judge_cpp_solutions/swap_bits.cc @@ -0,0 +1,19 @@ +#include "test_framework/generic_test.h" +long long SwapBits(long long x, int i, int j) { + // Extract the i-th and j-th bits, and see if they differ. + if (((x >> i) & 1) != ((x >> j) & 1)) { + // i-th and j-th bits differ. We will swap them by flipping their values. + // Select the bits to flip with bit_mask. Since x^1 = 0 when x = 1 and 1 + // when x = 0, we can perform the flip XOR. + unsigned long long bit_mask = (1L << i) | (1L << j); + x ^= bit_mask; + } + return x; +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"x", "i", "j"}; + return GenericTestMain(args, "swap_bits.tsv", &SwapBits, DefaultComparator{}, + param_names); +} diff --git a/epi_judge_cpp_solutions/task_pairing.cc b/epi_judge_cpp_solutions/task_pairing.cc new file mode 100644 index 000000000..ac0a7cc1a --- /dev/null +++ b/epi_judge_cpp_solutions/task_pairing.cc @@ -0,0 +1,42 @@ +#include +#include +#include + +#include "test_framework/fmt_print.h" +#include "test_framework/generic_test.h" +#include "test_framework/test_utils_serialization_traits.h" + +using std::vector; + +struct PairedTasks { + int task_1, task_2; +}; + +vector OptimumTaskAssignment(vector task_durations) { + sort(begin(task_durations), end(task_durations)); + vector optimum_assignments; + for (int i = 0, j = size(task_durations) - 1; i < j; ++i, --j) { + optimum_assignments.emplace_back( + PairedTasks{task_durations[i], task_durations[j]}); + } + return optimum_assignments; +} + +template <> +struct SerializationTraits : UserSerTraits { +}; + +bool operator==(const PairedTasks& lhs, const PairedTasks& rhs) { + return std::tie(lhs.task_1, lhs.task_2) == std::tie(rhs.task_1, rhs.task_2); +} + +std::ostream& operator<<(std::ostream& out, const PairedTasks& t) { + return PrintTo(out, std::make_tuple(t.task_1, t.task_2)); +} + +int main(int argc, char* argv[]) { + std::vector args{argv + 1, argv + argc}; + std::vector param_names{"task_durations"}; + return GenericTestMain(args, "task_pairing.tsv", &OptimumTaskAssignment, + DefaultComparator{}, param_names); +} diff --git a/epi_judge_cpp_solutions/test_framework/any.h b/epi_judge_cpp_solutions/test_framework/any.h new file mode 100644 index 000000000..70964ede8 --- /dev/null +++ b/epi_judge_cpp_solutions/test_framework/any.h @@ -0,0 +1,94 @@ +// @library +#pragma once + +#include +#include +#include + +#include "fmt_print.h" +#include "test_utils_meta.h" +#include "test_utils_serialization_traits.h" + +namespace { +class AnyBase { + public: + virtual ~AnyBase() = default; + + virtual std::type_index Typeid() const = 0; + virtual std::string TypeName() const = 0; + virtual void Print(std::ostream&) const = 0; + + template + const T* TryCast() const { + if (std::type_index(typeid(T)) == Typeid()) { + return reinterpret_cast(MemberPtr()); + } else { + return nullptr; + } + } + + template + const T& Cast() const { + const T* ptr = TryCast(); + if (!ptr) { + throw std::runtime_error(FmtStr("Any: expected type {}, got {}", + TypeName(), typeid(T).name())); + } + return *ptr; + } + + virtual void* MemberPtr() = 0; + virtual const void* MemberPtr() const = 0; +}; + +template +class AnySpecialization : public AnyBase { + public: + template + explicit AnySpecialization(FwdT&& value) + : value_(std::forward(value)) {} + + std::type_index Typeid() const override { + return std::type_index(typeid(T)); + } + + std::string TypeName() const override { return typeid(T).name(); } + + void Print(std::ostream& out) const override { PrintTo(out, value_); } + + void* MemberPtr() override { return &value_; } + const void* MemberPtr() const override { return &value_; } + + private: + T value_; +}; +} // namespace + +class Any { + std::shared_ptr ptr_; + + template + using AnySpecialization = AnySpecialization>; + + public: + template + Any(FwdT&& value) + : ptr_(std::static_pointer_cast( + std::make_shared>( + std::forward(value)))) {} + + template + const T* TryCast() const { + return ptr_->TryCast(); + } + + template + const T& Cast() const { + return ptr_->Cast(); + } + + friend std::ostream& operator<<(std::ostream& out, const Any& any) { + any.ptr_->Print(out); + return out; + } +}; diff --git a/epi_judge_cpp_solutions/test_framework/binary_tree_utils.h b/epi_judge_cpp_solutions/test_framework/binary_tree_utils.h new file mode 100644 index 000000000..8c10af362 --- /dev/null +++ b/epi_judge_cpp_solutions/test_framework/binary_tree_utils.h @@ -0,0 +1,164 @@ +// @library +#pragma once + +#include +#include +#include +#include +#include +#include + +#include "fmt_print_fwd.h" +#include "test_utils_serialization_traits.h" + +template +void TreeGenerateHelper(const Node& tree, std::vector* result, int order) { + if (tree) { + if (order == -1) { + result->emplace_back(tree->data); + } + TreeGenerateHelper(tree->left, result, order); + if (order == 0) { + result->emplace_back(tree->data); + } + TreeGenerateHelper(tree->right, result, order); + if (order == 1) { + result->emplace_back(tree->data); + } + } +} + +template