diff options
author | Marvin Borner | 2020-12-19 19:49:19 +0100 |
---|---|---|
committer | Marvin Borner | 2020-12-19 19:49:19 +0100 |
commit | 6b488c1fed7801bbae1d79b9b985d19008fd925b (patch) | |
tree | 55f08a67a766aff34f823f5312c25006588fe040 | |
parent | 4331232a5a7f5d35bdbe9040dc73e5c69043ba0b (diff) |
Blabla
-rw-r--r-- | .clang-format | 521 | ||||
-rw-r--r-- | 2020/19/input1 (renamed from 2020/19/input) | 0 | ||||
-rw-r--r-- | 2020/19/input2 | 617 | ||||
-rw-r--r-- | 2020/19/solve.c | 60 |
4 files changed, 1188 insertions, 10 deletions
diff --git a/.clang-format b/.clang-format new file mode 100644 index 0000000..36ec190 --- /dev/null +++ b/.clang-format @@ -0,0 +1,521 @@ +# SPDX-License-Identifier: GPL-2.0 +# +# clang-format configuration file. Intended for clang-format >= 4. +# +# For more information, see: +# +# Documentation/process/clang-format.rst +# https://clang.llvm.org/docs/ClangFormat.html +# https://clang.llvm.org/docs/ClangFormatStyleOptions.html +# +--- +AccessModifierOffset: -4 +AlignAfterOpenBracket: Align +AlignConsecutiveAssignments: false +AlignConsecutiveDeclarations: false +#AlignEscapedNewlines: Left # Unknown to clang-format-4.0 +AlignOperands: true +AlignTrailingComments: false +AllowAllParametersOfDeclarationOnNextLine: false +AllowShortBlocksOnASingleLine: false +AllowShortCaseLabelsOnASingleLine: false +AllowShortFunctionsOnASingleLine: None +AllowShortIfStatementsOnASingleLine: false +AllowShortLoopsOnASingleLine: false +AlwaysBreakAfterDefinitionReturnType: None +AlwaysBreakAfterReturnType: None +AlwaysBreakBeforeMultilineStrings: false +AlwaysBreakTemplateDeclarations: false +BinPackArguments: true +BinPackParameters: true +BraceWrapping: + AfterClass: false + AfterControlStatement: false + AfterEnum: false + AfterFunction: true + AfterNamespace: true + AfterObjCDeclaration: false + AfterStruct: false + AfterUnion: false + #AfterExternBlock: false # Unknown to clang-format-5.0 + BeforeCatch: false + BeforeElse: false + IndentBraces: false + #SplitEmptyFunction: true # Unknown to clang-format-4.0 + #SplitEmptyRecord: true # Unknown to clang-format-4.0 + #SplitEmptyNamespace: true # Unknown to clang-format-4.0 +BreakBeforeBinaryOperators: None +BreakBeforeBraces: Custom +#BreakBeforeInheritanceComma: false # Unknown to clang-format-4.0 +BreakBeforeTernaryOperators: false +BreakConstructorInitializersBeforeComma: false +#BreakConstructorInitializers: BeforeComma # Unknown to clang-format-4.0 +BreakAfterJavaFieldAnnotations: false +BreakStringLiterals: false +ColumnLimit: 100 +CommentPragmas: '^ IWYU pragma:' +#CompactNamespaces: false # Unknown to clang-format-4.0 +ConstructorInitializerAllOnOneLineOrOnePerLine: false +ConstructorInitializerIndentWidth: 8 +ContinuationIndentWidth: 8 +Cpp11BracedListStyle: false +DerivePointerAlignment: false +DisableFormat: false +ExperimentalAutoDetectBinPacking: false +#FixNamespaceComments: false # Unknown to clang-format-4.0 + +# Taken from: +# git grep -h '^#define [^[:space:]]*for_each[^[:space:]]*(' include/ \ +# | sed "s,^#define \([^[:space:]]*for_each[^[:space:]]*\)(.*$, - '\1'," \ +# | sort | uniq +ForEachMacros: + - 'apei_estatus_for_each_section' + - 'ata_for_each_dev' + - 'ata_for_each_link' + - '__ata_qc_for_each' + - 'ata_qc_for_each' + - 'ata_qc_for_each_raw' + - 'ata_qc_for_each_with_internal' + - 'ax25_for_each' + - 'ax25_uid_for_each' + - '__bio_for_each_bvec' + - 'bio_for_each_bvec' + - 'bio_for_each_integrity_vec' + - '__bio_for_each_segment' + - 'bio_for_each_segment' + - 'bio_for_each_segment_all' + - 'bio_list_for_each' + - 'bip_for_each_vec' + - 'bitmap_for_each_clear_region' + - 'bitmap_for_each_set_region' + - 'blkg_for_each_descendant_post' + - 'blkg_for_each_descendant_pre' + - 'blk_queue_for_each_rl' + - 'bond_for_each_slave' + - 'bond_for_each_slave_rcu' + - 'bpf_for_each_spilled_reg' + - 'btree_for_each_safe128' + - 'btree_for_each_safe32' + - 'btree_for_each_safe64' + - 'btree_for_each_safel' + - 'card_for_each_dev' + - 'cgroup_taskset_for_each' + - 'cgroup_taskset_for_each_leader' + - 'cpufreq_for_each_entry' + - 'cpufreq_for_each_entry_idx' + - 'cpufreq_for_each_valid_entry' + - 'cpufreq_for_each_valid_entry_idx' + - 'css_for_each_child' + - 'css_for_each_descendant_post' + - 'css_for_each_descendant_pre' + - 'device_for_each_child_node' + - 'dma_fence_chain_for_each' + - 'drm_atomic_crtc_for_each_plane' + - 'drm_atomic_crtc_state_for_each_plane' + - 'drm_atomic_crtc_state_for_each_plane_state' + - 'drm_atomic_for_each_plane_damage' + - 'drm_client_for_each_connector_iter' + - 'drm_client_for_each_modeset' + - 'drm_connector_for_each_possible_encoder' + - 'drm_for_each_bridge_in_chain' + - 'drm_for_each_connector_iter' + - 'drm_for_each_crtc' + - 'drm_for_each_encoder' + - 'drm_for_each_encoder_mask' + - 'drm_for_each_fb' + - 'drm_for_each_legacy_plane' + - 'drm_for_each_plane' + - 'drm_for_each_plane_mask' + - 'drm_for_each_privobj' + - 'drm_mm_for_each_hole' + - 'drm_mm_for_each_node' + - 'drm_mm_for_each_node_in_range' + - 'drm_mm_for_each_node_safe' + - 'flow_action_for_each' + - 'for_each_active_dev_scope' + - 'for_each_active_drhd_unit' + - 'for_each_active_iommu' + - 'for_each_available_child_of_node' + - 'for_each_bio' + - 'for_each_board_func_rsrc' + - 'for_each_bvec' + - 'for_each_card_auxs' + - 'for_each_card_auxs_safe' + - 'for_each_card_components' + - 'for_each_card_pre_auxs' + - 'for_each_card_prelinks' + - 'for_each_card_rtds' + - 'for_each_card_rtds_safe' + - 'for_each_cgroup_storage_type' + - 'for_each_child_of_node' + - 'for_each_clear_bit' + - 'for_each_clear_bit_from' + - 'for_each_cmsghdr' + - 'for_each_compatible_node' + - 'for_each_component_dais' + - 'for_each_component_dais_safe' + - 'for_each_comp_order' + - 'for_each_console' + - 'for_each_cpu' + - 'for_each_cpu_and' + - 'for_each_cpu_not' + - 'for_each_cpu_wrap' + - 'for_each_dev_addr' + - 'for_each_dev_scope' + - 'for_each_displayid_db' + - 'for_each_dma_cap_mask' + - 'for_each_dpcm_be' + - 'for_each_dpcm_be_rollback' + - 'for_each_dpcm_be_safe' + - 'for_each_dpcm_fe' + - 'for_each_drhd_unit' + - 'for_each_dss_dev' + - 'for_each_efi_handle' + - 'for_each_efi_memory_desc' + - 'for_each_efi_memory_desc_in_map' + - 'for_each_element' + - 'for_each_element_extid' + - 'for_each_element_id' + - 'for_each_endpoint_of_node' + - 'for_each_evictable_lru' + - 'for_each_fib6_node_rt_rcu' + - 'for_each_fib6_walker_rt' + - 'for_each_free_mem_pfn_range_in_zone' + - 'for_each_free_mem_pfn_range_in_zone_from' + - 'for_each_free_mem_range' + - 'for_each_free_mem_range_reverse' + - 'for_each_func_rsrc' + - 'for_each_hstate' + - 'for_each_if' + - 'for_each_iommu' + - 'for_each_ip_tunnel_rcu' + - 'for_each_irq_nr' + - 'for_each_link_codecs' + - 'for_each_link_platforms' + - 'for_each_lru' + - 'for_each_matching_node' + - 'for_each_matching_node_and_match' + - 'for_each_member' + - 'for_each_memblock' + - 'for_each_memblock_type' + - 'for_each_memcg_cache_index' + - 'for_each_mem_pfn_range' + - 'for_each_mem_range' + - 'for_each_mem_range_rev' + - 'for_each_migratetype_order' + - 'for_each_msi_entry' + - 'for_each_msi_entry_safe' + - 'for_each_net' + - 'for_each_net_continue_reverse' + - 'for_each_netdev' + - 'for_each_netdev_continue' + - 'for_each_netdev_continue_rcu' + - 'for_each_netdev_continue_reverse' + - 'for_each_netdev_feature' + - 'for_each_netdev_in_bond_rcu' + - 'for_each_netdev_rcu' + - 'for_each_netdev_reverse' + - 'for_each_netdev_safe' + - 'for_each_net_rcu' + - 'for_each_new_connector_in_state' + - 'for_each_new_crtc_in_state' + - 'for_each_new_mst_mgr_in_state' + - 'for_each_new_plane_in_state' + - 'for_each_new_private_obj_in_state' + - 'for_each_node' + - 'for_each_node_by_name' + - 'for_each_node_by_type' + - 'for_each_node_mask' + - 'for_each_node_state' + - 'for_each_node_with_cpus' + - 'for_each_node_with_property' + - 'for_each_of_allnodes' + - 'for_each_of_allnodes_from' + - 'for_each_of_cpu_node' + - 'for_each_of_pci_range' + - 'for_each_old_connector_in_state' + - 'for_each_old_crtc_in_state' + - 'for_each_old_mst_mgr_in_state' + - 'for_each_oldnew_connector_in_state' + - 'for_each_oldnew_crtc_in_state' + - 'for_each_oldnew_mst_mgr_in_state' + - 'for_each_oldnew_plane_in_state' + - 'for_each_oldnew_plane_in_state_reverse' + - 'for_each_oldnew_private_obj_in_state' + - 'for_each_old_plane_in_state' + - 'for_each_old_private_obj_in_state' + - 'for_each_online_cpu' + - 'for_each_online_node' + - 'for_each_online_pgdat' + - 'for_each_pci_bridge' + - 'for_each_pci_dev' + - 'for_each_pci_msi_entry' + - 'for_each_populated_zone' + - 'for_each_possible_cpu' + - 'for_each_present_cpu' + - 'for_each_prime_number' + - 'for_each_prime_number_from' + - 'for_each_process' + - 'for_each_process_thread' + - 'for_each_property_of_node' + - 'for_each_registered_fb' + - 'for_each_reserved_mem_region' + - 'for_each_rtd_codec_dai' + - 'for_each_rtd_codec_dai_rollback' + - 'for_each_rtd_components' + - 'for_each_set_bit' + - 'for_each_set_bit_from' + - 'for_each_set_clump8' + - 'for_each_sg' + - 'for_each_sg_dma_page' + - 'for_each_sg_page' + - 'for_each_sibling_event' + - 'for_each_subelement' + - 'for_each_subelement_extid' + - 'for_each_subelement_id' + - '__for_each_thread' + - 'for_each_thread' + - 'for_each_wakeup_source' + - 'for_each_zone' + - 'for_each_zone_zonelist' + - 'for_each_zone_zonelist_nodemask' + - 'fwnode_for_each_available_child_node' + - 'fwnode_for_each_child_node' + - 'fwnode_graph_for_each_endpoint' + - 'gadget_for_each_ep' + - 'genradix_for_each' + - 'genradix_for_each_from' + - 'hash_for_each' + - 'hash_for_each_possible' + - 'hash_for_each_possible_rcu' + - 'hash_for_each_possible_rcu_notrace' + - 'hash_for_each_possible_safe' + - 'hash_for_each_rcu' + - 'hash_for_each_safe' + - 'hctx_for_each_ctx' + - 'hlist_bl_for_each_entry' + - 'hlist_bl_for_each_entry_rcu' + - 'hlist_bl_for_each_entry_safe' + - 'hlist_for_each' + - 'hlist_for_each_entry' + - 'hlist_for_each_entry_continue' + - 'hlist_for_each_entry_continue_rcu' + - 'hlist_for_each_entry_continue_rcu_bh' + - 'hlist_for_each_entry_from' + - 'hlist_for_each_entry_from_rcu' + - 'hlist_for_each_entry_rcu' + - 'hlist_for_each_entry_rcu_bh' + - 'hlist_for_each_entry_rcu_notrace' + - 'hlist_for_each_entry_safe' + - '__hlist_for_each_rcu' + - 'hlist_for_each_safe' + - 'hlist_nulls_for_each_entry' + - 'hlist_nulls_for_each_entry_from' + - 'hlist_nulls_for_each_entry_rcu' + - 'hlist_nulls_for_each_entry_safe' + - 'i3c_bus_for_each_i2cdev' + - 'i3c_bus_for_each_i3cdev' + - 'ide_host_for_each_port' + - 'ide_port_for_each_dev' + - 'ide_port_for_each_present_dev' + - 'idr_for_each_entry' + - 'idr_for_each_entry_continue' + - 'idr_for_each_entry_continue_ul' + - 'idr_for_each_entry_ul' + - 'in_dev_for_each_ifa_rcu' + - 'in_dev_for_each_ifa_rtnl' + - 'inet_bind_bucket_for_each' + - 'inet_lhash2_for_each_icsk_rcu' + - 'key_for_each' + - 'key_for_each_safe' + - 'klp_for_each_func' + - 'klp_for_each_func_safe' + - 'klp_for_each_func_static' + - 'klp_for_each_object' + - 'klp_for_each_object_safe' + - 'klp_for_each_object_static' + - 'kvm_for_each_memslot' + - 'kvm_for_each_vcpu' + - 'list_for_each' + - 'list_for_each_codec' + - 'list_for_each_codec_safe' + - 'list_for_each_continue' + - 'list_for_each_entry' + - 'list_for_each_entry_continue' + - 'list_for_each_entry_continue_rcu' + - 'list_for_each_entry_continue_reverse' + - 'list_for_each_entry_from' + - 'list_for_each_entry_from_rcu' + - 'list_for_each_entry_from_reverse' + - 'list_for_each_entry_lockless' + - 'list_for_each_entry_rcu' + - 'list_for_each_entry_reverse' + - 'list_for_each_entry_safe' + - 'list_for_each_entry_safe_continue' + - 'list_for_each_entry_safe_from' + - 'list_for_each_entry_safe_reverse' + - 'list_for_each_prev' + - 'list_for_each_prev_safe' + - 'list_for_each_safe' + - 'llist_for_each' + - 'llist_for_each_entry' + - 'llist_for_each_entry_safe' + - 'llist_for_each_safe' + - 'mci_for_each_dimm' + - 'media_device_for_each_entity' + - 'media_device_for_each_intf' + - 'media_device_for_each_link' + - 'media_device_for_each_pad' + - 'nanddev_io_for_each_page' + - 'netdev_for_each_lower_dev' + - 'netdev_for_each_lower_private' + - 'netdev_for_each_lower_private_rcu' + - 'netdev_for_each_mc_addr' + - 'netdev_for_each_uc_addr' + - 'netdev_for_each_upper_dev_rcu' + - 'netdev_hw_addr_list_for_each' + - 'nft_rule_for_each_expr' + - 'nla_for_each_attr' + - 'nla_for_each_nested' + - 'nlmsg_for_each_attr' + - 'nlmsg_for_each_msg' + - 'nr_neigh_for_each' + - 'nr_neigh_for_each_safe' + - 'nr_node_for_each' + - 'nr_node_for_each_safe' + - 'of_for_each_phandle' + - 'of_property_for_each_string' + - 'of_property_for_each_u32' + - 'pci_bus_for_each_resource' + - 'ping_portaddr_for_each_entry' + - 'plist_for_each' + - 'plist_for_each_continue' + - 'plist_for_each_entry' + - 'plist_for_each_entry_continue' + - 'plist_for_each_entry_safe' + - 'plist_for_each_safe' + - 'pnp_for_each_card' + - 'pnp_for_each_dev' + - 'protocol_for_each_card' + - 'protocol_for_each_dev' + - 'queue_for_each_hw_ctx' + - 'radix_tree_for_each_slot' + - 'radix_tree_for_each_tagged' + - 'rbtree_postorder_for_each_entry_safe' + - 'rdma_for_each_block' + - 'rdma_for_each_port' + - 'resource_list_for_each_entry' + - 'resource_list_for_each_entry_safe' + - 'rhl_for_each_entry_rcu' + - 'rhl_for_each_rcu' + - 'rht_for_each' + - 'rht_for_each_entry' + - 'rht_for_each_entry_from' + - 'rht_for_each_entry_rcu' + - 'rht_for_each_entry_rcu_from' + - 'rht_for_each_entry_safe' + - 'rht_for_each_from' + - 'rht_for_each_rcu' + - 'rht_for_each_rcu_from' + - '__rq_for_each_bio' + - 'rq_for_each_bvec' + - 'rq_for_each_segment' + - 'scsi_for_each_prot_sg' + - 'scsi_for_each_sg' + - 'sctp_for_each_hentry' + - 'sctp_skb_for_each' + - 'shdma_for_each_chan' + - '__shost_for_each_device' + - 'shost_for_each_device' + - 'sk_for_each' + - 'sk_for_each_bound' + - 'sk_for_each_entry_offset_rcu' + - 'sk_for_each_from' + - 'sk_for_each_rcu' + - 'sk_for_each_safe' + - 'sk_nulls_for_each' + - 'sk_nulls_for_each_from' + - 'sk_nulls_for_each_rcu' + - 'snd_array_for_each' + - 'snd_pcm_group_for_each_entry' + - 'snd_soc_dapm_widget_for_each_path' + - 'snd_soc_dapm_widget_for_each_path_safe' + - 'snd_soc_dapm_widget_for_each_sink_path' + - 'snd_soc_dapm_widget_for_each_source_path' + - 'tb_property_for_each' + - 'tcf_exts_for_each_action' + - 'udp_portaddr_for_each_entry' + - 'udp_portaddr_for_each_entry_rcu' + - 'usb_hub_for_each_child' + - 'v4l2_device_for_each_subdev' + - 'v4l2_m2m_for_each_dst_buf' + - 'v4l2_m2m_for_each_dst_buf_safe' + - 'v4l2_m2m_for_each_src_buf' + - 'v4l2_m2m_for_each_src_buf_safe' + - 'virtio_device_for_each_vq' + - 'xa_for_each' + - 'xa_for_each_marked' + - 'xa_for_each_range' + - 'xa_for_each_start' + - 'xas_for_each' + - 'xas_for_each_conflict' + - 'xas_for_each_marked' + - 'xbc_array_for_each_value' + - 'xbc_for_each_key_value' + - 'xbc_node_for_each_array_value' + - 'xbc_node_for_each_child' + - 'xbc_node_for_each_key_value' + - 'zorro_for_each_dev' + +#IncludeBlocks: Preserve # Unknown to clang-format-5.0 +IncludeCategories: + - Regex: '.*' + Priority: 1 +IncludeIsMainRegex: '(Test)?$' +IndentCaseLabels: false +#IndentPPDirectives: None # Unknown to clang-format-5.0 +IndentWidth: 8 +IndentWrappedFunctionNames: false +JavaScriptQuotes: Leave +JavaScriptWrapImports: true +KeepEmptyLinesAtTheStartOfBlocks: false +MacroBlockBegin: '' +MacroBlockEnd: '' +MaxEmptyLinesToKeep: 1 +NamespaceIndentation: Inner +#ObjCBinPackProtocolList: Auto # Unknown to clang-format-5.0 +ObjCBlockIndentWidth: 8 +ObjCSpaceAfterProperty: true +ObjCSpaceBeforeProtocolList: true + +# Taken from git's rules +#PenaltyBreakAssignment: 10 # Unknown to clang-format-4.0 +PenaltyBreakBeforeFirstCallParameter: 30 +PenaltyBreakComment: 10 +PenaltyBreakFirstLessLess: 0 +PenaltyBreakString: 10 +PenaltyExcessCharacter: 100 +PenaltyReturnTypeOnItsOwnLine: 60 + +PointerAlignment: Right +ReflowComments: false +SortIncludes: true +#SortUsingDeclarations: false # Unknown to clang-format-4.0 +SpaceAfterCStyleCast: false +SpaceAfterTemplateKeyword: true +SpaceBeforeAssignmentOperators: true +#SpaceBeforeCtorInitializerColon: true # Unknown to clang-format-5.0 +#SpaceBeforeInheritanceColon: true # Unknown to clang-format-5.0 +SpaceBeforeParens: ControlStatements +#SpaceBeforeRangeBasedForLoopColon: true # Unknown to clang-format-5.0 +SpaceInEmptyParentheses: false +SpacesBeforeTrailingComments: 1 +SpacesInAngles: false +SpacesInContainerLiterals: false +SpacesInCStyleCastParentheses: false +SpacesInParentheses: false +SpacesInSquareBrackets: false +Standard: Cpp03 +TabWidth: 8 +UseTab: Always +... diff --git a/2020/19/input b/2020/19/input1 index e472e6c..e472e6c 100644 --- a/2020/19/input +++ b/2020/19/input1 diff --git a/2020/19/input2 b/2020/19/input2 new file mode 100644 index 0000000..c9757e5 --- /dev/null +++ b/2020/19/input2 @@ -0,0 +1,617 @@ +101: 118 64 +83: 132 118 | 108 2 +61: 19 2 +33: 126 2 | 68 118 +80: 2 48 | 118 91 +47: 38 2 | 64 118 +40: 25 2 | 93 118 +18: 38 2 | 108 118 +2: "a" +74: 118 108 | 2 12 +41: 118 17 | 2 58 +56: 125 2 | 132 118 +66: 12 2 | 27 118 +62: 118 52 | 2 125 +58: 2 128 | 118 99 +89: 110 2 | 3 118 +30: 118 85 | 2 21 +20: 2 70 | 118 111 +85: 118 115 | 2 52 +98: 118 46 | 2 10 +12: 118 2 | 43 118 +99: 102 118 | 56 2 +127: 2 119 | 118 100 +53: 125 2 | 108 118 +15: 2 27 | 118 108 +22: 95 2 | 61 118 +109: 115 2 | 46 118 +90: 76 2 | 121 118 +37: 15 118 | 23 2 +27: 118 2 | 118 118 +104: 2 46 | 118 12 +32: 64 2 +26: 35 118 | 32 2 +123: 131 2 | 89 118 +21: 118 132 | 2 115 +95: 112 118 | 125 2 +79: 88 2 | 60 118 +34: 107 2 | 133 118 +6: 2 101 | 118 110 +55: 118 112 | 2 64 +10: 2 118 +115: 2 118 | 2 2 +39: 2 61 | 118 81 +42: 92 118 | 124 2 +105: 38 2 | 10 118 +7: 10 2 | 27 118 +106: 87 2 | 1 118 +75: 118 46 +28: 2 71 | 118 16 +120: 118 27 | 2 112 +100: 69 2 | 109 118 +102: 46 118 | 132 2 +5: 39 118 | 51 2 +14: 57 2 | 96 118 +8: 42 | 42 8 +25: 118 59 | 2 67 +3: 19 118 | 52 2 +59: 2 74 | 118 83 +87: 118 72 | 2 78 +130: 111 2 | 117 118 +112: 2 43 | 118 118 +116: 118 38 | 2 108 +17: 2 122 | 118 29 +124: 41 118 | 40 2 +11: 42 31 | 42 11 31 +38: 43 43 +44: 118 123 | 2 114 +23: 12 2 +29: 2 113 | 118 129 +121: 2 10 | 118 19 +93: 2 26 | 118 36 +13: 19 118 | 46 2 +107: 118 132 | 2 10 +54: 118 27 | 2 12 +63: 2 105 | 118 82 +84: 2 37 | 118 73 +52: 118 2 | 2 118 +50: 118 111 | 2 9 +111: 118 112 | 2 27 +82: 118 46 | 2 108 +118: "b" +133: 115 2 +103: 34 2 | 22 118 +36: 66 2 | 65 118 +31: 33 118 | 79 2 +69: 12 2 | 115 118 +122: 54 118 | 66 2 +114: 6 118 | 80 2 +92: 118 14 | 2 44 +0: 8 11 +117: 132 2 | 108 118 +76: 64 2 | 27 118 +126: 2 28 | 118 127 +113: 125 2 | 19 118 +43: 118 | 2 +46: 118 118 | 2 118 +132: 118 118 | 2 2 +49: 118 130 | 2 50 +129: 19 118 | 27 2 +24: 2 27 | 118 52 +119: 118 47 | 2 98 +91: 19 118 | 10 2 +35: 115 118 | 46 2 +57: 2 63 | 118 90 +125: 118 118 | 43 2 +108: 118 118 +4: 115 118 | 19 2 +94: 112 2 | 115 118 +1: 2 55 | 118 75 +9: 38 118 | 112 2 +71: 2 18 | 118 53 +60: 103 2 | 86 118 +51: 116 2 | 24 118 +128: 24 118 | 117 2 +45: 118 2 +16: 104 2 | 62 118 +70: 118 115 | 2 45 +77: 118 13 | 2 94 +131: 61 2 | 107 118 +68: 2 49 | 118 84 +86: 118 97 | 2 30 +78: 118 38 | 2 12 +88: 5 2 | 106 118 +81: 2 45 | 118 52 +64: 2 2 +19: 2 43 | 118 2 +110: 132 2 | 64 118 +96: 2 77 | 118 20 +67: 104 118 | 4 2 +65: 115 118 | 38 2 +73: 118 110 | 2 120 +72: 64 2 | 115 118 +48: 2 46 | 118 10 +97: 7 118 | 133 2 + +aaaaaababababbbbbababaab +aaababbabbbbbbabaaaabbaaabababaabababaaa +abaabababaababbaaaabbaaabaabbbaa +aabbaaaaabbbaabbaabbbabbbabaabbbaaabaabababaaabb +bababbbbbaaaaaababbbabbb +bababbaabbaaaaabbaabbabbbabbabbbbbbbbbababbbabab +aaabaababbaabbbbaaabaaabaabababb +babaaababbbaabaaaabababa +aaababbabbbbbaabaababbaabbababbbabaabbbbabababaaaaabbaab +baabbbbabaabaababbbbbabaabaabaabbaaaabab +bbbbaaabbabbbbabaaaabbabbbbbabaaaaaabbaa +bbababbbaabbaabaababbbab +bbaabbbabbbaababbbabbabb +abbaabbaaabbbaaaaabaabababbaabbababaabbbaaaabbaa +bbaababbbbbbbaabbbabaaab +baabbbaabbababbbababaaabaabbaabb +baaabbbababbbabbabbaabaa +bbaaabaabbbababbbbbbbabb +aabaabbbabaaaaabbbbaaaaa +babbbaaababbbbaaaabaaabbbabaabba +abbabbbbaabbaaaaabbbbbaabbbbbabbbaabaabb +aabbbbaaaabaaabbaabaaababbbbbabbbbaababa +abaaaabaabbaaabaabaaaabbabaaabaaaaabaaab +babaabbbbaaabaabbbababbbaabbababaaaaabababbbbaababbbbbbb +ababaaababaaaabbbababaab +bbbbabaabbbabbabbabbabbaaaabbaab +abababbbaaabababbbbbabbbaabbbabbbabaabaababbbbabaababbbb +bbaaaababaabbaabaabbababaabbbbba +abbaabaaabaaabaabababbbbbbaabaaaabbbabababbababbbabaabaabbabaaaa +bbbbaabaaaabaabbabababab +abbabbaabbbbbababbaabbbb +bbbbaabbababbbbbbbbbaabaaabbabaaaabaaaba +bbbbbaaaabbaabbbaaabbaaaabaabbaabbbbbabb +bbaaabaabbbbbbbbabbbbbaa +baabbbbaaababbababbaaabb +aaaababbbbaababaabbbbbbbaababbbb +aaaaabababaaaababbbaaaaa +abbbaabbbababbaaabaaabaa +bbbbbababbbbaabbaabaaaba +aabbbabbbbbababbaaaabbba +aabaaaaabbaaaabababaabab +bbbbbaaabbbabbabaabaaaab +bbbabbbaaabbbabbaabaaabbbbabbababbabaabbbbababab +abaababbabaabbaaaabbbbbababbbbaaababaaaabbbbabba +abaababbbbbababbabaaaabbababababaaabaaab +baaabbabaabbbabbaaaabbabbabababbbbbabaabaababbbbbababbba +bababbabbbbbbbaaaabbbabaabaaababbbbaaaaa +baabaaabaaabaaaabbaaaabb +bbbabbbbbabbbbbaababbaab +bbaaaabaaabaababbaaaaabbbbaaaabb +abbabbaabaaaaaabbaababaa +aaaaaaaaabaaaaabaaaabbabaabababa +bbbbaabaabbabbaabaabaabb +bbbbabbababaabbbabaaabbb +aaabaabbaabbaaaabbbaaaaa +abbabaaababababbbbbbaabaabbbaabbaaabaaaaaabbabaaabaabaaa +baaaabbbbabaaabaabaababbabaaaaaaabbabaaabbabbaab +abbbaabababbbaaababbbbaaabaabbbbbaaaaaababbabaaaabbbbbaabbbabababbabbaaa +aaaaaaaaaabbbaaabbabbaab +bbabbbaabbabbbbabbaababaaaabbabaaaabaaba +abbaaaaabbaaaaabbbaababbaabbbababababbbabbabbbbabbbaaaabaabaabab +bbbabaabaaabbaaabaabaaabbaabbbbb +aaabbaaabbabababababbaabbabaaaaabbbaabbbbabaabab +abaabbbbabbbbaaabaaaabab +abbaababbbbababbababaaaa +bbbbbaabbbabbabaababaaaa +bbbaabbaabbbbbabaabbbabbabbbaababaababbbaaaaabbbbaaaaaba +aabbbabbbaabbaaaaabbaabb +aaabbaaaabaaaabaabbbabab +bbbbaababbbbbaabaaaaababbabbbaababbabaab +baabbbbabaabbaabbabaabaaabaabbabaaabaaaaababbbabaababaaa +bbbbaaaabbbabbbbabbbbbaa +abaababbbbbbababbababababaabaaababbbbbaa +aaabaaaabbaabaaaabbbabaa +bbbabbabaabbababbaabbbaababbaaaaabbabaab +aabaaabbabbbbabaabaabaaa +bbbbaabbabababbbaaaaaababababaaabbbababa +bbbabbbabbabaabbaaabbbbb +abaaabbabaaababbaaabbbab +bbbbabaabaaabbbbaaaabbabbbaaabaababbbaab +abbaaaabaababbabaabaababbbabbaab +aabbabbaaaabbbbababaaaab +abbbabbaabbbbababbbbbaabbababbabaaabaaabababbbab +bbabaabaabaaaabababbbbbb +bbbbbbbbaaababbaabbbaaab +bbaabbababbbbaaabbaaaabb +babbabbbbaabbabbababaaba +baaabaabaaabbbbaababbbbaaaabbbaaaaabbbaabbbababaaabbbaab +aaaaabababbabaaabaaabbbaabababababaabbba +baaaabbbaaabbaaabaababbabababbababbabbaabaababbaaaabbabaaababaaa +babbbaaaabbaabbbbabbbbbb +bbbbbaaabbaabbbabaaaabba +abbbabaabbbbabbaabaabaaabaaaabbabbbaaaabbbaabbabababbaabbaaaabaa +babbababaababbababbababa +abaabbbbabbaabababbaaaaa +bbbabbaaaaabababbbaabbaabbababaabbbabaaa +abaaaabaababbbbbaabaaaaabbbabbbabbababab +aababbababbaabbbbbbbbabb +bbababbbaabaaaaabbababbabababbabbbabbaaa +abbbbabbbababbbaaaaabbabbbabbbabaaabbbaabbbaabbaaaaaabba +ababaaabababbbbaaaaabbababbbbaab +baabbbbabaaabaaaabaababaaaabbaba +baababbabbbbbabbbaabaabb +bbbababbbababbaaaabaabbbbbbbbabaabbaaabb +baabaabaababbaaaababaaabbbbbbbba +babbaababbbbababbaabaabb +aabbbabaaabbaaaaabbaaabababaabba +bababbbbbaabaaabbbaababa +bbbababbbaabbabbabbbaabaabababaa +bababbaaaabaabbbbbbbaaab +bababbabaabbaaaabbbaaaba +baabbaabaabaabababaaaaaababaabab +baabaaabbbaabaaabbbbbbab +abbbbbbabbaabbbabbaabbbaabbaabbababbaabb +babbbaaaabaabbbbaabbaabb +baabbbababbbababbabaaaaabbababab +babababbaaabababbbbababbaaaababa +abbbbaaaaabbabbaabbaaaaa +bbbbabaababbbbaaaaaaaaab +abbabbaabbbbaabbbabaabbbbaaabaaaaaaabaabbbbbbbaa +bababbbbbbababaaaabaabba +bbbbbaabbbabaababaaaabab +aaabaabbbbaababbaababbbaabbbbbbabababbab +aaaaaaaaabaababbbbabbaab +abababbbabbabaaabaaabbaabbaaaabb +babbbaaabaabaaaaabbbaabaabbbbbbaaaabbabbabbbabab +babbabbbbbbbaabbaaaabaaa +baabbbbaabbbabbabbaabaab +bbbbabbabbababbabbbabbabbabbbaaaaaaabbabaaaaaabb +abbaabbbababbaaabaaaabaa +babbbaaababababbbaabbbbb +bababbaaaaababbaaabbaabb +bbbbabbbbbaabbaaabbbabbabababbbbbababbabbabbabba +abbabaaabbaabbaababbbbaaaaababbaabbababb +baababbabbbbababbbbabbabbbbbbaaaabbaabba +babbbbbaabbabbbbabbaabba +baaaabbbabaabbbbbaaaaabbbbbabbabaaaabbbabbaaabab +abbabbbbbbbaababababaaaa +baaabaabbbbbababbabaabbbbbbbbbbabbabbaab +bbbbbaabbabaaabaaababbabbabbbbabaabaabaa +bbaaaaababbbbabababbabbbaaababbb +aababbbaabbbaabbabaababababaaaab +bbbabbbbaaaaababaabbbbba +bbabaabaabbbabbabbbbbaabbbbbabababaaaababbbaaaabbbbbbabb +bbbbbabaabbbbababbababab +bbbaabbaabbbbbbabbbabbbaabbbbaaaabababab +baaabaaaabaaaabaaababbaabaabbabbababbbbabbaaabab +baaabaaaaaabaaaaabbbbabb +abaaaababbabbabaabaaaaaababbaaaaabbbbabb +baaabbbababababbaaaabbbb +aaabbbaaabaaabbababaabbbbbaabaabbbaaabbb +bbbababbaaababababbbbaaaaaabaabbbaabbbbb +abaabbbbababbbbaabbaabbbaabaababbbbaaaba +aabbbabbabaabababaabaaabbbbabbaaaaabbbbbbaaaabab +aaaaabaaabaababababbbbbb +bbbbababbaabbbbababababaabbbaaab +baaabbbbaaabbaaababbaabb +aabbbabbbbbbbaababbabbab +babaabaaabbbbbbaabaaaabbbbaabaaaaabbaabaaabbabbb +baaaabbbaabaabbbaaaababb +aabbababaaabababbabbabbaaabaabaaaababaaa +abbbbbabbaabaaababbbaabbabbaabababababbbaaaabbabaabbbbbabbabbbaabbbaaaba +baababbaababbaaaaaaabbba +bbbbaabbbaaaabbbbaaaaaaa +bbbbababaaaaaabaaaababbb +aabaaaaabbaaaaabbbbababbbbbaabbabbbbbabb +bbbbaababaabbabbabbbaabbbbbbaabaabaabbbbabbababbbbbaaaaa +abbaaaabbbabbabaababbaaaaababbabababbbabababbabb +bbababbbbaaaabbbabbbbbaa +bbaabbaabbbbabaaabbbbaaababababbabbbbbaabbaabaab +bbaabbbabbbbbaaaaabbabaabaaabbbbababbbbb +baababbabbbababbbbbbbbab +abbbbbbaaaabbaaaaaaaabba +bbaabbbababbabbaaaaabaab +bbbaabaababbbbbabbabbaaa +bbababbbabbbaabbbaabbbbb +bbaaaabaaaabaaaaaabbabbabaaabbaabbbababa +aaabababaaabbbbaabaaabbb +bbaababbaabbabbabaababbb +babbbabbaabbabbaaaabbaaabbbaabaababaaabbaabbbbabbbaaaabb +babbbbababbbaababaababbb +bbbbabbabababababbbbaabaaabaabbbabbaabbbbbaabbaabbabaaaabbbaaaba +aabaaaaaabbaaaabbbbababbbbaaabaabbaabbabbbabbbaa +bababbaabaaabaaabababbbbbbaaabbbabbababa +aaabbbbaaaaaaaaabbbaaabb +bbbbabbabbbbaabbbaaabbaabbbaaaabbaaaabab +babaabaabaaaabbbbaaaabba +abbbaabbbabbabbbbaaabaaaabbabbaabbbaaabb +bbbbaabbaababbabaaabbaaaabaabbaaabbabbab +abbbbaaaabbbaabaabaaaaaabbaaaabaaabababa +baaabaaaabaaaaababbabbbbbababbba +baabaaaabbaaaaabaaababbaababaabbaabaabaa +baaababbbaabbaababbbabaa +babbbbaaaaababbababbbbbb +bbaabaaaaabbabbabaaaabbbaabaaabbbbabaaaaabbababa +baabbbaaaabbaaaabbaaaabb +baabbbbabaabaaabaabaabaa +bbbabbbbbbbabbaaababaaababbabaab +aaaaaabaaabbbbaaabaaabaa +ababbbbaabbaababaababbbb +abaaaaababbbbbabbbbbbbba +aababbbabbaaaaababbbbbaabbabaaabaaababaa +aaabaaaaabbbabbaabaaabbb +bbaababbbbbbaabaabbaaaaa +bbababbbbababbaabaaabbbbabaaaaababbbbaabaaaabbba +abbabaaabbaabaaaababaaaa +aaabaabbabaaaababaaabaaaaabbbabbbabbbbabbbabbababaabbbbbaababababababaab +abaabababbababbbbbbaaaba +abbbbababbaabbbaaaababaa +aaaaabaaaababbbaaaaabbba +abbaababbbbabaababaababbbbabaabbbbbbbbaa +abbbaaaabbbbabbabbaaaaaabaaabaababbaaabbababaaaaaabbaaabbbabbaaaaababababababbbbbaaaabab +ababbaaababaabbbbabaaababbbaabbb +bbbaabbabbbaabaaaabbbbaaaaaaabaaaababbabbbabbbbaabaabbaabbbababa +bbbbaabbabbbbabababaaaab +aaabbaaaaabaaaaababbbbbabbabbbab +bbbbaaaaabbbbbbabbaababa +abaaaabbbbababbabaaaabbbbabbbbbabbababaabbabbbabaabaabbabababbba +baaabbbabbbabbaabbabaaab +aaababababaabbbbbabaaaab +bbaaabaaaabaabbbbabbbabababaaaaa +abababaaaabbbbaabbabbbaababbbbaaaaaaaabbabababbbbaaaabaa +baabbbbabaababbabbabbbba +baabbbaaaabaabbbabababab +abaababbbbbababbaababbabababbbab +baaabaabbabababaaaaaaaaaabbabbbbbaaaabba +baaaaabbbaaabbbababaaaaa +baabbaaabbaabbabbabbbbbb +babbababaaabababaabbaabb +bbbabbbbaabbabbabbbaaaaa +bbbabbabababbaaabbbaaabb +aaabababababbaaabbabababbaaabbabaaaaabbbbabbbbaaaaabbaab +aabbbbaabaaaabbbbbabbbaa +bbaabbaaaaaaaababbaabbaabbaabaaabaaaaaaaababbaab +bababbaabbaaaaabbabaabbaababababaaaaababaabbaabbbbabaaabbaaaabbabaabbbbaabbabbbb +baabaababbbbaaaababbbbbb +baaabbaaabbbaabaaaaaabaabbbabbababbaabbbaaabaaaaaaaabababbbaabbbbbbaaaabababbabbbababaab +aaababbabbaabaaaaabaaaab +bbbabbabbbbbababaabbabbababababbaababbbaaababaaa +babbbabbbbaaaaabbbaaabaabbbaaaaa +bbaaabbabbaaabaaaaaabaab +bababbbbbaabbaaabaaabaaabababbabbaabaabaabaaabaa +bbbbbabababbbbaaaaabababaaaabbabaabbbbab +bbbbaaaaaababbbaabaaaabbaabbaabb +babaabaabbaaaaabbaabaabababbbbbaababbaaabaaaabbbbbbbbbabaabaabaa +babbbabaaaaaaaaaaababaaa +bababbabbabbbbbaaaababbb +abbaaababbaaaababaaababa +bababbaabaaababbbbbbaaaabbbaabababbabbba +baaabbbbaabbbaaaaaaabbababaaaaaaabbabbababbbaaaaababaabb +babbbabbbbababbaabbbaaaabaaabbbabbababbabbbbbaabaaaaababaaabaaaa +ababbbbbbbbbabbaaabaabaa +bababbaababbbbaaaaababababaaaaabbbaaabbb +bbbbbaabbbaabbaaaaabababbaababab +aabaaabbabbabbbbaabaaaaaaaabbbbb +bbaabbabbbbbabbaababaaba +aaabbbbaaabbabbababaabbbaabbababbabbaaabaabbbbba +babbbbabaaaabbabbbbbbabb +babbbabaaabaaaaaaabbbbaababbaabaaababaababbaaaaa +aaabaaaaaabbabbaaabbbabaabbaaabaabbaaaaa +babababbbbbbabaaabbbbbbaababaaaaaabaabaa +aabbabbababbbaaabbbaabbb +aabbaaaaabbaaaaaaaabbbaaaaababbbbbbabbabbbbabaabababaaaaababbbaaaabbbaab +bbbabbaabbbbaaaaabaabbba +babbbabbaabaabbbaabbabbb +abaaabbabaaaabbbaaaaabaaababaaabbabbbabaabaaabababababab +aabbaaaabbbbbaaababbaabababbaababbaaaabaabbabbbaabbaaabbbbabababbaaaaaaa +bbbbbbbbbbaaaababbbbbabbaaabaaababbbababaaabaaba +aabbbababaabbaaaabbaabba +bbbbbaabbbbaabbabbbbbababaabbbbbaaaaabba +abbabababbbabaababaaaabbbbbaaabbbaabababbbaabbbabbaabababbabbbba +aabbbabbababbbbbaaabbbab +bbbbbaaabbbababbbbbabbbaaaabbababbabbbaa +bbbabaababbaabbbabbbbabb +bbaabbbaaabbababbababaaa +abbabbbbbbaaabbaabbbabbb +abbbbaaaaabbaabaabbaabba +bbababaabbbabaabaababaabbbaaaaabaababbaababbaabbaaabbbabbabaaaaa +baaabbaabbbabbabbaabaabb +bbbabbbbabbbbabaababaaababbabbbabbababab +bbbbbaaababaaabaaabbbababbababababbaabba +baabbaababbbabbabaabbabbabbbabaaaaabbabb +bbbbbaaabbbabbaabbabbaab +babbbababbaaaaabbabbbbbb +abaaaabaaaababbaaabababa +bbbababaaaabbbbabbbbabbaaabbaaaababbaaaababbaaaaabbaaaaa +abbabbaaaaaabbabbbaaabab +bbbaabababaabbbbbabaabab +babbbaaaababbbbbbaaaabba +bbaababbbbbbababbbaabbbb +aabbbbaabaaabbbbababbaaabaaabbababbabbbbbbabaaaa +bbababbabababbaabbaaabbaabaaabbabaaabbaaaaaabaaaababaaaaabbbbbaabbabaaaaaabbabaaaaaabaab +baaabbbbbabbaababbbaaaaabbbaaabaabbaababbaababbbbbbbbbbaaabbabbaabbaabbaaababbbaaaaabbabbbbbaaba +aaaaaaaabaaaaabbbaabbaba +baaaabbbbaabaaaababaaaaa +baaaabbbbaaaaaabaaabbbbabbabaabaababbabaaaaabaabababbbaa +bbbbabbbabaaaabaabbabbaaabaabaaa +baaabbaababbbbbaaabbaabaaabaaabbabaabaaabbabababababaaba +bbaaaababaabaabaaaabbbaaaabbaaaabbbbbabb +bbbbabbbbbababbbbbabaaab +bababababbbbaababaababbaababbbbbaabaabba +bbaabbbaaaaaaababababbba +bbbbaabaabaaaababbabbabb +bbbaabbaabbbbaaaababbabb +abbaaaabbaabbabbaabbbbaabaabbaba +abbbbbbabaaaaababbaaabababbbbabbaabbbbba +babbabbabbbaabaabbbaabaabbaaaaaababbbbbb +abbaaaabababbaaaaaabbbbb +bbaaaababbaaabbaabbbbbbaabbaaaabbbabbaabababbbaabaabbbbb +aababaabababbabbaaabbaababaabbbabaaaabbaabbaaabbbbbbaabbaaababbabababbaaaaabaaba +bbbbaabbbbaabbaaaaababbaabbbaabbbbbabaaa +abbbbababbbaababbabbbaaabaabbaabbbbaaabb +aaaaababbaaabbabaabaabaaaaabaabaabbbabaaabbbabaababaabaa +aabbbbbbabaabaababaaababbabbbabbababaabaaaabbabb +bbaabaaabaaababbaaaaabababbaabbbaaababbbbababaaa +bbabaaabbabbbabaabaaaaaababbbababaaaaaaaaaaabbabbabaabbabbbaaaabaaaababb +baaaabbbbaaabbabbabbbbbabaaababbaabbbabbaaabbbabbbabbbbbaabaabaa +babbaabababbbaaabaababbaababbabbbbbabaaabbabaaababbbabbbbbbababaabbaaaaa +abaabbababaabbabaaaabaaa +bbababbaabbaaababaabbaba +baaabbaaaabbababbaabaabb +aabbbbaabababbabbbabaabaaaaaaabb +bbbabbaabbbbaabaaabababb +aaabbbbabababbaabaaaabab +abababbbbbabaabbbbbaabbabbabbaabbbaaaabb +aaaaaaaaabbaaabaabbaaabb +babbabbaabbbaababbabbbba +aaaaaabaaabaaabbbabababbbbabbabb +babaaabbbbbabaaababbabaabaaaabab +aaababbbababbbaaababbaabbbbbababaababbbaaabaabbabaababbbbbaabbbbbabaaabababbbbaaaaaabbabbbababaa +abaababbaabbaaaaabbbaaaa +abbaaaababbabaaabbaabbabbaabbbaabaababaa +aaaaabaaaabbaaaaabababaa +baaaaaababaaaabaababbaaaaaabbbabbaababababaaabaaabbbbabbaabaaabb +bbbbabaabbbbbaabbabbaabaabbaaabbbbabaaaababbbaab +abbabbbbabbabaaaabbabbba +baaabbbbbabbababaaaabbbb +abaabababaaabbaaaaabaabbabaaaaabbabbababbbaababa +abaaaabaaababaabbabbbbaabaabaabaaaabaaaababaaabbaabbbaabbbbaabbb +bbaaabbabbbababbbaaabbaaaaababbb +bbaaabbabaabaaaabbabbabaaaaaaaaaabbaaaabbbabaabaababbababbbbbbba +aababbbabbababbbabaabbba +aabbbabbbaaabbabbbbbbbbbbbbabaababbaababababbbaaabbaabaa +aaaaaaaaabaaaaaabbbabbaababbbaaaaaabaaab +bbaaabaabbabbabaabbabbaaababbaab +abaaabbaaaabbaaaabaabababbbbbbaaaaabbbbb +baabbaababaababaaabaaabbabaaabaa +bbbabbbabbababbbaaababaa +bbabaabbbbbbaababbabbbbb +abbbbababbbabbaaabbbabab +baaabbbababaabbbbbabbaab +aaaaaaaaaabaaabbababaabb +bababbaaabbaabbbaabbaaab +babbaababbaaaabaabaababbaaaabaaa +bbbabbabaabaaabbaaaabbabababbaaaabaaabbb +aabaaaaababaabaaaaaababb +aabbabababbaababaaaababb +bbbbabbabbbaabbabababbbbbbaaaabababaabbaaaabbbbbaabbbbba +ababaaabababbbbaabbaaabbabbbbaaaaabbbaabbbabbabaabaabaab +aabbababbabbabbbaaabbaba +abaabbabbaabaaaabbbaaabb +babaaabaaabbaababbbabaaa +bababbabbaabbabbaabbaaaaaabaaabbabbabbbbaaabbaba +babbabbaabaabbabaababbbb +babbbbaaabaaabbabbaabbbabbbbabbbbbabaababbbbaaababaabaaabbabbbaaaaaabaab +baabbaabbbbbbaaabbabbbbb +bbbababbbaabbbaabaabbbbabbababbbbaaaaabbaabbbaab +aabbaaaaabbabbaaababbbbbbaabbbbaaaaabbbbbbababab +baabbabbaaabbbaabbbbabababbaaabb +babbabbbbbaaaaabbbaaaaaaaaaabaaabaaaaaaaaabbbbbbbaaaabbbababaabbaabbbaaa +bbbaabbabbabaabaabaabbaa +abbaaaabbbbabbabbaabaaaaabaaaaabbbbabbabbaababaaabaabbbaaabbabbb +bbbabaabbbbaababaaababaa +aabaabbbbaabaabbbabaaaaaabbbbbbb +aaabaaaabaaabbaabbaabbbaabababab +abbaaabaabaaaabaabbbbbab +aaaaabaabaaabbaaababaabaaaaaabbabbaaabbbaaaaaababbbbaabbbaabaabababbbaababababab +bbbbaaaabbbaabaaaabaaabbababbaaaaaaabbbababaaaabbbbaaaab +bbbabaabbbaaaaabbabbaaab +abbaaaabaaaaaabaaabbbbaaabbbbaababaabbba +baabbaaaaaabbaaabaababbb +aaabaabbbabbaabababaabbbaabbaababaabaaababaaabbb +bbabaababbbabbabaabbaaab +bbaaaaabbbaabaaaaaabbaaa +bbbbbaaabbbabaabbaababbabaaaabbaabbababa +aabbbbaabbaaabaababbbbbababbbbbaabbaabbbbaaaabbbababbaab +aabbbabbaaabbaaabaababbaabaaaaaaababaaabaaabbbbaaabaaabaaaabbaabababaaaabaaabababbbaaaab +aaabaaaabbbbabaaababbbbbabbaaaaa +abaabbbbabbaaabaaaaaabaabbbbbbaa +bbaaabaaaaaabbabaabbbbab +baaaaaabaaababbabbbbaaab +bbabaabbbabbbaaaaabbabbaaabbaababbabaabbaaabaaaaaaabaaba +abbbbbaabaabbbabbabbaaaabaaaaaba +aaabbaaabbbbaaaababaabbbbbbabbbaaabaaabbbaabbabaaabbaaab +babbaababbbbaaaabbbbaabaaabbbbaaabbabbba +baababbabbaaaaabbbababaabbabbaaa +aabbababbbaaaabaabbabaaabbbbbaaabaaabbbaabbbabab +abbbaabaabaabaababababbaabbbbaabbbabbaabbaabbaaa +baaabaaabaaabaaabaaaaaba +bbbabaabaabbbabbbbabbaaa +bbaaabaabbbbaaaabbabbabaabbababb +abababbbabaaabbabaaaabbbaaaabbabbaababbabbaabbbb +bbbbbaababbaaaabbaaabaababbbaaab +baabbabbbbaaaababaabbaaabaababaabaaaabab +baababbaabbbbbbaaabbabbabbbbababbabbbbbbaabbaabb +baabaaaabaaabbbaabababbbaaabbaba +abaabbabbaabbaaaaaabaaababbaabaabbbaaaaa +baabaaaaabbaabbbabaabbba +bbbaabbababbaabaaaaaaabb +bbbbabaababaabbbbbababaabaaabaabaaaabbaa +aabaababbaabbbbababbaabababaabaabaabbaaaabababab +abaaaaabbbbaabaabaabbaba +bbbbaabbbaabaaabaabbaababaabbabbbabaaaaaaaabaaba +aabbabbaabaaaaaabbabaababbbaabaababaaabb +abaaaababbbaabaaaabaaaaabaabaaaabaaabaaaaaaabaab +aaaaaabaaabbbababbbbbababbbbababaabbbaab +bbbabbababbaabbbabababaa +baabbbaaaababbbabbbaaaba +baaaaaabaabbbabbbaaaaaabababaaba +bbbbaaaaabbbabbabbbbaabaaaaaababbbaabbbb +aaabababbaabbaaaaabbbbab +abbbbaaabbaabbababaaabbabaaaabba +bbaaaababaaabbaaabbbaaaa +ababbbbbaaaaaabaabbabbbbaaabbbbbabababaa +bbabaabaabbabaaabbbaabbb +aababbbaabbbabbabaaabbbbbbabaabaabbbbaaaabaabbaabababaab +aababbabbabbabbaabaaaaaabbbababbabbabbbbabbaabba +aabbbbbababaaababbaaabaababababbbabbaaabaaabbbaabbbabbab +ababbbabbabaaabaabaabaaababaaaaa +abbbbbbabbbaabbaabbabaaabbbbabaaabbbbbaa +bbaaaaabaabbaabaaabbabaa +bbbbaabbabbbaababbaababa +babababbababbbbabbabbaaa +aabaabbbaaabbbaabbbbabaaabbababa +abbbbbabaaabbaaaaabbbabaabbbbaaabbbaaabbbaaababa +baabbaaaaaabaabbbaabbbaaaaabbbaaaabbaababaaaabbbaaaabbba +abaaabbaababbaaababbaabaaaaaabababaabaab +bbbabbabaababbbabaababaa +bbaabbabbbbaabbabbbbaaab +abbbbabababbbabbbbbbabbbbbabaaaaabbaaabb +aabaabbbbbbbaabbabbabbbbaabaabbbbaabbaaaabaabbabaaaababbabbabbab +aabaaaaabaaabaabbbabbaabaababbabbbaababababbbbab +baabaabaabbaababababaaba +aabaaaaaabbbbbabbaabaabb +aabaaabbaaabbbbaaaaaaaaabaaaaaba +babbbabbbbbbabbaaaabbaaabababbbbabbbaabbbaababbabbaabbbbabbbbbaabaaaabba +baabaababaaabbbbabbaabba +bbababaabbaabbbaabbbaabbababaaabbababbaaabbbaaabbbaabbbb +abaaabbabbaaabbaaabaabaa +babababbabbabbbbbababbaaaaabaabbaabaabbbabaaabababababaabaababab +bbabaabbaababaabbbaabaaaabbbbaabaaaaaabb +aababbaaabababbbbababbbbbbbbabbaabbaaaaabaababaa +abaabbabbaaabbaabaaabbba +bbbbaabaaababbababbbbbaa +baaabbbbbbbbbaaabaabbaaabbaabaab +aabbbababbababaaabbbaabbbbabaaab +bbbaabaaabbbabbaabbbbaaaabbbaabbabababbaabbbababbbaabbbb +aababbbabbabaababaaababbaabbbbaabbaabababbaaaabbaababaaa +bbaababbbabaabaaaabbbbbb +bbbabbbbabbabaaaababbbbabbbabaababaabbbbaababbbbabbbaaababbbabaabbabbbaa +bababbbbaabbaaaabbabbbab +bbabbabaaabaabbbaabbabaa +baabaaaaababbaaabbbbbabb +bababababbbbabbaabbaaaabaaabbabb +baaaaaababaaaaabbbaaabbb +ababbbbababababaabbabbab +baabbbaaabbabbbbbbaaaabb +bbbabaabbbaabbbabbabbbbb +aabaababaaaabbabbabbabaa +bbbbbabaabbbaaaabbaababaabaaababbbaabbabaababaaabbbaabaa +abbbaababababbbbabababba +bababbabbbbbabbabbbaababbaaabbabbabaabbaaabbbaabababbbaa +baabbbaabbbabbbbbbaaabab +abbbaabbaabaaabbbbbbababbbbbaabbbabaaabbabbbaaababbabbab +bbbbaaaaababbbbbaabbabbabbbbbaababbababbbabbaaaabbabaaab +bbbabbbbbaabaaababbbbaaaabbbabbbabbbabab +abbbaababbbbbbbbaaaabbabbaaabbbb +bbbababbaabbbabaabbbabab +ababbaaabbaaaaabaaaababa +bbbbabbaabaabbbabbabbbbbbbbbabbbaabbbababaaaabbaaaaaaabbbbaaaaaa +bbabaabbabababbbaaabbbaabaaabbaaabababbbabbbaaaaaaaabbaa +aaaaaaaaaaabbbbaaaabbabbaaaaabba diff --git a/2020/19/solve.c b/2020/19/solve.c index cea334e..7a8bfa6 100644 --- a/2020/19/solve.c +++ b/2020/19/solve.c @@ -1,4 +1,3 @@ -#include <ctype.h> #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -6,12 +5,22 @@ static char rules[256][256] = { 0 }; +// Who cares about code repetition? :P static int ind = 0; int verify(char *inp, char *rule) { char ch; - int num1, num2, num3, num4; - if (sscanf(rule, "%d %d | %d %d", &num1, &num2, &num3, &num4) == 4) { + int num1, num2, num3, num4, num5; + if (sscanf(rule, "%d %d | %d %d %d", &num1, &num2, &num3, &num4, &num5) == 5) { + int i = ind; + if ((verify(inp, rules[num1]) && verify(inp, rules[num2])) || + ((ind = i), verify(inp, rules[num3]) && verify(inp, rules[num4]) && + verify(inp, rules[num5]))) { + return ind; + } else { + return 0; + } + } else if (sscanf(rule, "%d %d | %d %d", &num1, &num2, &num3, &num4) == 4) { int i = ind; if ((verify(inp, rules[num1]) && verify(inp, rules[num2])) || ((ind = i), verify(inp, rules[num3]) && verify(inp, rules[num4]))) { @@ -19,6 +28,14 @@ int verify(char *inp, char *rule) } else { return 0; } + } else if (sscanf(rule, "%d | %d %d", &num1, &num2, &num3) == 3) { + int i = ind; + if (verify(inp, rules[num1]) || + ((ind = i), verify(inp, rules[num2]) && verify(inp, rules[num3]))) { + return ind; + } else { + return 0; + } } else if (sscanf(rule, "%d | %d", &num1, &num2) == 2) { int i = ind; if (verify(inp, rules[num1]) || ((ind = i), verify(inp, rules[num2]))) { @@ -55,7 +72,6 @@ long part_one(FILE *fp) int paragraph = 0; char *line = NULL; size_t len; - int i = 0; while (getline(&line, &len, fp) != -1) { if (line[0] == '\n') { paragraph++; @@ -81,22 +97,46 @@ long part_two(FILE *fp) { long res = 0; + int paragraph = 0; + char *line = NULL; + size_t len; + while (getline(&line, &len, fp) != -1) { + if (line[0] == '\n') { + paragraph++; + continue; + } + + if (paragraph == 0) { + char rule[64] = { 0 }; + int ind = 0; + sscanf(line, "%d: %64[0-9a-z \"|]", &ind, rule); + strcpy(rules[ind], rule); + } else if (paragraph == 1) { + ind = 0; + if (verify(line, rules[0]) == strlen(line) - 1) + res++; + } + } + return res; } int main(int argc, char *argv[]) { - FILE *fp = fopen("input", "r"); - if (!fp) + FILE *fp1 = fopen("input1", "r"); + if (!fp1) + exit(EXIT_FAILURE); + FILE *fp2 = fopen("input2", "r"); + if (!fp2) exit(EXIT_FAILURE); clock_t tic = clock(); - printf("%lu\n", part_one(fp)); - rewind(fp); - printf("%lu\n", part_two(fp)); + printf("%lu\n", part_one(fp1)); + printf("%lu\n", part_two(fp2)); clock_t toc = clock(); printf("TIME: %f seconds\n", (double)(toc - tic) / CLOCKS_PER_SEC); - fclose(fp); + fclose(fp1); + fclose(fp2); return 0; } |