From e54d9297ffe5be50fa49864563e1da89fd435736 Mon Sep 17 00:00:00 2001 From: Tyler Hallada Date: Sat, 15 Dec 2018 02:53:53 -0500 Subject: [PATCH] Day 3 part 1 --- Cargo.lock | 91 +++ Cargo.toml | 1 + inputs/3.txt | 1401 +++++++++++++++++++++++++++++++++++ inputs/3_test.txt | 3 + inputs/3_test_malformed.txt | 3 + src/day3.rs | 164 ++++ src/main.rs | 3 + 7 files changed, 1666 insertions(+) create mode 100644 inputs/3.txt create mode 100644 inputs/3_test.txt create mode 100644 inputs/3_test_malformed.txt create mode 100644 src/day3.rs diff --git a/Cargo.lock b/Cargo.lock index 616734c..840fba7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,4 +1,95 @@ [[package]] name = "advent-of-code-2018" version = "0.1.0" +dependencies = [ + "regex 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", +] +[[package]] +name = "aho-corasick" +version = "0.6.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "memchr 2.1.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "cfg-if" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "lazy_static" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "libc" +version = "0.2.45" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "memchr" +version = "2.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.45 (registry+https://github.com/rust-lang/crates.io-index)", + "version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "regex" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "aho-corasick 0.6.9 (registry+https://github.com/rust-lang/crates.io-index)", + "memchr 2.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "regex-syntax 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", + "utf8-ranges 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "regex-syntax" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "ucd-util 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "thread_local" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "ucd-util" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "utf8-ranges" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "version_check" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[metadata] +"checksum aho-corasick 0.6.9 (registry+https://github.com/rust-lang/crates.io-index)" = "1e9a933f4e58658d7b12defcf96dc5c720f20832deebe3e0a19efd3b6aaeeb9e" +"checksum cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "082bb9b28e00d3c9d39cc03e64ce4cea0f1bb9b3fde493f0cbc008472d22bdf4" +"checksum lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a374c89b9db55895453a74c1e38861d9deec0b01b405a82516e9d5de4820dea1" +"checksum libc 0.2.45 (registry+https://github.com/rust-lang/crates.io-index)" = "2d2857ec59fadc0773853c664d2d18e7198e83883e7060b63c924cb077bd5c74" +"checksum memchr 2.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "db4c41318937f6e76648f42826b1d9ade5c09cafb5aef7e351240a70f39206e9" +"checksum regex 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "37e7cbbd370869ce2e8dff25c7018702d10b21a20ef7135316f8daecd6c25b7f" +"checksum regex-syntax 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)" = "4e47a2ed29da7a9e1960e1639e7a982e6edc6d49be308a3b02daf511504a16d1" +"checksum thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c6b53e329000edc2b34dbe8545fd20e55a333362d0a321909685a19bd28c3f1b" +"checksum ucd-util 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "535c204ee4d8434478593480b8f86ab45ec9aae0e83c568ca81abf0fd0e88f86" +"checksum utf8-ranges 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "796f7e48bef87609f7ade7e06495a87d5cd06c7866e6a5cbfceffc558a243737" +"checksum version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "914b1a6776c4c929a602fafd8bc742e06365d4bcbe48c30f9cca5824f70dc9dd" diff --git a/Cargo.toml b/Cargo.toml index 2b02252..2636da2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,3 +5,4 @@ authors = ["Tyler Hallada "] edition = "2018" [dependencies] +regex = "1" diff --git a/inputs/3.txt b/inputs/3.txt new file mode 100644 index 0000000..7a4dde3 --- /dev/null +++ b/inputs/3.txt @@ -0,0 +1,1401 @@ +#1 @ 53,238: 26x24 +#2 @ 134,11: 27x12 +#3 @ 937,817: 10x25 +#4 @ 441,971: 21x15 +#5 @ 881,682: 16x24 +#6 @ 769,699: 18x26 +#7 @ 303,593: 27x28 +#8 @ 31,205: 11x15 +#9 @ 489,318: 25x20 +#10 @ 948,659: 16x10 +#11 @ 650,921: 6x7 +#12 @ 487,199: 13x20 +#13 @ 127,4: 14x22 +#14 @ 797,94: 23x26 +#15 @ 566,190: 14x24 +#16 @ 53,389: 12x15 +#17 @ 794,737: 24x24 +#18 @ 439,810: 11x22 +#19 @ 20,711: 21x15 +#20 @ 39,125: 18x21 +#21 @ 432,838: 20x11 +#22 @ 192,497: 29x10 +#23 @ 374,342: 24x28 +#24 @ 247,275: 14x29 +#25 @ 820,212: 12x17 +#26 @ 731,966: 22x24 +#27 @ 272,281: 17x26 +#28 @ 190,950: 16x10 +#29 @ 889,170: 7x18 +#30 @ 422,962: 19x27 +#31 @ 144,302: 28x20 +#32 @ 440,432: 16x15 +#33 @ 513,787: 20x21 +#34 @ 127,358: 18x15 +#35 @ 863,125: 23x21 +#36 @ 567,321: 25x14 +#37 @ 86,861: 13x13 +#38 @ 667,335: 13x17 +#39 @ 567,846: 29x22 +#40 @ 432,886: 14x29 +#41 @ 310,307: 29x13 +#42 @ 734,281: 28x28 +#43 @ 321,763: 25x20 +#44 @ 955,742: 10x16 +#45 @ 730,249: 13x16 +#46 @ 952,461: 16x28 +#47 @ 280,656: 26x17 +#48 @ 205,222: 22x28 +#49 @ 983,95: 14x16 +#50 @ 365,915: 6x4 +#51 @ 901,364: 26x22 +#52 @ 555,48: 24x26 +#53 @ 215,236: 20x28 +#54 @ 316,671: 24x16 +#55 @ 902,379: 10x18 +#56 @ 675,883: 3x8 +#57 @ 180,153: 15x21 +#58 @ 627,566: 29x20 +#59 @ 104,479: 10x17 +#60 @ 142,221: 14x16 +#61 @ 48,52: 10x16 +#62 @ 754,552: 16x29 +#63 @ 119,392: 18x26 +#64 @ 892,371: 22x15 +#65 @ 23,240: 18x25 +#66 @ 781,333: 12x18 +#67 @ 967,566: 23x23 +#68 @ 202,898: 29x15 +#69 @ 223,562: 25x17 +#70 @ 737,748: 25x11 +#71 @ 201,606: 17x16 +#72 @ 698,764: 15x23 +#73 @ 345,279: 25x12 +#74 @ 679,450: 28x22 +#75 @ 959,320: 6x5 +#76 @ 288,41: 21x26 +#77 @ 440,869: 27x18 +#78 @ 758,558: 22x29 +#79 @ 394,665: 23x20 +#80 @ 871,957: 15x16 +#81 @ 660,671: 10x28 +#82 @ 173,971: 10x17 +#83 @ 561,127: 28x16 +#84 @ 673,51: 10x18 +#85 @ 379,162: 26x12 +#86 @ 320,873: 19x15 +#87 @ 83,523: 21x20 +#88 @ 587,952: 24x21 +#89 @ 84,747: 11x14 +#90 @ 256,212: 19x28 +#91 @ 31,657: 27x11 +#92 @ 793,477: 13x11 +#93 @ 46,389: 15x18 +#94 @ 671,964: 26x23 +#95 @ 282,889: 10x26 +#96 @ 249,800: 15x27 +#97 @ 44,924: 24x17 +#98 @ 347,892: 11x21 +#99 @ 89,708: 19x16 +#100 @ 762,589: 26x19 +#101 @ 77,240: 11x20 +#102 @ 729,381: 18x14 +#103 @ 878,682: 4x7 +#104 @ 208,149: 26x20 +#105 @ 147,620: 27x24 +#106 @ 546,473: 18x23 +#107 @ 949,323: 29x11 +#108 @ 796,655: 17x20 +#109 @ 805,942: 16x19 +#110 @ 441,734: 24x13 +#111 @ 851,187: 29x20 +#112 @ 678,871: 29x28 +#113 @ 177,154: 11x23 +#114 @ 762,649: 24x20 +#115 @ 718,853: 18x15 +#116 @ 579,812: 11x19 +#117 @ 776,850: 14x11 +#118 @ 71,295: 27x13 +#119 @ 567,842: 28x21 +#120 @ 45,898: 14x17 +#121 @ 432,661: 10x11 +#122 @ 263,561: 17x17 +#123 @ 704,363: 21x23 +#124 @ 37,524: 13x17 +#125 @ 484,279: 26x24 +#126 @ 104,323: 23x21 +#127 @ 417,270: 24x28 +#128 @ 338,326: 10x12 +#129 @ 717,47: 14x24 +#130 @ 959,425: 19x25 +#131 @ 660,631: 23x13 +#132 @ 172,938: 11x22 +#133 @ 856,114: 10x13 +#134 @ 497,476: 22x11 +#135 @ 169,195: 23x24 +#136 @ 485,754: 20x22 +#137 @ 693,683: 26x11 +#138 @ 278,304: 22x18 +#139 @ 682,318: 17x18 +#140 @ 625,131: 21x29 +#141 @ 715,974: 19x12 +#142 @ 193,217: 26x14 +#143 @ 707,437: 27x10 +#144 @ 427,234: 10x14 +#145 @ 155,413: 10x15 +#146 @ 961,551: 13x28 +#147 @ 899,351: 17x23 +#148 @ 362,827: 12x21 +#149 @ 459,360: 22x21 +#150 @ 564,194: 17x22 +#151 @ 566,477: 25x24 +#152 @ 897,638: 24x10 +#153 @ 508,332: 23x14 +#154 @ 826,884: 10x24 +#155 @ 657,516: 26x21 +#156 @ 711,80: 15x10 +#157 @ 529,611: 27x18 +#158 @ 292,596: 20x23 +#159 @ 489,175: 27x11 +#160 @ 649,984: 28x14 +#161 @ 870,780: 26x11 +#162 @ 920,374: 13x25 +#163 @ 496,497: 29x17 +#164 @ 842,214: 18x11 +#165 @ 642,983: 23x12 +#166 @ 377,832: 27x18 +#167 @ 76,720: 25x16 +#168 @ 683,467: 23x23 +#169 @ 834,735: 28x13 +#170 @ 795,441: 5x4 +#171 @ 949,51: 10x25 +#172 @ 953,43: 16x27 +#173 @ 91,64: 13x23 +#174 @ 156,966: 20x20 +#175 @ 330,204: 16x23 +#176 @ 639,638: 28x11 +#177 @ 749,27: 15x14 +#178 @ 830,253: 26x21 +#179 @ 528,386: 28x16 +#180 @ 470,758: 19x16 +#181 @ 743,617: 11x23 +#182 @ 367,495: 29x20 +#183 @ 147,307: 27x21 +#184 @ 283,487: 11x25 +#185 @ 938,630: 10x24 +#186 @ 278,374: 24x27 +#187 @ 585,871: 16x23 +#188 @ 716,42: 18x27 +#189 @ 663,637: 7x14 +#190 @ 599,543: 14x19 +#191 @ 732,568: 12x11 +#192 @ 769,567: 17x24 +#193 @ 226,32: 18x23 +#194 @ 334,85: 17x23 +#195 @ 145,224: 12x23 +#196 @ 234,301: 18x17 +#197 @ 605,765: 21x26 +#198 @ 890,639: 27x10 +#199 @ 699,563: 23x16 +#200 @ 582,234: 14x29 +#201 @ 558,452: 10x16 +#202 @ 668,589: 16x18 +#203 @ 257,797: 11x21 +#204 @ 259,467: 19x17 +#205 @ 327,246: 21x20 +#206 @ 826,871: 18x24 +#207 @ 643,135: 22x12 +#208 @ 559,689: 20x21 +#209 @ 402,788: 13x22 +#210 @ 110,195: 18x13 +#211 @ 587,676: 27x29 +#212 @ 344,626: 11x21 +#213 @ 445,508: 27x16 +#214 @ 450,817: 25x17 +#215 @ 817,619: 29x14 +#216 @ 667,389: 5x8 +#217 @ 231,300: 27x24 +#218 @ 181,391: 16x20 +#219 @ 801,891: 22x13 +#220 @ 519,448: 19x24 +#221 @ 582,829: 29x16 +#222 @ 376,916: 17x19 +#223 @ 800,139: 15x11 +#224 @ 287,744: 25x17 +#225 @ 373,150: 21x18 +#226 @ 478,389: 28x22 +#227 @ 27,694: 29x19 +#228 @ 579,213: 12x21 +#229 @ 4,841: 10x21 +#230 @ 612,448: 15x13 +#231 @ 834,608: 21x23 +#232 @ 744,219: 19x16 +#233 @ 332,920: 17x13 +#234 @ 616,226: 28x22 +#235 @ 321,28: 15x18 +#236 @ 569,491: 25x20 +#237 @ 702,366: 17x17 +#238 @ 452,7: 19x24 +#239 @ 825,843: 22x17 +#240 @ 743,64: 17x18 +#241 @ 444,595: 19x10 +#242 @ 243,518: 9x11 +#243 @ 645,133: 26x21 +#244 @ 802,899: 10x25 +#245 @ 964,270: 25x24 +#246 @ 257,232: 24x26 +#247 @ 622,687: 13x28 +#248 @ 32,248: 28x18 +#249 @ 306,502: 24x27 +#250 @ 830,27: 29x13 +#251 @ 50,436: 27x18 +#252 @ 366,330: 23x18 +#253 @ 594,708: 19x14 +#254 @ 486,730: 20x26 +#255 @ 788,938: 24x16 +#256 @ 15,667: 17x15 +#257 @ 976,404: 19x13 +#258 @ 945,318: 26x11 +#259 @ 648,919: 13x13 +#260 @ 721,625: 27x22 +#261 @ 166,113: 24x11 +#262 @ 639,948: 18x10 +#263 @ 380,642: 23x18 +#264 @ 425,869: 21x15 +#265 @ 560,201: 18x14 +#266 @ 69,149: 26x29 +#267 @ 785,426: 21x27 +#268 @ 642,643: 20x29 +#269 @ 763,542: 28x19 +#270 @ 294,101: 12x28 +#271 @ 741,77: 15x18 +#272 @ 898,378: 11x19 +#273 @ 359,421: 17x10 +#274 @ 760,870: 23x16 +#275 @ 130,251: 15x7 +#276 @ 816,183: 22x14 +#277 @ 375,695: 23x24 +#278 @ 975,873: 17x19 +#279 @ 905,768: 28x14 +#280 @ 797,939: 15x26 +#281 @ 80,757: 17x13 +#282 @ 488,615: 14x14 +#283 @ 624,208: 26x29 +#284 @ 500,410: 21x27 +#285 @ 810,733: 27x10 +#286 @ 951,760: 10x24 +#287 @ 88,926: 19x23 +#288 @ 613,780: 28x10 +#289 @ 52,750: 29x21 +#290 @ 379,226: 16x22 +#291 @ 359,210: 10x12 +#292 @ 783,504: 26x29 +#293 @ 653,931: 23x27 +#294 @ 666,878: 17x23 +#295 @ 491,903: 18x20 +#296 @ 269,207: 22x17 +#297 @ 380,507: 13x18 +#298 @ 770,528: 25x16 +#299 @ 171,984: 23x11 +#300 @ 313,24: 28x28 +#301 @ 510,890: 28x27 +#302 @ 13,454: 20x19 +#303 @ 726,176: 27x24 +#304 @ 631,807: 13x12 +#305 @ 951,68: 4x16 +#306 @ 847,107: 27x23 +#307 @ 943,970: 10x15 +#308 @ 322,10: 10x26 +#309 @ 664,677: 25x10 +#310 @ 335,67: 14x19 +#311 @ 458,647: 18x12 +#312 @ 664,35: 20x27 +#313 @ 158,46: 18x29 +#314 @ 265,223: 20x13 +#315 @ 712,164: 10x20 +#316 @ 724,225: 10x15 +#317 @ 267,500: 18x10 +#318 @ 103,925: 18x24 +#319 @ 900,124: 13x23 +#320 @ 32,414: 19x11 +#321 @ 535,326: 21x19 +#322 @ 390,654: 10x11 +#323 @ 221,301: 14x17 +#324 @ 576,576: 15x17 +#325 @ 538,701: 13x19 +#326 @ 539,573: 14x20 +#327 @ 885,645: 21x14 +#328 @ 155,192: 20x24 +#329 @ 151,16: 13x25 +#330 @ 455,230: 12x18 +#331 @ 151,207: 25x14 +#332 @ 102,608: 23x17 +#333 @ 710,521: 21x17 +#334 @ 43,191: 15x24 +#335 @ 584,47: 14x17 +#336 @ 708,46: 29x12 +#337 @ 882,866: 21x3 +#338 @ 488,837: 11x25 +#339 @ 33,900: 26x28 +#340 @ 188,155: 27x26 +#341 @ 623,409: 20x18 +#342 @ 234,419: 16x29 +#343 @ 44,528: 21x23 +#344 @ 476,32: 15x17 +#345 @ 487,402: 13x18 +#346 @ 364,628: 29x18 +#347 @ 542,403: 14x12 +#348 @ 251,534: 19x16 +#349 @ 836,651: 13x29 +#350 @ 75,229: 15x13 +#351 @ 211,580: 26x20 +#352 @ 818,220: 28x20 +#353 @ 705,694: 27x24 +#354 @ 15,628: 13x21 +#355 @ 830,657: 16x12 +#356 @ 732,841: 21x22 +#357 @ 741,559: 15x23 +#358 @ 830,276: 24x13 +#359 @ 109,236: 26x15 +#360 @ 895,520: 10x17 +#361 @ 378,240: 20x29 +#362 @ 773,82: 20x15 +#363 @ 428,981: 16x11 +#364 @ 218,772: 25x20 +#365 @ 158,920: 29x25 +#366 @ 497,322: 10x23 +#367 @ 507,684: 22x10 +#368 @ 425,549: 17x23 +#369 @ 833,865: 15x24 +#370 @ 91,106: 4x6 +#371 @ 574,388: 11x14 +#372 @ 583,814: 11x14 +#373 @ 184,389: 15x22 +#374 @ 753,631: 10x10 +#375 @ 672,708: 27x18 +#376 @ 835,112: 18x14 +#377 @ 845,177: 28x29 +#378 @ 759,894: 21x24 +#379 @ 824,186: 13x28 +#380 @ 336,558: 22x16 +#381 @ 112,358: 13x27 +#382 @ 397,701: 27x21 +#383 @ 352,629: 21x28 +#384 @ 872,764: 17x20 +#385 @ 592,655: 25x22 +#386 @ 384,893: 22x20 +#387 @ 814,247: 17x29 +#388 @ 793,429: 7x11 +#389 @ 453,510: 17x12 +#390 @ 937,516: 29x14 +#391 @ 322,662: 12x11 +#392 @ 542,242: 24x28 +#393 @ 272,372: 28x13 +#394 @ 867,771: 21x10 +#395 @ 219,214: 26x22 +#396 @ 445,594: 25x12 +#397 @ 905,346: 13x17 +#398 @ 462,512: 19x18 +#399 @ 223,610: 22x25 +#400 @ 617,681: 17x15 +#401 @ 874,18: 15x21 +#402 @ 884,545: 15x17 +#403 @ 502,640: 12x24 +#404 @ 245,958: 29x23 +#405 @ 818,689: 22x23 +#406 @ 680,880: 16x20 +#407 @ 886,168: 23x24 +#408 @ 78,492: 27x10 +#409 @ 535,461: 22x23 +#410 @ 804,632: 25x29 +#411 @ 911,47: 24x20 +#412 @ 24,59: 29x13 +#413 @ 176,925: 18x22 +#414 @ 460,29: 19x15 +#415 @ 618,687: 24x23 +#416 @ 251,381: 21x17 +#417 @ 822,658: 27x24 +#418 @ 152,11: 14x20 +#419 @ 394,613: 21x14 +#420 @ 148,146: 19x14 +#421 @ 840,15: 25x25 +#422 @ 28,362: 12x14 +#423 @ 735,733: 10x13 +#424 @ 361,912: 26x12 +#425 @ 787,866: 16x25 +#426 @ 402,395: 14x11 +#427 @ 15,350: 21x20 +#428 @ 37,241: 25x10 +#429 @ 83,104: 18x13 +#430 @ 589,859: 12x21 +#431 @ 91,321: 13x29 +#432 @ 699,533: 19x22 +#433 @ 334,641: 27x14 +#434 @ 12,162: 25x16 +#435 @ 903,385: 10x25 +#436 @ 91,33: 17x29 +#437 @ 668,797: 12x16 +#438 @ 498,473: 29x25 +#439 @ 829,477: 23x28 +#440 @ 949,443: 19x24 +#441 @ 657,387: 26x14 +#442 @ 47,918: 21x21 +#443 @ 288,89: 26x15 +#444 @ 902,437: 25x22 +#445 @ 253,818: 26x20 +#446 @ 73,337: 29x18 +#447 @ 379,362: 28x23 +#448 @ 659,85: 13x18 +#449 @ 505,165: 12x22 +#450 @ 772,908: 20x10 +#451 @ 295,311: 28x12 +#452 @ 150,321: 17x14 +#453 @ 66,921: 22x24 +#454 @ 825,202: 18x15 +#455 @ 103,622: 22x16 +#456 @ 195,513: 18x21 +#457 @ 903,781: 24x13 +#458 @ 688,886: 25x26 +#459 @ 518,650: 11x17 +#460 @ 810,863: 23x20 +#461 @ 493,172: 17x12 +#462 @ 440,667: 26x16 +#463 @ 696,390: 13x25 +#464 @ 116,547: 18x10 +#465 @ 953,894: 10x10 +#466 @ 308,715: 21x15 +#467 @ 768,77: 18x10 +#468 @ 605,478: 24x24 +#469 @ 403,471: 21x28 +#470 @ 885,562: 20x24 +#471 @ 327,574: 22x23 +#472 @ 295,376: 20x23 +#473 @ 887,864: 17x12 +#474 @ 74,169: 12x15 +#475 @ 975,676: 11x11 +#476 @ 951,303: 12x13 +#477 @ 715,252: 19x13 +#478 @ 662,503: 10x25 +#479 @ 545,499: 21x23 +#480 @ 494,623: 13x28 +#481 @ 333,123: 27x22 +#482 @ 880,858: 28x17 +#483 @ 310,262: 28x13 +#484 @ 487,905: 20x18 +#485 @ 500,502: 22x10 +#486 @ 414,446: 27x26 +#487 @ 408,795: 12x17 +#488 @ 759,365: 15x14 +#489 @ 853,838: 29x15 +#490 @ 128,824: 15x15 +#491 @ 839,782: 17x20 +#492 @ 674,664: 20x28 +#493 @ 285,199: 29x10 +#494 @ 312,255: 23x17 +#495 @ 358,193: 25x19 +#496 @ 568,566: 7x11 +#497 @ 670,315: 16x27 +#498 @ 841,777: 19x10 +#499 @ 336,835: 19x28 +#500 @ 248,596: 17x20 +#501 @ 971,945: 28x13 +#502 @ 423,658: 27x10 +#503 @ 813,341: 21x17 +#504 @ 568,196: 18x25 +#505 @ 27,627: 23x13 +#506 @ 881,461: 27x15 +#507 @ 67,154: 29x29 +#508 @ 114,911: 27x24 +#509 @ 711,138: 24x29 +#510 @ 22,932: 29x26 +#511 @ 87,861: 20x16 +#512 @ 179,161: 5x5 +#513 @ 746,882: 25x22 +#514 @ 549,370: 10x22 +#515 @ 520,554: 14x18 +#516 @ 157,863: 18x10 +#517 @ 802,878: 13x14 +#518 @ 497,761: 10x25 +#519 @ 442,171: 12x10 +#520 @ 844,821: 12x24 +#521 @ 504,658: 17x10 +#522 @ 19,251: 11x25 +#523 @ 700,16: 12x11 +#524 @ 466,774: 19x29 +#525 @ 766,828: 19x25 +#526 @ 218,592: 14x13 +#527 @ 295,137: 21x28 +#528 @ 507,567: 28x11 +#529 @ 99,635: 11x19 +#530 @ 775,809: 28x17 +#531 @ 697,381: 12x15 +#532 @ 40,707: 14x25 +#533 @ 631,786: 10x23 +#534 @ 940,610: 20x29 +#535 @ 688,745: 19x13 +#536 @ 647,152: 29x23 +#537 @ 370,815: 29x21 +#538 @ 856,432: 29x21 +#539 @ 449,26: 28x26 +#540 @ 196,498: 27x28 +#541 @ 131,358: 10x14 +#542 @ 101,307: 25x12 +#543 @ 355,589: 15x17 +#544 @ 214,569: 18x24 +#545 @ 625,709: 25x22 +#546 @ 89,413: 14x29 +#547 @ 511,116: 13x25 +#548 @ 536,444: 10x16 +#549 @ 736,190: 19x13 +#550 @ 301,482: 17x25 +#551 @ 658,370: 23x23 +#552 @ 862,732: 23x29 +#553 @ 34,668: 14x16 +#554 @ 537,337: 10x27 +#555 @ 531,451: 13x17 +#556 @ 278,58: 19x16 +#557 @ 761,793: 25x17 +#558 @ 300,896: 26x16 +#559 @ 36,941: 29x20 +#560 @ 619,141: 20x10 +#561 @ 56,897: 22x11 +#562 @ 224,516: 24x27 +#563 @ 171,617: 24x23 +#564 @ 453,40: 29x19 +#565 @ 406,762: 13x22 +#566 @ 780,641: 23x29 +#567 @ 94,753: 13x10 +#568 @ 876,680: 10x12 +#569 @ 243,669: 13x17 +#570 @ 456,273: 13x20 +#571 @ 329,846: 10x21 +#572 @ 769,898: 3x16 +#573 @ 420,323: 25x22 +#574 @ 246,147: 12x22 +#575 @ 687,686: 18x21 +#576 @ 520,914: 17x24 +#577 @ 956,711: 10x23 +#578 @ 888,526: 17x27 +#579 @ 119,617: 12x17 +#580 @ 892,223: 28x17 +#581 @ 113,372: 14x11 +#582 @ 793,439: 19x15 +#583 @ 525,618: 19x23 +#584 @ 107,462: 29x16 +#585 @ 118,140: 12x13 +#586 @ 173,847: 16x24 +#587 @ 590,827: 22x20 +#588 @ 303,301: 19x16 +#589 @ 426,248: 11x15 +#590 @ 91,61: 18x12 +#591 @ 724,673: 21x25 +#592 @ 384,905: 11x21 +#593 @ 777,215: 24x14 +#594 @ 214,435: 16x13 +#595 @ 228,49: 16x28 +#596 @ 882,655: 26x12 +#597 @ 445,716: 18x27 +#598 @ 859,148: 23x11 +#599 @ 338,90: 15x13 +#600 @ 794,710: 17x26 +#601 @ 284,767: 29x16 +#602 @ 120,957: 27x29 +#603 @ 248,881: 13x29 +#604 @ 106,209: 19x27 +#605 @ 814,755: 15x29 +#606 @ 605,504: 21x21 +#607 @ 639,794: 19x25 +#608 @ 219,14: 21x23 +#609 @ 273,490: 13x12 +#610 @ 447,223: 28x15 +#611 @ 544,544: 19x19 +#612 @ 842,596: 10x22 +#613 @ 726,818: 14x11 +#614 @ 221,160: 25x28 +#615 @ 821,204: 16x27 +#616 @ 689,874: 14x26 +#617 @ 905,601: 12x22 +#618 @ 331,224: 12x22 +#619 @ 661,635: 12x23 +#620 @ 124,336: 24x23 +#621 @ 214,252: 10x26 +#622 @ 286,162: 29x12 +#623 @ 488,214: 16x10 +#624 @ 567,255: 20x14 +#625 @ 518,118: 18x28 +#626 @ 93,800: 11x23 +#627 @ 747,610: 23x27 +#628 @ 749,196: 29x25 +#629 @ 575,613: 15x29 +#630 @ 266,577: 11x21 +#631 @ 748,796: 18x21 +#632 @ 380,977: 21x13 +#633 @ 555,446: 14x28 +#634 @ 187,961: 16x18 +#635 @ 792,556: 22x29 +#636 @ 882,948: 12x27 +#637 @ 342,644: 24x23 +#638 @ 686,273: 14x14 +#639 @ 760,577: 22x13 +#640 @ 806,107: 29x13 +#641 @ 85,753: 23x12 +#642 @ 25,420: 11x21 +#643 @ 879,523: 10x27 +#644 @ 325,614: 19x20 +#645 @ 537,692: 22x23 +#646 @ 584,850: 28x22 +#647 @ 527,82: 26x23 +#648 @ 506,556: 12x21 +#649 @ 228,818: 16x24 +#650 @ 414,229: 28x22 +#651 @ 708,230: 26x23 +#652 @ 304,68: 29x22 +#653 @ 564,554: 11x25 +#654 @ 627,571: 29x28 +#655 @ 702,811: 26x24 +#656 @ 378,405: 25x23 +#657 @ 708,440: 29x20 +#658 @ 922,55: 23x21 +#659 @ 343,80: 12x17 +#660 @ 14,166: 20x16 +#661 @ 194,185: 28x14 +#662 @ 190,256: 22x26 +#663 @ 945,612: 27x28 +#664 @ 326,564: 27x29 +#665 @ 698,130: 29x15 +#666 @ 886,341: 29x20 +#667 @ 89,298: 20x24 +#668 @ 652,965: 24x22 +#669 @ 443,199: 26x22 +#670 @ 719,609: 21x29 +#671 @ 537,576: 10x20 +#672 @ 242,606: 19x15 +#673 @ 951,629: 24x10 +#674 @ 934,641: 20x26 +#675 @ 5,853: 12x24 +#676 @ 818,130: 24x21 +#677 @ 363,810: 23x24 +#678 @ 783,341: 24x21 +#679 @ 155,427: 15x18 +#680 @ 456,466: 21x28 +#681 @ 418,183: 28x26 +#682 @ 72,538: 28x15 +#683 @ 737,810: 16x25 +#684 @ 492,505: 10x12 +#685 @ 683,141: 28x19 +#686 @ 459,201: 6x6 +#687 @ 222,509: 16x10 +#688 @ 53,941: 22x12 +#689 @ 103,293: 18x25 +#690 @ 392,443: 26x23 +#691 @ 541,15: 15x22 +#692 @ 551,741: 28x12 +#693 @ 549,851: 26x18 +#694 @ 818,374: 27x10 +#695 @ 237,519: 20x27 +#696 @ 573,202: 18x28 +#697 @ 474,145: 15x20 +#698 @ 537,847: 18x24 +#699 @ 503,614: 27x22 +#700 @ 455,238: 24x20 +#701 @ 95,815: 25x24 +#702 @ 663,660: 29x23 +#703 @ 805,954: 10x15 +#704 @ 820,860: 29x14 +#705 @ 653,492: 13x15 +#706 @ 690,970: 17x14 +#707 @ 155,868: 12x17 +#708 @ 887,379: 23x13 +#709 @ 711,977: 22x22 +#710 @ 148,8: 14x12 +#711 @ 181,595: 19x17 +#712 @ 880,348: 24x11 +#713 @ 810,122: 12x15 +#714 @ 848,913: 14x19 +#715 @ 112,178: 17x24 +#716 @ 476,766: 19x17 +#717 @ 218,418: 25x24 +#718 @ 484,77: 25x20 +#719 @ 857,38: 25x26 +#720 @ 245,236: 15x15 +#721 @ 783,239: 26x12 +#722 @ 895,785: 15x18 +#723 @ 323,772: 17x19 +#724 @ 487,853: 19x17 +#725 @ 780,834: 29x23 +#726 @ 481,848: 12x13 +#727 @ 639,434: 17x14 +#728 @ 456,633: 25x20 +#729 @ 712,559: 22x28 +#730 @ 665,530: 18x11 +#731 @ 302,779: 12x12 +#732 @ 510,622: 24x20 +#733 @ 802,96: 12x29 +#734 @ 894,578: 25x24 +#735 @ 935,30: 17x27 +#736 @ 414,400: 21x27 +#737 @ 795,946: 14x17 +#738 @ 867,871: 23x23 +#739 @ 608,327: 16x17 +#740 @ 509,675: 29x13 +#741 @ 130,963: 25x12 +#742 @ 455,19: 10x20 +#743 @ 488,174: 21x19 +#744 @ 951,822: 16x13 +#745 @ 133,534: 22x15 +#746 @ 399,553: 27x10 +#747 @ 320,322: 25x15 +#748 @ 614,488: 14x18 +#749 @ 361,718: 26x29 +#750 @ 809,803: 14x23 +#751 @ 719,51: 11x17 +#752 @ 464,678: 28x10 +#753 @ 381,138: 18x20 +#754 @ 321,77: 11x14 +#755 @ 187,942: 22x29 +#756 @ 849,905: 25x21 +#757 @ 270,461: 12x11 +#758 @ 109,545: 26x18 +#759 @ 771,224: 20x22 +#760 @ 373,168: 22x29 +#761 @ 15,913: 11x16 +#762 @ 955,927: 17x27 +#763 @ 177,198: 17x28 +#764 @ 637,795: 24x12 +#765 @ 118,965: 18x15 +#766 @ 136,894: 11x21 +#767 @ 803,128: 27x29 +#768 @ 413,248: 26x18 +#769 @ 653,372: 12x14 +#770 @ 663,746: 24x23 +#771 @ 189,932: 11x13 +#772 @ 883,971: 24x28 +#773 @ 445,251: 17x23 +#774 @ 881,448: 16x23 +#775 @ 727,703: 22x15 +#776 @ 11,584: 21x12 +#777 @ 800,343: 13x21 +#778 @ 435,344: 13x17 +#779 @ 712,693: 13x17 +#780 @ 20,917: 28x22 +#781 @ 224,427: 28x14 +#782 @ 606,740: 14x13 +#783 @ 395,346: 11x15 +#784 @ 458,750: 18x23 +#785 @ 408,525: 25x24 +#786 @ 405,248: 25x23 +#787 @ 698,435: 19x12 +#788 @ 363,873: 23x29 +#789 @ 165,251: 24x12 +#790 @ 745,637: 14x20 +#791 @ 12,656: 25x20 +#792 @ 653,482: 17x12 +#793 @ 219,336: 14x20 +#794 @ 836,621: 18x23 +#795 @ 816,623: 24x23 +#796 @ 304,596: 11x11 +#797 @ 202,549: 10x27 +#798 @ 254,976: 15x17 +#799 @ 182,121: 16x15 +#800 @ 839,634: 29x24 +#801 @ 515,433: 19x10 +#802 @ 565,50: 27x20 +#803 @ 500,774: 15x20 +#804 @ 326,55: 12x16 +#805 @ 688,89: 22x27 +#806 @ 548,129: 17x29 +#807 @ 867,698: 15x16 +#808 @ 155,398: 28x22 +#809 @ 932,825: 14x11 +#810 @ 264,887: 10x12 +#811 @ 755,651: 19x19 +#812 @ 761,570: 20x21 +#813 @ 181,227: 25x27 +#814 @ 720,930: 22x14 +#815 @ 430,272: 12x23 +#816 @ 772,453: 20x11 +#817 @ 574,853: 21x26 +#818 @ 219,432: 10x22 +#819 @ 765,908: 27x28 +#820 @ 897,532: 26x24 +#821 @ 68,345: 14x12 +#822 @ 379,959: 29x23 +#823 @ 551,475: 4x11 +#824 @ 779,859: 18x17 +#825 @ 733,551: 27x13 +#826 @ 922,233: 18x24 +#827 @ 424,650: 16x22 +#828 @ 8,879: 13x7 +#829 @ 713,135: 18x20 +#830 @ 495,836: 27x13 +#831 @ 176,409: 17x22 +#832 @ 169,173: 22x13 +#833 @ 550,8: 10x15 +#834 @ 321,896: 14x18 +#835 @ 82,974: 25x26 +#836 @ 640,423: 26x17 +#837 @ 300,647: 21x12 +#838 @ 497,651: 10x11 +#839 @ 703,656: 10x28 +#840 @ 512,792: 10x21 +#841 @ 636,146: 13x27 +#842 @ 421,523: 10x13 +#843 @ 192,255: 20x16 +#844 @ 341,630: 18x21 +#845 @ 883,874: 17x24 +#846 @ 891,497: 16x10 +#847 @ 257,885: 10x29 +#848 @ 478,378: 23x21 +#849 @ 822,122: 14x28 +#850 @ 711,743: 27x11 +#851 @ 558,256: 14x25 +#852 @ 574,900: 15x10 +#853 @ 785,449: 29x11 +#854 @ 766,373: 12x12 +#855 @ 303,174: 16x19 +#856 @ 636,788: 14x22 +#857 @ 795,583: 19x29 +#858 @ 105,301: 25x15 +#859 @ 431,468: 29x19 +#860 @ 65,416: 29x27 +#861 @ 586,146: 25x25 +#862 @ 926,255: 17x10 +#863 @ 890,480: 16x23 +#864 @ 388,660: 23x24 +#865 @ 155,38: 29x26 +#866 @ 444,52: 11x11 +#867 @ 325,138: 17x16 +#868 @ 205,454: 25x13 +#869 @ 253,602: 27x21 +#870 @ 441,837: 28x11 +#871 @ 784,893: 10x17 +#872 @ 952,589: 19x24 +#873 @ 475,750: 15x29 +#874 @ 494,470: 18x17 +#875 @ 692,740: 22x12 +#876 @ 755,209: 12x28 +#877 @ 2,789: 15x17 +#878 @ 284,146: 17x10 +#879 @ 123,973: 22x23 +#880 @ 302,166: 25x28 +#881 @ 134,98: 17x14 +#882 @ 532,743: 4x22 +#883 @ 775,147: 15x10 +#884 @ 24,784: 24x27 +#885 @ 904,463: 20x28 +#886 @ 840,899: 13x12 +#887 @ 634,799: 11x17 +#888 @ 913,605: 19x19 +#889 @ 757,692: 21x22 +#890 @ 205,12: 21x11 +#891 @ 810,115: 24x23 +#892 @ 678,744: 11x12 +#893 @ 291,956: 28x26 +#894 @ 552,561: 17x20 +#895 @ 131,14: 24x16 +#896 @ 332,912: 18x16 +#897 @ 232,656: 17x18 +#898 @ 79,59: 10x13 +#899 @ 509,433: 14x12 +#900 @ 828,668: 25x26 +#901 @ 255,225: 20x10 +#902 @ 760,51: 29x19 +#903 @ 505,658: 28x10 +#904 @ 669,85: 18x22 +#905 @ 964,831: 14x15 +#906 @ 42,648: 18x12 +#907 @ 262,612: 12x13 +#908 @ 229,976: 26x11 +#909 @ 924,769: 25x16 +#910 @ 13,458: 26x26 +#911 @ 376,30: 22x25 +#912 @ 105,900: 21x26 +#913 @ 789,345: 21x11 +#914 @ 575,388: 11x25 +#915 @ 271,374: 16x27 +#916 @ 47,115: 12x13 +#917 @ 482,421: 11x20 +#918 @ 920,289: 5x12 +#919 @ 65,247: 28x23 +#920 @ 509,96: 11x16 +#921 @ 714,824: 10x26 +#922 @ 690,454: 13x24 +#923 @ 399,303: 10x25 +#924 @ 955,892: 12x20 +#925 @ 315,678: 12x26 +#926 @ 0,892: 23x23 +#927 @ 417,503: 29x15 +#928 @ 127,954: 29x17 +#929 @ 237,143: 10x20 +#930 @ 283,369: 13x22 +#931 @ 208,375: 29x18 +#932 @ 420,980: 25x11 +#933 @ 605,745: 13x12 +#934 @ 264,395: 23x26 +#935 @ 785,92: 24x16 +#936 @ 35,144: 25x25 +#937 @ 726,185: 22x15 +#938 @ 438,868: 23x20 +#939 @ 545,559: 13x11 +#940 @ 909,645: 26x17 +#941 @ 810,613: 25x24 +#942 @ 879,222: 28x21 +#943 @ 716,555: 14x18 +#944 @ 315,906: 25x13 +#945 @ 869,653: 16x24 +#946 @ 947,65: 16x24 +#947 @ 65,923: 27x17 +#948 @ 25,590: 19x16 +#949 @ 304,15: 14x10 +#950 @ 791,949: 17x23 +#951 @ 406,313: 16x10 +#952 @ 61,296: 15x11 +#953 @ 571,580: 14x25 +#954 @ 206,575: 26x27 +#955 @ 328,86: 14x29 +#956 @ 97,538: 29x24 +#957 @ 580,906: 20x13 +#958 @ 606,661: 13x17 +#959 @ 740,693: 18x22 +#960 @ 958,745: 17x27 +#961 @ 803,850: 23x27 +#962 @ 409,815: 15x22 +#963 @ 849,115: 21x28 +#964 @ 26,641: 23x29 +#965 @ 706,73: 26x28 +#966 @ 5,876: 23x25 +#967 @ 539,556: 13x17 +#968 @ 293,524: 19x19 +#969 @ 431,810: 11x22 +#970 @ 619,324: 11x22 +#971 @ 440,129: 25x26 +#972 @ 745,800: 29x22 +#973 @ 963,442: 23x12 +#974 @ 726,890: 25x25 +#975 @ 120,617: 12x25 +#976 @ 677,879: 26x13 +#977 @ 274,671: 16x27 +#978 @ 685,969: 10x13 +#979 @ 379,333: 10x16 +#980 @ 374,439: 23x26 +#981 @ 454,826: 13x26 +#982 @ 751,166: 16x11 +#983 @ 517,647: 27x28 +#984 @ 282,296: 24x22 +#985 @ 378,937: 11x25 +#986 @ 94,181: 22x17 +#987 @ 897,824: 14x19 +#988 @ 833,119: 25x12 +#989 @ 942,637: 22x12 +#990 @ 690,305: 17x29 +#991 @ 130,244: 14x12 +#992 @ 968,94: 18x12 +#993 @ 630,423: 15x19 +#994 @ 569,325: 24x11 +#995 @ 128,247: 20x24 +#996 @ 35,873: 26x21 +#997 @ 834,628: 22x20 +#998 @ 461,280: 29x15 +#999 @ 838,614: 27x28 +#1000 @ 222,280: 10x19 +#1001 @ 95,332: 28x15 +#1002 @ 239,968: 11x19 +#1003 @ 567,839: 24x29 +#1004 @ 610,500: 13x17 +#1005 @ 482,745: 16x14 +#1006 @ 276,315: 25x19 +#1007 @ 365,628: 16x26 +#1008 @ 456,233: 26x12 +#1009 @ 690,880: 13x20 +#1010 @ 510,638: 24x18 +#1011 @ 950,304: 10x20 +#1012 @ 224,255: 24x13 +#1013 @ 122,231: 13x25 +#1014 @ 542,617: 16x21 +#1015 @ 856,732: 16x21 +#1016 @ 7,619: 24x23 +#1017 @ 803,801: 26x22 +#1018 @ 219,887: 12x24 +#1019 @ 409,123: 12x18 +#1020 @ 20,872: 22x24 +#1021 @ 589,675: 12x26 +#1022 @ 270,262: 29x24 +#1023 @ 776,582: 23x21 +#1024 @ 843,224: 24x17 +#1025 @ 661,141: 23x10 +#1026 @ 130,738: 16x27 +#1027 @ 515,291: 18x28 +#1028 @ 917,554: 18x16 +#1029 @ 435,237: 19x26 +#1030 @ 144,138: 16x15 +#1031 @ 568,267: 27x12 +#1032 @ 658,629: 15x20 +#1033 @ 644,485: 16x10 +#1034 @ 150,410: 21x14 +#1035 @ 336,578: 25x24 +#1036 @ 591,522: 22x25 +#1037 @ 334,918: 22x22 +#1038 @ 590,397: 24x18 +#1039 @ 530,740: 15x29 +#1040 @ 494,644: 28x21 +#1041 @ 740,580: 25x14 +#1042 @ 332,904: 12x11 +#1043 @ 359,693: 26x12 +#1044 @ 420,804: 12x23 +#1045 @ 140,259: 11x15 +#1046 @ 319,646: 12x19 +#1047 @ 820,412: 12x29 +#1048 @ 357,556: 12x21 +#1049 @ 402,750: 15x18 +#1050 @ 784,805: 21x14 +#1051 @ 910,54: 26x23 +#1052 @ 413,49: 25x21 +#1053 @ 482,440: 26x17 +#1054 @ 4,912: 19x28 +#1055 @ 767,807: 24x13 +#1056 @ 232,332: 16x24 +#1057 @ 730,626: 15x27 +#1058 @ 824,391: 21x26 +#1059 @ 880,965: 17x21 +#1060 @ 918,549: 10x19 +#1061 @ 127,385: 20x12 +#1062 @ 155,316: 14x10 +#1063 @ 837,895: 15x17 +#1064 @ 240,611: 24x26 +#1065 @ 890,193: 21x18 +#1066 @ 237,908: 18x29 +#1067 @ 71,743: 21x24 +#1068 @ 238,106: 11x16 +#1069 @ 568,806: 26x27 +#1070 @ 525,488: 15x19 +#1071 @ 779,59: 28x20 +#1072 @ 389,915: 13x25 +#1073 @ 656,786: 20x15 +#1074 @ 267,197: 21x16 +#1075 @ 890,363: 24x19 +#1076 @ 48,943: 23x25 +#1077 @ 949,713: 25x23 +#1078 @ 46,764: 10x18 +#1079 @ 905,174: 21x19 +#1080 @ 782,891: 29x23 +#1081 @ 701,647: 10x19 +#1082 @ 216,437: 15x24 +#1083 @ 6,734: 25x26 +#1084 @ 949,925: 28x10 +#1085 @ 307,510: 20x20 +#1086 @ 229,790: 13x24 +#1087 @ 513,434: 16x18 +#1088 @ 325,926: 19x22 +#1089 @ 180,149: 29x27 +#1090 @ 894,813: 17x28 +#1091 @ 287,653: 29x24 +#1092 @ 775,550: 9x4 +#1093 @ 827,478: 15x10 +#1094 @ 161,130: 23x19 +#1095 @ 714,364: 24x27 +#1096 @ 9,876: 25x16 +#1097 @ 901,552: 10x29 +#1098 @ 930,314: 22x27 +#1099 @ 220,907: 19x13 +#1100 @ 708,642: 25x15 +#1101 @ 183,811: 15x26 +#1102 @ 194,942: 17x21 +#1103 @ 779,516: 28x14 +#1104 @ 380,251: 10x27 +#1105 @ 302,981: 19x12 +#1106 @ 951,165: 14x20 +#1107 @ 569,590: 18x25 +#1108 @ 865,451: 27x20 +#1109 @ 777,856: 17x10 +#1110 @ 771,62: 28x29 +#1111 @ 3,54: 18x11 +#1112 @ 721,514: 14x15 +#1113 @ 703,869: 14x10 +#1114 @ 189,124: 21x26 +#1115 @ 633,171: 25x28 +#1116 @ 226,285: 13x25 +#1117 @ 475,38: 27x27 +#1118 @ 23,774: 23x13 +#1119 @ 276,731: 24x24 +#1120 @ 800,499: 29x26 +#1121 @ 655,672: 20x28 +#1122 @ 216,437: 28x27 +#1123 @ 376,874: 20x22 +#1124 @ 838,435: 24x11 +#1125 @ 323,237: 29x28 +#1126 @ 518,75: 16x13 +#1127 @ 309,376: 21x29 +#1128 @ 787,112: 11x28 +#1129 @ 577,836: 12x26 +#1130 @ 660,680: 17x25 +#1131 @ 418,252: 11x17 +#1132 @ 362,290: 10x26 +#1133 @ 34,626: 23x26 +#1134 @ 16,793: 26x10 +#1135 @ 752,623: 12x17 +#1136 @ 262,782: 18x29 +#1137 @ 358,343: 25x14 +#1138 @ 938,962: 26x16 +#1139 @ 919,361: 24x20 +#1140 @ 550,10: 12x22 +#1141 @ 51,387: 23x23 +#1142 @ 202,154: 15x15 +#1143 @ 136,661: 27x12 +#1144 @ 504,753: 23x12 +#1145 @ 104,494: 29x27 +#1146 @ 352,744: 23x15 +#1147 @ 236,113: 12x27 +#1148 @ 413,166: 16x21 +#1149 @ 967,933: 16x16 +#1150 @ 198,684: 20x27 +#1151 @ 507,268: 15x27 +#1152 @ 765,155: 14x29 +#1153 @ 954,813: 28x26 +#1154 @ 226,438: 10x19 +#1155 @ 822,738: 13x19 +#1156 @ 580,12: 10x17 +#1157 @ 400,346: 15x23 +#1158 @ 326,718: 24x17 +#1159 @ 646,581: 24x17 +#1160 @ 115,623: 27x24 +#1161 @ 899,282: 26x13 +#1162 @ 733,234: 17x14 +#1163 @ 800,832: 25x28 +#1164 @ 960,678: 29x13 +#1165 @ 148,256: 29x23 +#1166 @ 514,488: 24x18 +#1167 @ 30,720: 22x26 +#1168 @ 423,173: 20x20 +#1169 @ 121,742: 18x21 +#1170 @ 904,164: 18x14 +#1171 @ 55,263: 12x11 +#1172 @ 230,375: 11x28 +#1173 @ 701,867: 20x20 +#1174 @ 89,534: 29x18 +#1175 @ 105,182: 12x22 +#1176 @ 686,786: 28x25 +#1177 @ 330,90: 19x14 +#1178 @ 472,579: 25x27 +#1179 @ 811,546: 13x16 +#1180 @ 419,57: 21x19 +#1181 @ 926,445: 29x28 +#1182 @ 779,980: 16x18 +#1183 @ 556,516: 17x20 +#1184 @ 929,442: 15x27 +#1185 @ 117,537: 21x20 +#1186 @ 845,193: 14x14 +#1187 @ 366,423: 6x5 +#1188 @ 979,528: 12x21 +#1189 @ 283,499: 17x12 +#1190 @ 798,243: 28x11 +#1191 @ 37,636: 18x25 +#1192 @ 883,280: 29x22 +#1193 @ 311,159: 29x15 +#1194 @ 639,769: 11x28 +#1195 @ 467,294: 27x17 +#1196 @ 576,701: 27x29 +#1197 @ 104,971: 23x17 +#1198 @ 916,279: 13x29 +#1199 @ 298,190: 14x19 +#1200 @ 31,202: 11x23 +#1201 @ 764,881: 22x23 +#1202 @ 51,386: 11x12 +#1203 @ 291,612: 18x20 +#1204 @ 111,157: 26x22 +#1205 @ 355,48: 24x26 +#1206 @ 747,297: 10x16 +#1207 @ 593,53: 25x18 +#1208 @ 865,944: 25x29 +#1209 @ 184,112: 25x24 +#1210 @ 395,614: 27x10 +#1211 @ 566,562: 12x25 +#1212 @ 193,719: 22x23 +#1213 @ 428,255: 22x10 +#1214 @ 575,632: 10x10 +#1215 @ 868,206: 13x28 +#1216 @ 425,253: 17x14 +#1217 @ 87,191: 25x22 +#1218 @ 721,963: 26x24 +#1219 @ 726,138: 13x13 +#1220 @ 450,776: 21x25 +#1221 @ 103,481: 17x24 +#1222 @ 166,432: 28x22 +#1223 @ 969,386: 14x22 +#1224 @ 745,744: 15x26 +#1225 @ 75,36: 19x25 +#1226 @ 224,406: 13x26 +#1227 @ 308,635: 16x24 +#1228 @ 195,484: 28x19 +#1229 @ 614,297: 21x14 +#1230 @ 123,229: 17x23 +#1231 @ 684,709: 11x18 +#1232 @ 749,305: 11x17 +#1233 @ 864,937: 15x24 +#1234 @ 371,716: 28x10 +#1235 @ 726,620: 22x20 +#1236 @ 63,408: 22x28 +#1237 @ 849,284: 18x23 +#1238 @ 207,769: 13x25 +#1239 @ 596,300: 22x13 +#1240 @ 578,17: 10x13 +#1241 @ 892,265: 16x21 +#1242 @ 27,162: 29x12 +#1243 @ 710,177: 14x15 +#1244 @ 703,80: 29x16 +#1245 @ 817,718: 24x19 +#1246 @ 305,604: 11x10 +#1247 @ 60,47: 13x14 +#1248 @ 863,136: 20x26 +#1249 @ 836,304: 15x22 +#1250 @ 295,501: 14x12 +#1251 @ 41,887: 26x16 +#1252 @ 711,440: 13x11 +#1253 @ 878,827: 16x13 +#1254 @ 693,273: 29x16 +#1255 @ 878,143: 11x12 +#1256 @ 68,232: 14x17 +#1257 @ 195,223: 21x3 +#1258 @ 587,822: 12x29 +#1259 @ 445,131: 15x14 +#1260 @ 897,187: 11x19 +#1261 @ 711,6: 20x22 +#1262 @ 719,635: 21x19 +#1263 @ 316,631: 26x17 +#1264 @ 441,423: 20x18 +#1265 @ 185,613: 24x18 +#1266 @ 161,609: 10x14 +#1267 @ 695,909: 26x22 +#1268 @ 338,62: 18x24 +#1269 @ 186,679: 26x28 +#1270 @ 430,349: 24x19 +#1271 @ 504,92: 28x26 +#1272 @ 53,50: 12x20 +#1273 @ 253,307: 26x19 +#1274 @ 590,597: 23x15 +#1275 @ 12,43: 29x19 +#1276 @ 950,748: 18x15 +#1277 @ 836,7: 17x17 +#1278 @ 838,33: 23x17 +#1279 @ 797,603: 13x13 +#1280 @ 72,412: 29x15 +#1281 @ 754,206: 24x26 +#1282 @ 831,144: 26x16 +#1283 @ 832,633: 15x13 +#1284 @ 944,425: 11x21 +#1285 @ 610,710: 26x10 +#1286 @ 574,726: 11x19 +#1287 @ 959,667: 18x22 +#1288 @ 966,878: 28x19 +#1289 @ 340,927: 12x29 +#1290 @ 976,546: 10x16 +#1291 @ 265,310: 23x24 +#1292 @ 581,943: 22x16 +#1293 @ 696,530: 15x12 +#1294 @ 122,652: 15x28 +#1295 @ 494,63: 24x25 +#1296 @ 634,571: 15x28 +#1297 @ 859,776: 18x24 +#1298 @ 585,256: 12x19 +#1299 @ 506,617: 20x10 +#1300 @ 555,400: 11x25 +#1301 @ 595,391: 18x26 +#1302 @ 497,36: 24x10 +#1303 @ 771,974: 27x23 +#1304 @ 284,908: 26x14 +#1305 @ 186,814: 10x14 +#1306 @ 315,377: 14x13 +#1307 @ 789,81: 17x15 +#1308 @ 415,112: 14x28 +#1309 @ 837,845: 18x26 +#1310 @ 492,563: 17x12 +#1311 @ 830,285: 14x28 +#1312 @ 216,834: 13x29 +#1313 @ 616,792: 29x12 +#1314 @ 899,141: 22x16 +#1315 @ 787,475: 24x20 +#1316 @ 196,603: 17x10 +#1317 @ 538,2: 16x24 +#1318 @ 381,357: 17x22 +#1319 @ 941,817: 27x22 +#1320 @ 196,272: 25x13 +#1321 @ 690,135: 12x13 +#1322 @ 147,88: 13x16 +#1323 @ 948,267: 24x12 +#1324 @ 50,411: 14x11 +#1325 @ 102,968: 10x11 +#1326 @ 177,613: 25x24 +#1327 @ 450,229: 23x25 +#1328 @ 802,851: 12x15 +#1329 @ 463,149: 22x11 +#1330 @ 19,681: 20x25 +#1331 @ 784,709: 24x17 +#1332 @ 672,437: 21x14 +#1333 @ 168,145: 23x20 +#1334 @ 169,725: 25x27 +#1335 @ 71,731: 16x22 +#1336 @ 602,589: 25x16 +#1337 @ 281,888: 13x19 +#1338 @ 753,283: 13x28 +#1339 @ 367,421: 29x11 +#1340 @ 714,651: 21x23 +#1341 @ 166,985: 21x14 +#1342 @ 473,661: 16x23 +#1343 @ 888,512: 24x13 +#1344 @ 615,452: 11x19 +#1345 @ 337,160: 28x12 +#1346 @ 56,944: 13x19 +#1347 @ 323,497: 20x23 +#1348 @ 110,476: 27x20 +#1349 @ 227,77: 17x25 +#1350 @ 713,231: 12x20 +#1351 @ 90,946: 26x17 +#1352 @ 138,826: 18x25 +#1353 @ 179,105: 10x24 +#1354 @ 357,906: 23x25 +#1355 @ 334,871: 12x29 +#1356 @ 529,553: 18x14 +#1357 @ 908,495: 14x28 +#1358 @ 603,151: 25x10 +#1359 @ 390,669: 15x17 +#1360 @ 957,663: 29x23 +#1361 @ 274,390: 28x27 +#1362 @ 393,234: 24x25 +#1363 @ 952,164: 19x11 +#1364 @ 239,515: 17x19 +#1365 @ 15,733: 11x15 +#1366 @ 891,347: 26x11 +#1367 @ 889,282: 15x17 +#1368 @ 959,527: 17x21 +#1369 @ 815,368: 23x10 +#1370 @ 437,363: 16x17 +#1371 @ 686,646: 24x21 +#1372 @ 782,103: 29x17 +#1373 @ 664,598: 23x15 +#1374 @ 322,898: 22x27 +#1375 @ 825,322: 18x29 +#1376 @ 767,835: 19x28 +#1377 @ 230,874: 17x27 +#1378 @ 899,895: 16x16 +#1379 @ 443,44: 21x17 +#1380 @ 233,812: 19x11 +#1381 @ 866,816: 25x17 +#1382 @ 912,422: 21x23 +#1383 @ 720,683: 25x19 +#1384 @ 64,36: 23x24 +#1385 @ 735,608: 22x17 +#1386 @ 760,38: 25x17 +#1387 @ 188,804: 12x20 +#1388 @ 362,926: 16x14 +#1389 @ 230,86: 8x11 +#1390 @ 143,852: 24x23 +#1391 @ 558,583: 14x29 +#1392 @ 399,979: 24x19 +#1393 @ 119,134: 26x10 +#1394 @ 959,477: 23x26 +#1395 @ 173,807: 29x20 +#1396 @ 138,138: 18x29 +#1397 @ 42,201: 14x18 +#1398 @ 588,70: 12x20 +#1399 @ 575,56: 21x21 +#1400 @ 505,321: 27x22 +#1401 @ 432,243: 19x17 diff --git a/inputs/3_test.txt b/inputs/3_test.txt new file mode 100644 index 0000000..3755d52 --- /dev/null +++ b/inputs/3_test.txt @@ -0,0 +1,3 @@ +#1 @ 1,3: 4x4 +#2 @ 3,1: 4x4 +#3 @ 5,5: 2x2 diff --git a/inputs/3_test_malformed.txt b/inputs/3_test_malformed.txt new file mode 100644 index 0000000..117b1d6 --- /dev/null +++ b/inputs/3_test_malformed.txt @@ -0,0 +1,3 @@ +#1 @ 1,3: 4x4 +#2 @ 3,1: 4x4 +#3 @ 5,5: 2x2 diff --git a/src/day3.rs b/src/day3.rs new file mode 100644 index 0000000..0d2f26e --- /dev/null +++ b/src/day3.rs @@ -0,0 +1,164 @@ +extern crate regex; + +use std::error::Error; +use std::fs::File; +use std::io::{BufRead, BufReader}; +use std::fmt; +use std::collections::HashMap; + +use regex::{Regex, Captures}; + +const INPUT: &str = "inputs/3.txt"; + +#[derive(Debug, PartialEq)] +struct Claim { + id: u32, + left: u32, + top: u32, + width: u32, + height: u32, +} + +#[derive(Debug, PartialEq, Eq, Hash)] +struct Point { + x: u32, + y: u32, +} + +#[derive(Debug, Clone, PartialEq)] +struct MalformedClaim { + details: String +} + +impl MalformedClaim { + fn new(msg: &str) -> MalformedClaim { + MalformedClaim{ details: msg.to_string() } + } +} + +impl fmt::Display for MalformedClaim { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, "{}", self.details) + } +} + +impl Error for MalformedClaim { + fn description(&self) -> &str { + &self.details + } +} + +pub fn solve_part1() -> Result> { + Ok(count_overlapping_claimed_points(read_claims(INPUT)?)) +} + +fn count_overlapping_claimed_points(claims: Vec) -> u32 { + let mut claimed_points: HashMap = HashMap::new(); + for claim in claims { + for point in list_points_in_claim(claim) { + let current_point = claimed_points.get(&point).unwrap_or(&0); + claimed_points.insert(point, current_point + 1); + } + } + return claimed_points.values().fold(0, |acc, claims| { + if claims > &1 { + return acc + 1 + } + acc + }) +} + +fn list_points_in_claim(claim: Claim) -> Vec { + let mut points = Vec::new(); + for x in 0..claim.width { + for y in 0..claim.height { + points.push(Point { x: claim.left + x, y: claim.top + y }); + } + } + points +} + +fn read_claims(filename: &str) -> Result, Box> { + let mut claims: Vec = Vec::new(); + let claim_regex = + Regex::new(r"#(?P\d+) @ (?P\d+),(?P\d+): (?P\d+)x(?P\d+)")?; + let file = File::open(filename)?; + for line in BufReader::new(file).lines() { + match claim_regex.captures(&line?) { + Some(captures) => { + let claim = Claim { + id: get_captured_field(&captures, "id")?, + left: get_captured_field(&captures, "left")?, + top: get_captured_field(&captures, "top")?, + width: get_captured_field(&captures, "width")?, + height: get_captured_field(&captures, "height")?, + }; + claims.push(claim); + }, + None => return Err(Box::new(MalformedClaim { + details: "Malformed claim line, no fields could be found".to_string() + })), + }; + } + Ok(claims) +} + +fn get_captured_field(captures: &Captures, field: &str) -> Result> { + match captures.name(field) { + Some(capture) => Ok(capture.as_str().parse()?), + None => return Err(Box::new(MalformedClaim { + details: format!("Malformed claim line, field {} could not be found", field) + })) + } +} + + +#[cfg(test)] +mod tests { + use super::*; + + const TEST_INPUT: &str = "inputs/3_test.txt"; + const TEST_INPUT_MALFORMED: &str = "inputs/3_test_malformed.txt"; + + #[test] + fn reads_claims_file() { + assert_eq!(read_claims(TEST_INPUT).unwrap(), vec![ + Claim { id: 1, left: 1, top: 3, width: 4, height: 4 }, + Claim { id: 2, left: 3, top: 1, width: 4, height: 4 }, + Claim { id: 3, left: 5, top: 5, width: 2, height: 2 }, + ]); + } + + #[test] + fn errors_on_malformed_claims_file() { + match read_claims(TEST_INPUT_MALFORMED) { + Ok(_) => assert!(false, "read_claims should have returned an error"), + Err(err) => assert_eq!( + (*err).description(), + "Malformed claim line, no fields could be found".to_string(), + ), + } + } + + #[test] + fn lists_points_in_claim() { + assert_eq!(list_points_in_claim(Claim { id: 1, left: 0, top: 0, width: 2, height: 2 }), + vec![ + Point { x: 0, y: 0 }, + Point { x: 0, y: 1 }, + Point { x: 1, y: 0 }, + Point { x: 1, y: 1 }, + ] + ) + } + + #[test] + fn counts_overlapping_claimed_points() { + let test_claims = vec![ + Claim { id: 1, left: 1, top: 3, width: 4, height: 4 }, + Claim { id: 2, left: 3, top: 1, width: 4, height: 4 }, + Claim { id: 3, left: 5, top: 5, width: 2, height: 2 }, + ]; + assert_eq!(count_overlapping_claimed_points(test_claims), 4); + } +} diff --git a/src/main.rs b/src/main.rs index a807a0f..6aaab14 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,5 +1,6 @@ mod day1; mod day2; +mod day3; fn main() { println!("Day 1:"); @@ -8,4 +9,6 @@ fn main() { println!("Day 2:"); println!("{}", day2::solve_part1().unwrap()); println!("{}", day2::solve_part2().unwrap().unwrap()); + println!("Day 3:"); + println!("{}", day3::solve_part1().unwrap()); }