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RvzjCMFGu5/NIOJJO/jqhABiwbGngEfLEQ3ZQneMl
+WaBa3Ve46Tq4ZFWpkGJCMN0WoDeuyESJklilpSDgdQj5kxr5fs/ywT3mKsSwobqk
+RIgpL6xzv1XpL8UXwR5aJcVb1onAZcZv97qIYXPZb5b608DGgxkocugYS06LNxPT
+HGQXR6/W68yD7HbY8B9/dlqdL3+KL1kuBEGaZ44F9+ELvi/vlPoeRLJ296gdZYJf
+I/zNGxA9avWGmvPzM3XYAMkIjWIKCAG8G7drlVhLt6O7CWSMxr7GtFk2Ja1ysLLy
+2c5hnWwJqyU+tA3Xoz4/fq25YlNv0zNjGogvm8uhNFP3nPxmJ+tQaUDSS+0ydV31
+4b3z047K+v2ajsp0aoG2Huzrb1MlXZzlMj2rUub3z0xpz13T4TunyxUS8NQB1LU8
+a2qNQVQheMbFYtLP/VQK
+=MEXU
-----END PGP SIGNATURE-----
```
10190 advent-of-code-22.html cb57ad829bd31e59807f3f0ecc95c603eb85b2d9f9e5cbf9432e80283b689298
6910 advent-of-code-23.html fff58431db66635a7dc9b537f3d0d87a10ac9b20acd6fcb9cf5f8c99e6f40f39
8408 advent-of-code-24.html 05fd8b977adf711d5911768855e79f875eb767e47dfc0656882fb49d2b3d8960
+8442 advent-of-code-25.html 4e4155c4f58985e9bb31034a0c75ab4deb68fbb2364669e535ddda7b8dc97534
109395 advent-of-code.ipynb 7292eeb9a8019f6931037c70105ab96bf691074dbe963736b6429cb4d4373f51
25607 advent01.ipynb c33ad39a77803a6870dd74998da98e3bb9c2c2db37c34167b330a01d663717e7
7001 advent01.txt 79312922877bdedd09ce0886a42b3d7f7ed092e2218579fb7d6ac1cb38cedebe
298 advent23.txt 780557c20cbab27946114d4cf04359045dd76b6bfdb28b5bde2e1ceb2c520173
78473 advent24.ipynb 3c6e8498ce5b987ee45708979dbcfb77a255d6064a150e9a8650ed903c67f324
86 advent24.txt 341dd3c96143cb589467239c9a9812c6f62406c33a359247049613641b890ff6
+4396 advent25.ipynb 5fcb7ff9bfe200971216d337a72a173219f3762bfec2e7c2469159b66a962217
+99 advent25.txt 2da41ec837841ce65a6dafc74bffe9f914217d74c0e64fcdf12e3f01049557d7
```
#### Ignore
--- /dev/null
+<!DOCTYPE html>
+<html lang="en-us">
+<head>
+<meta charset="utf-8"/>
+<title>Day 25 - Advent of Code</title>
+<!--[if lt IE 9]><script src="/static/html5.js"></script><![endif]-->
+<link href='//fonts.googleapis.com/css?family=Source+Code+Pro:300&subset=latin,latin-ext' rel='stylesheet' type='text/css'>
+<link rel="stylesheet" type="text/css" href="/static/style.css?3"/>
+<link rel="shortcut icon" href="/favicon.ico?2"/>
+</head><!--
+
+
+
+
+Oh, hello! Funny seeing you here.
+
+I appreciate your enthusiasm, but you aren't going to find much down here.
+There certainly aren't clues to any of the puzzles. You do risk spoiling a few
+surprises for yourself, though. Best to play the normal way and discover
+everything as it was intended, I think. The best surprises don't even appear
+in the source until you unlock them for real.
+
+Please be careful with automated requests; I'm not Google, and I can only take
+so much traffic. Please be considerate so that everyone gets to play.
+
+If you're curious about how Advent of Code works, it's running on some custom
+Perl code. Other than a few integrations (auth, analytics, ads, social media),
+I built the whole thing myself, including the design, animations, prose, and
+all of the puzzles.
+
+The puzzles probably took the longest; the easiest ones were around 45 minutes
+each, but the harder ones took 2-3 hours, some even longer than that. A lot of
+effort went into building this thing - I hope you're enjoying playing it as
+much as I enjoyed making it for you!
+
+If you'd like to hang out, I'm @ericwastl on Twitter.
+
+- Eric Wastl
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+-->
+<body>
+<header><h1><a href="/">Advent of Code</a></h1><div class="user">Neil Smith <span class="star-count">50*</span></div><nav><ul><li><a href="/about">[About]</a></li><li><a href="/stats">[Stats]</a></li><li><a href="/leaderboard">[Leaderboard]</a></li><li><a href="/settings">[Settings]</a></li><li><a href="/auth/logout">[Log out]</a></li></ul></nav></header>
+
+<div id="ad">
+<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
+<!-- Advent of Code Wide Skyscraper -->
+<ins class="adsbygoogle"
+ style="display:inline-block;width:160px;height:600px"
+ data-ad-client="ca-pub-9420604735624631"
+ data-ad-slot="8014013294"></ins>
+<script>
+(adsbygoogle = window.adsbygoogle || []).push({});
+</script>
+</div><!--/ad-->
+
+<main>
+<style>article *[title]{border-bottom:1px dotted #ffff66;</style><article class="day-desc"><h2>--- Day 25: Let It Snow ---</h2><p>Merry Christmas! Santa is booting up his weather machine; looks like you might get a <a href="/day/1">white Christmas</a> after all.</p>
+<p>The weather machine beeps! On the console of the machine is a copy protection message asking you to <a href="https://en.wikipedia.org/wiki/Copy_protection#Early_video_games">enter a code from the instruction manual</a>. Apparently, it refuses to run unless you give it that code. No problem; you'll just look up the code in the--</p>
+<p>"Ho ho ho", Santa ponders aloud. "I can't seem to find the manual."</p>
+<p>You look up the support number for the manufacturer and give them a call. Good thing, too - that 49th star wasn't going to earn itself.</p>
+<p>"Oh, that machine is quite old!", they tell you. "That model went out of support six minutes ago, and we just finished shredding all of the manuals. I bet we can find you the code generation algorithm, though."</p>
+<p>After putting you on hold for twenty minutes (your call is <em>very</em> important to them, it reminded you repeatedly), they finally find an engineer that remembers how the code system works.</p>
+<p>The codes are printed on an <span title="The paper is very thin so it can be folded up neatly into the manual.">infinite sheet of paper</span>, starting in the top-left corner. The codes are filled in by diagonals: starting with the first row with an empty first box, the codes are filled in diagonally up and to the right. This process repeats until the <a href="https://en.wikipedia.org/wiki/Cantor's_diagonal_argument">infinite paper is covered</a>. So, the first few codes are filled in in this order:</p>
+<pre><code> | 1 2 3 4 5 6
+---+---+---+---+---+---+---+
+ 1 | 1 3 6 10 15 21
+ 2 | 2 5 9 14 20
+ 3 | 4 8 13 19
+ 4 | 7 12 18
+ 5 | 11 17
+ 6 | 16
+</code></pre>
+<p>For example, the 12th code would be written to row <code>4</code>, column <code>2</code>; the 15th code would be written to row <code>1</code>, column <code>5</code>.</p>
+<p>The voice on the other end of the phone continues with how the codes are actually generated. The first code is <code>20151125</code>. After that, each code is generated by taking the previous one, multiplying it by <code>252533</code>, and then keeping the remainder from dividing that value by <code>33554393</code>.</p>
+<p>So, to find the second code (which ends up in row <code>2</code>, column <code>1</code>), start with the previous value, <code>20151125</code>. Multiply it by <code>252533</code> to get <code>5088824049625</code>. Then, divide that by <code>33554393</code>, which leaves a remainder of <code>31916031</code>. That remainder is the second code.</p>
+<p>"Oh!", says the voice. "It looks like we missed a scrap from one of the manuals. Let me read it to you." You write down his numbers:</p>
+<pre><code> | 1 2 3 4 5 6
+---+---------+---------+---------+---------+---------+---------+
+ 1 | 20151125 18749137 17289845 30943339 10071777 33511524
+ 2 | 31916031 21629792 16929656 7726640 15514188 4041754
+ 3 | 16080970 8057251 1601130 7981243 11661866 16474243
+ 4 | 24592653 32451966 21345942 9380097 10600672 31527494
+ 5 | 77061 17552253 28094349 6899651 9250759 31663883
+ 6 | 33071741 6796745 25397450 24659492 1534922 27995004
+</code></pre>
+<p>"Now remember", the voice continues, "that's not even all of the first few numbers; for example, you're missing the one at 7,1 that would come before 6,2. But, it should be enough to let your-- oh, it's time for lunch! Bye!" The call disconnects.</p>
+<p>Santa looks nervous. Your puzzle input contains the message on the machine's console. <em>What code do you give the machine?</em></p>
+</article>
+<p>Your puzzle answer was <code>9132360</code>.</p><article class="day-desc"><h2>--- Part Two ---</h2><p>The machine springs to life, then falls silent again. It beeps. "Insufficient fuel", the console reads. "<em class="star">Fifty stars</em> are required before proceeding. <em class="star">One star</em> is available."</p>
+<p>..."one star is available"? You check the fuel tank; sure enough, a lone star sits at the bottom, awaiting its friends. Looks like you need to provide 49 yourself.</p>
+</article>
+<form method="post" action="/day/25/answer"><input type="hidden" name="level" value="2"/><input type="hidden" name="answer" value="0"/><p>
+If you like, you can <input type="submit" value="[Turn it off and on again]"/>.
+</p></form>
+<p class="day-success">Both parts of this puzzle are complete! They provide two gold stars: **</p>
+<p>At this point, all that is left is for you to <a href="/">admire your advent calendar</a>.</p>
+<p>If you still want to see it, you can <a href="/day/25/input" target="_blank">get your puzzle input</a>.</p>
+<p>You can also <span class="share">[Share<span class="share-content">on
+ <a href="https://twitter.com/intent/tweet?text=I%27ve+completed+%22Let+It+Snow%22+%2D+Day+25+%2D+Advent+of+Code&url=http%3A%2F%2Fadventofcode%2Ecom%2Fday%2F25&related=ericwastl&hashtags=AdventOfCode" target="_blank">Twitter</a>
+ <a href="https://plus.google.com/share?url=http%3A%2F%2Fadventofcode%2Ecom%2Fday%2F25" target="_blank">Google+</a>
+ <a href="http://www.reddit.com/submit?url=http%3A%2F%2Fadventofcode%2Ecom%2Fday%2F25&title=I%27ve+completed+%22Let+It+Snow%22+%2D+Day+25+%2D+Advent+of+Code" target="_blank">Reddit</a
+></span>]</span>
+ this puzzle.</p>
+</main>
+
+<!-- ga -->
+<script>
+(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
+(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
+m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
+})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
+ga('create', 'UA-69522494-1', 'auto');
+ga('send', 'pageview');
+</script>
+<!-- /ga -->
+</body>
+</html>
--- /dev/null
+{
+ "cells": [
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+ "source": [
+ "import itertools"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+ "source": [
+ "def coordinates():\n",
+ " row = 1\n",
+ " col = 1\n",
+ " while True:\n",
+ " yield row, col\n",
+ " if row == 1:\n",
+ " row = col + 1\n",
+ " col = 1\n",
+ " else:\n",
+ " row -= 1\n",
+ " col += 1"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "[(1, 1),\n",
+ " (2, 1),\n",
+ " (1, 2),\n",
+ " (3, 1),\n",
+ " (2, 2),\n",
+ " (1, 3),\n",
+ " (4, 1),\n",
+ " (3, 2),\n",
+ " (2, 3),\n",
+ " (1, 4),\n",
+ " (5, 1),\n",
+ " (4, 2),\n",
+ " (3, 3),\n",
+ " (2, 4),\n",
+ " (1, 5),\n",
+ " (6, 1),\n",
+ " (5, 2),\n",
+ " (4, 3),\n",
+ " (3, 4),\n",
+ " (2, 5)]"
+ ]
+ },
+ "execution_count": 3,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "list(itertools.islice(coordinates(), 20))"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+ "source": [
+ "def code():\n",
+ " c = 20151125\n",
+ " while True:\n",
+ " yield c\n",
+ " c = (c * 252533) % 33554393"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "{(1, 1): 20151125,\n",
+ " (1, 2): 18749137,\n",
+ " (1, 3): 17289845,\n",
+ " (1, 4): 30943339,\n",
+ " (1, 5): 10071777,\n",
+ " (2, 1): 31916031,\n",
+ " (2, 2): 21629792,\n",
+ " (2, 3): 16929656,\n",
+ " (2, 4): 7726640,\n",
+ " (2, 5): 15514188,\n",
+ " (3, 1): 16080970,\n",
+ " (3, 2): 8057251,\n",
+ " (3, 3): 1601130,\n",
+ " (3, 4): 7981243,\n",
+ " (4, 1): 24592653,\n",
+ " (4, 2): 32451966,\n",
+ " (4, 3): 21345942,\n",
+ " (5, 1): 77061,\n",
+ " (5, 2): 17552253,\n",
+ " (6, 1): 33071741}"
+ ]
+ },
+ "execution_count": 7,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "{k: v for k, v in zip(itertools.islice(coordinates(), 20), code())}"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 11,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "[(4, 4)]"
+ ]
+ },
+ "execution_count": 11,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "list(itertools.islice(itertools.dropwhile(lambda c: not (c[0] == 4 and c[1] == 4), coordinates()), 1))"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 17,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "{(2981, 3075): 9132360}"
+ ]
+ },
+ "execution_count": 17,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "# To continue, please consult the code grid in the manual. Enter the code at row 2981, column 3075.\n",
+ "target_row = 2981\n",
+ "target_col = 3075\n",
+ "{k: v for k, v in itertools.islice(itertools.dropwhile(lambda c: not (c[0][0] == target_row and c[0][1] == target_col), \n",
+ " zip(coordinates(), code())),\n",
+ " 1)}"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+ "source": []
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 3",
+ "language": "python",
+ "name": "python3"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 3
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython3",
+ "version": "3.4.3"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}