From 5d636a6a977e1667611a2d4874e08212ec3b1af6 Mon Sep 17 00:00:00 2001 From: Neil Smith Date: Thu, 24 Dec 2015 11:55:48 +0000 Subject: [PATCH] Day 24 --- SIGNED.md | 29 +- advent-of-code-24.html | 167 ++++ advent24.ipynb | 1842 ++++++++++++++++++++++++++++++++++++++++ advent24.txt | 29 + 4 files changed, 2054 insertions(+), 13 deletions(-) create mode 100644 advent-of-code-24.html create mode 100644 advent24.ipynb create mode 100644 advent24.txt diff --git a/SIGNED.md b/SIGNED.md index 5b357c8..5aea4d3 100644 --- a/SIGNED.md +++ b/SIGNED.md @@ -3,19 +3,19 @@ -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 -iQIcBAABCAAGBQJWem9kAAoJEJPB2e07PgbqXbEP/i+Et9fESLyxCAVENqKQ33kc -Jy4uadsQxVzW2LJJeSwvRDVmnxldBuTC+bS72SusNGDP7OcEs75JeKmo1E6xSmJJ -idh0u1d2hKsSlqn1WssrIipW8QjzRE/xPCNI5i0Pso3JMFDx7z1/yfGWDq9BcKk9 -4lG4utqsxe5O8OIkBcb4Fxy+nhsqUQb3WGdt+y0ODGZAqaELsSX0lkNOUhz35foR -/ZNwvay6YHW3hk/+GO+4Bs5oqy1YDL5rDDtv6ov55dGIL/Vfel0bOcFldrcvH6KD -oxX71Vd+3ic8GkMllYNZQIn9wYkNEF6ygFQ7UOBC3t75xS7XtaTJIRjqoaXOTD4c -Fj1pt0nRaMac3TPT+7DG6o4TKmQqGHEpos3m6ubE9mWVldVHUKj3kBZ+P1qv4j4j -GSCg3BKNbyU4umNtrmAWoijAX9nB6djwPg5DOy+WR01JlhhVpwUiuqmahunnYNqc -/MljQi/aE3D4vrb+nrViw1JItuHrcjjSritVkttsukNxZ23z1L8rQ4DCmBjav1H6 -tKKSgxQcTncCGRZlAB5e0KIa2dkUvn0Itt3BBGV+ASWULYRaK9Kn3edt627pbZbo -AqVytWEI+yEHP20w9Gx8DRILu0ceXLI8yq2/6PkjNgk4/FTmVSRVIeH6zecKRlq2 -GLqISlGsKEU+5IwHAUjK -=AHmD +iQIcBAABCAAGBQJWe91LAAoJEJPB2e07PgbqODAQAJ/H9uBDWYgfUkGdnL2i4hqg +tUCjNZAsw+VaHN4RFr0x9CGTmI2lf7MRrEy+/FwLamJIx3LVmrWrEG5xouzkIO7p +0Dq1M3xZgJBEzh+PW2J+X3HllLMTe/y9QnzrJFGff9/xzlGRxZ7DKwyvzHhAMl5u +00AJoWAwQkxlvKOXZiES6ROocXLx1GonrG5j76SC6B2tf4NQVlvymR8ivID4dIms +R3khvYShuO24naJaKyjdnR4aTJCfE1zEJ+uPJNsf4GIf1RGRlyU9b+vSmcsblJnO +vmpY5X76KhiYsV9FOfMkUq19q6kooEmswNIiUcXhzWm+BRMgtCfWk/8U64Dxfixc +CS8QSaOGuJAxQl4VPZU9Z5t8piQDbnQlGxiJ+8t+PgRqDWS9A03UlITKMum8njyw +dsq9z/eNFQ8+kSVb9PegnhT6bwCCSxQFOZp65aWekXPe1nwCydvyvyV38/4eyHwq +a8z/DJsco5AFJT+pDn3Qe4WH/jspI23gx25BtNysM2l9Np0x/WK+ALC/n/AFRq6A +c7XE2Oo8+OSU8g4TH5cbmVYxg11dsS5UlERtxMA6R01riYKIHxIcnyPzxXUlyuhw +GN7k/GeR3OHpNhauD4HOfinSE+UJ9qVhwUTDtLlMs0f+fnA+T5ey+EI/dDr3BM1L +a9ETHzNPBsZfcFqmAm8D +=0oJU -----END PGP SIGNATURE----- ``` @@ -57,6 +57,7 @@ size exec file contents 7780 advent-of-code-21.html 877675e47121bd4812ab461fd7cd6124c397669a5e6f35c3f19b023728976970 10190 advent-of-code-22.html cb57ad829bd31e59807f3f0ecc95c603eb85b2d9f9e5cbf9432e80283b689298 6910 advent-of-code-23.html fff58431db66635a7dc9b537f3d0d87a10ac9b20acd6fcb9cf5f8c99e6f40f39 +8408 advent-of-code-24.html 05fd8b977adf711d5911768855e79f875eb767e47dfc0656882fb49d2b3d8960 109395 advent-of-code.ipynb 7292eeb9a8019f6931037c70105ab96bf691074dbe963736b6429cb4d4373f51 25607 advent01.ipynb c33ad39a77803a6870dd74998da98e3bb9c2c2db37c34167b330a01d663717e7 7001 advent01.txt 79312922877bdedd09ce0886a42b3d7f7ed092e2218579fb7d6ac1cb38cedebe @@ -100,6 +101,8 @@ size exec file contents 25431 advent22.ipynb 7eb725b13c6fc2bdadb19307330615761c297ec7bb3433cd9e3dd1da41dc940e 4882 advent23.ipynb fc19cc164aa4d5ddd0a8cbe930f09bd893612dae5b1a3b73b4579db9e2d41fe0 298 advent23.txt 780557c20cbab27946114d4cf04359045dd76b6bfdb28b5bde2e1ceb2c520173 +78473 advent24.ipynb 3c6e8498ce5b987ee45708979dbcfb77a255d6064a150e9a8650ed903c67f324 +86 advent24.txt 341dd3c96143cb589467239c9a9812c6f62406c33a359247049613641b890ff6 ``` #### Ignore diff --git a/advent-of-code-24.html b/advent-of-code-24.html new file mode 100644 index 0000000..cfd27a4 --- /dev/null +++ b/advent-of-code-24.html @@ -0,0 +1,167 @@ + + + + +Day 24 - Advent of Code + + + + + + +

Advent of Code

Neil Smith 48*
+ + + +
+

--- Day 24: It Hangs in the Balance ---

It's Christmas Eve, and Santa is loading up the sleigh for this year's deliveries. However, there's one small problem: he can't get the sleigh to balance. If it isn't balanced, he can't defy physics, and nobody gets presents this year.

+

No pressure.

+

Santa has provided you a list of the weights of every package he needs to fit on the sleigh. The packages need to be split into three groups of exactly the same weight, and every package has to fit. The first group goes in the passenger compartment of the sleigh, and the second and third go in containers on either side. Only when all three groups weigh exactly the same amount will the sleigh be able to fly. Defying physics has rules, you know!

+

Of course, that's not the only problem. The first group - the one going in the passenger compartment - needs as few packages as possible so that Santa has some legroom left over. It doesn't matter how many packages are in either of the other two groups, so long as all of the groups weigh the same.

+

Furthermore, Santa tells you, if there are multiple ways to arrange the packages such that the fewest possible are in the first group, you need to choose the way where the first group has the smallest quantum entanglement to reduce the chance of any "complications". The quantum entanglement of a group of packages is the product of their weights, that is, the value you get when you multiply their weights together. Only consider quantum entanglement if the first group has the fewest possible number of packages in it and all groups weigh the same amount.

+

For example, suppose you have ten packages with weights 1 through 5 and 7 through 11. For this situation, the unique first groups, their quantum entanglements, and a way to divide the remaining packages are as follows:

+
Group 1;             Group 2; Group 3
+11 9       (QE= 99); 10 8 2;  7 5 4 3 1
+10 9 1     (QE= 90); 11 7 2;  8 5 4 3
+10 8 2     (QE=160); 11 9;    7 5 4 3 1
+10 7 3     (QE=210); 11 9;    8 5 4 2 1
+10 5 4 1   (QE=200); 11 9;    8 7 3 2
+10 5 3 2   (QE=300); 11 9;    8 7 4 1
+10 4 3 2 1 (QE=240); 11 9;    8 7 5
+9 8 3      (QE=216); 11 7 2;  10 5 4 1
+9 7 4      (QE=252); 11 8 1;  10 5 3 2
+9 5 4 2    (QE=360); 11 8 1;  10 7 3
+8 7 5      (QE=280); 11 9;    10 4 3 2 1
+8 5 4 3    (QE=480); 11 9;    10 7 2 1
+7 5 4 3 1  (QE=420); 11 9;    10 8 2
+
+

Of these, although 10 9 1 has the smallest quantum entanglement (90), the configuration with only two packages, 11 9, in the passenger compartment gives Santa the most legroom and wins. In this situation, the quantum entanglement for the ideal configuration is therefore 99. Had there been two configurations with only two packages in the first group, the one with the smaller quantum entanglement would be chosen.

+

What is the quantum entanglement of the first group of packages in the ideal configuration?

+
+

Your puzzle answer was 10723906903.

--- Part Two ---

That's weird... the sleigh still isn't balancing.

+

"Ho ho ho", Santa muses to himself. "I forgot the trunk".

+

Balance the sleigh again, but this time, separate the packages into four groups instead of three. The other constraints still apply.

+

Given the example packages above, this would be the new unique first groups, their quantum entanglements, and one way to divide the remaining packages:

+

+11 4    (QE=44); 10 5;   9 3 2 1; 8 7
+10 5    (QE=50); 11 4;   9 3 2 1; 8 7
+9 5 1   (QE=45); 11 4;   10 3 2;  8 7
+9 4 2   (QE=72); 11 3 1; 10 5;    8 7
+9 3 2 1 (QE=54); 11 4;   10 5;    8 7
+8 7     (QE=56); 11 4;   10 5;    9 3 2 1
+
+

Of these, there are three arrangements that put the minimum (two) number of packages in the first group: 11 4, 10 5, and 8 7. Of these, 11 4 has the lowest quantum entanglement, and so it is selected.

+

Now, what is the quantum entanglement of the first group of packages in the ideal configuration?

+
+

Your puzzle answer was 74850409.

Both parts of this puzzle are complete! They provide two gold stars: **

+

At this point, you should return to your advent calendar and try another puzzle.

+

If you still want to see it, you can get your puzzle input.

+

You can also + this puzzle.

+
+ + + + + + diff --git a/advent24.ipynb b/advent24.ipynb new file mode 100644 index 0000000..43991ce --- /dev/null +++ b/advent24.ipynb @@ -0,0 +1,1842 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "import itertools\n", + "import functools\n", + "import operator\n", + "\n", + "def prod(iterable):\n", + " return functools.reduce(operator.mul, iterable, 1)" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "data": { + "text/plain": [ + "[1,\n", + " 2,\n", + " 3,\n", + " 5,\n", + " 7,\n", + " 13,\n", + " 17,\n", + " 19,\n", + " 23,\n", + " 29,\n", + " 31,\n", + " 37,\n", + " 41,\n", + " 43,\n", + " 53,\n", + " 59,\n", + " 61,\n", + " 67,\n", + " 71,\n", + " 73,\n", + " 79,\n", + " 83,\n", + " 89,\n", + " 97,\n", + " 101,\n", + " 103,\n", + " 107,\n", + " 109,\n", + " 113]" + ] + }, + "execution_count": 2, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "presents = [int(p) for p in open('advent24.txt').readlines()]\n", + "presents" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "# presents = [1,2,3,4,5,7,8,9,10,11]" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "data": { + "text/plain": [ + "512" + ] + }, + "execution_count": 19, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "group_weight = sum(presents) // 3\n", + "group_weight" + ] + }, + { + "cell_type": "code", + "execution_count": 38, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "#def valid(g1, g2, g3):\n", + "# return len(g1) < len(g2) and len(g1) < len(g3) and \\\n", + "# not (g1 & g2) and not (g1 & g3) and not (g2 & g3)" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "data": { + "text/plain": [ + "[([9, 11], [1, 2, 3, 4, 10], [5, 7, 8]),\n", + " ([9, 11], [1, 2, 3, 4, 10], [5, 8, 7]),\n", + " ([9, 11], [1, 2, 3, 4, 10], [7, 5, 8]),\n", + " ([9, 11], [1, 2, 3, 4, 10], [7, 8, 5]),\n", + " ([9, 11], [1, 2, 3, 4, 10], [8, 5, 7]),\n", + " ([9, 11], [1, 2, 3, 4, 10], [8, 7, 5]),\n", + " ([9, 11], [1, 2, 3, 10, 4], [5, 7, 8]),\n", + " ([9, 11], [1, 2, 3, 10, 4], [5, 8, 7]),\n", + " ([9, 11], [1, 2, 3, 10, 4], [7, 5, 8]),\n", + " ([9, 11], [1, 2, 3, 10, 4], [7, 8, 5]),\n", + " ([9, 11], [1, 2, 3, 10, 4], [8, 5, 7]),\n", + " ([9, 11], [1, 2, 3, 10, 4], [8, 7, 5]),\n", + " ([9, 11], [1, 2, 4, 3, 10], [5, 7, 8]),\n", + " ([9, 11], [1, 2, 4, 3, 10], [5, 8, 7]),\n", + " ([9, 11], [1, 2, 4, 3, 10], [7, 5, 8]),\n", + " ([9, 11], [1, 2, 4, 3, 10], [7, 8, 5]),\n", + " ([9, 11], [1, 2, 4, 3, 10], [8, 5, 7]),\n", + " ([9, 11], [1, 2, 4, 3, 10], [8, 7, 5]),\n", + " ([9, 11], [1, 2, 4, 5, 8], [3, 7, 10]),\n", + " ([9, 11], [1, 2, 4, 5, 8], [3, 10, 7]),\n", + " ([9, 11], [1, 2, 4, 5, 8], [7, 3, 10]),\n", + " ([9, 11], [1, 2, 4, 5, 8], [7, 10, 3]),\n", + " ([9, 11], [1, 2, 4, 5, 8], [10, 3, 7]),\n", + " ([9, 11], [1, 2, 4, 5, 8], [10, 7, 3]),\n", + " ([9, 11], [1, 2, 4, 8, 5], [3, 7, 10]),\n", + " ([9, 11], [1, 2, 4, 8, 5], [3, 10, 7]),\n", + " ([9, 11], [1, 2, 4, 8, 5], [7, 3, 10]),\n", + " ([9, 11], [1, 2, 4, 8, 5], [7, 10, 3]),\n", + " ([9, 11], [1, 2, 4, 8, 5], [10, 3, 7]),\n", + " ([9, 11], [1, 2, 4, 8, 5], [10, 7, 3]),\n", + " ([9, 11], [1, 2, 4, 10, 3], [5, 7, 8]),\n", + " ([9, 11], [1, 2, 4, 10, 3], [5, 8, 7]),\n", + " ([9, 11], [1, 2, 4, 10, 3], [7, 5, 8]),\n", + " ([9, 11], [1, 2, 4, 10, 3], [7, 8, 5]),\n", + " ([9, 11], [1, 2, 4, 10, 3], [8, 5, 7]),\n", + " ([9, 11], [1, 2, 4, 10, 3], [8, 7, 5]),\n", + " ([9, 11], [1, 2, 5, 4, 8], [3, 7, 10]),\n", + " ([9, 11], [1, 2, 5, 4, 8], [3, 10, 7]),\n", + " ([9, 11], [1, 2, 5, 4, 8], [7, 3, 10]),\n", + " ([9, 11], [1, 2, 5, 4, 8], [7, 10, 3]),\n", + " ([9, 11], [1, 2, 5, 4, 8], [10, 3, 7]),\n", + " ([9, 11], [1, 2, 5, 4, 8], [10, 7, 3]),\n", + " ([9, 11], [1, 2, 5, 8, 4], [3, 7, 10]),\n", + " ([9, 11], [1, 2, 5, 8, 4], [3, 10, 7]),\n", + " ([9, 11], [1, 2, 5, 8, 4], [7, 3, 10]),\n", + " ([9, 11], [1, 2, 5, 8, 4], [7, 10, 3]),\n", + " ([9, 11], [1, 2, 5, 8, 4], [10, 3, 7]),\n", + " ([9, 11], [1, 2, 5, 8, 4], [10, 7, 3]),\n", + " ([9, 11], [1, 2, 7, 10], [3, 4, 5, 8]),\n", + " ([9, 11], [1, 2, 7, 10], [3, 4, 8, 5]),\n", + " ([9, 11], [1, 2, 7, 10], [3, 5, 4, 8]),\n", + " ([9, 11], [1, 2, 7, 10], [3, 5, 8, 4]),\n", + " ([9, 11], [1, 2, 7, 10], [3, 8, 4, 5]),\n", + " ([9, 11], [1, 2, 7, 10], [3, 8, 5, 4]),\n", + " ([9, 11], [1, 2, 7, 10], [4, 3, 5, 8]),\n", + " ([9, 11], [1, 2, 7, 10], [4, 3, 8, 5]),\n", + " ([9, 11], [1, 2, 7, 10], [4, 5, 3, 8]),\n", + " ([9, 11], [1, 2, 7, 10], [4, 5, 8, 3]),\n", + " ([9, 11], [1, 2, 7, 10], [4, 8, 3, 5]),\n", + " ([9, 11], [1, 2, 7, 10], [4, 8, 5, 3]),\n", + " ([9, 11], [1, 2, 7, 10], [5, 3, 4, 8]),\n", + " ([9, 11], [1, 2, 7, 10], [5, 3, 8, 4]),\n", + " ([9, 11], [1, 2, 7, 10], [5, 4, 3, 8]),\n", + " ([9, 11], [1, 2, 7, 10], [5, 4, 8, 3]),\n", + " ([9, 11], [1, 2, 7, 10], [5, 8, 3, 4]),\n", + " ([9, 11], [1, 2, 7, 10], [5, 8, 4, 3]),\n", + " ([9, 11], [1, 2, 7, 10], [8, 3, 4, 5]),\n", + " ([9, 11], [1, 2, 7, 10], [8, 3, 5, 4]),\n", + " ([9, 11], [1, 2, 7, 10], [8, 4, 3, 5]),\n", + " ([9, 11], [1, 2, 7, 10], [8, 4, 5, 3]),\n", + " ([9, 11], [1, 2, 7, 10], [8, 5, 3, 4]),\n", + " ([9, 11], [1, 2, 7, 10], [8, 5, 4, 3]),\n", + " ([9, 11], [1, 2, 8, 4, 5], [3, 7, 10]),\n", + " ([9, 11], [1, 2, 8, 4, 5], [3, 10, 7]),\n", + " ([9, 11], [1, 2, 8, 4, 5], [7, 3, 10]),\n", + " ([9, 11], [1, 2, 8, 4, 5], [7, 10, 3]),\n", + " ([9, 11], [1, 2, 8, 4, 5], [10, 3, 7]),\n", + " ([9, 11], [1, 2, 8, 4, 5], [10, 7, 3]),\n", + " ([9, 11], [1, 2, 8, 5, 4], [3, 7, 10]),\n", + " ([9, 11], [1, 2, 8, 5, 4], [3, 10, 7]),\n", + " ([9, 11], [1, 2, 8, 5, 4], [7, 3, 10]),\n", + " ([9, 11], [1, 2, 8, 5, 4], [7, 10, 3]),\n", + " ([9, 11], [1, 2, 8, 5, 4], [10, 3, 7]),\n", + " ([9, 11], [1, 2, 8, 5, 4], [10, 7, 3]),\n", + " ([9, 11], [1, 2, 10, 3, 4], [5, 7, 8]),\n", + " ([9, 11], [1, 2, 10, 3, 4], [5, 8, 7]),\n", + " ([9, 11], [1, 2, 10, 3, 4], [7, 5, 8]),\n", + " ([9, 11], [1, 2, 10, 3, 4], [7, 8, 5]),\n", + " ([9, 11], [1, 2, 10, 3, 4], [8, 5, 7]),\n", + " ([9, 11], [1, 2, 10, 3, 4], [8, 7, 5]),\n", + " ([9, 11], [1, 2, 10, 4, 3], [5, 7, 8]),\n", + " ([9, 11], [1, 2, 10, 4, 3], [5, 8, 7]),\n", + " ([9, 11], [1, 2, 10, 4, 3], [7, 5, 8]),\n", + " ([9, 11], [1, 2, 10, 4, 3], [7, 8, 5]),\n", + " ([9, 11], [1, 2, 10, 4, 3], [8, 5, 7]),\n", + " ([9, 11], [1, 2, 10, 4, 3], [8, 7, 5]),\n", + " ([9, 11], [1, 2, 10, 7], [3, 4, 5, 8]),\n", + " ([9, 11], [1, 2, 10, 7], [3, 4, 8, 5]),\n", + " ([9, 11], [1, 2, 10, 7], [3, 5, 4, 8]),\n", + " ([9, 11], [1, 2, 10, 7], [3, 5, 8, 4]),\n", + " ([9, 11], [1, 2, 10, 7], [3, 8, 4, 5]),\n", + " ([9, 11], [1, 2, 10, 7], [3, 8, 5, 4]),\n", + " ([9, 11], [1, 2, 10, 7], [4, 3, 5, 8]),\n", + " ([9, 11], [1, 2, 10, 7], [4, 3, 8, 5]),\n", + " ([9, 11], [1, 2, 10, 7], [4, 5, 3, 8]),\n", + " ([9, 11], [1, 2, 10, 7], [4, 5, 8, 3]),\n", + " ([9, 11], [1, 2, 10, 7], [4, 8, 3, 5]),\n", + " ([9, 11], [1, 2, 10, 7], [4, 8, 5, 3]),\n", + " ([9, 11], [1, 2, 10, 7], [5, 3, 4, 8]),\n", + " ([9, 11], [1, 2, 10, 7], [5, 3, 8, 4]),\n", + " ([9, 11], [1, 2, 10, 7], [5, 4, 3, 8]),\n", + " ([9, 11], [1, 2, 10, 7], [5, 4, 8, 3]),\n", + " ([9, 11], [1, 2, 10, 7], [5, 8, 3, 4]),\n", + " ([9, 11], [1, 2, 10, 7], [5, 8, 4, 3]),\n", + " ([9, 11], [1, 2, 10, 7], [8, 3, 4, 5]),\n", + " ([9, 11], [1, 2, 10, 7], [8, 3, 5, 4]),\n", + " ([9, 11], [1, 2, 10, 7], [8, 4, 3, 5]),\n", + " ([9, 11], [1, 2, 10, 7], [8, 4, 5, 3]),\n", + " ([9, 11], [1, 2, 10, 7], [8, 5, 3, 4]),\n", + " ([9, 11], [1, 2, 10, 7], [8, 5, 4, 3]),\n", + " ([9, 11], [1, 3, 2, 4, 10], [5, 7, 8]),\n", + " ([9, 11], [1, 3, 2, 4, 10], [5, 8, 7]),\n", + " ([9, 11], [1, 3, 2, 4, 10], [7, 5, 8]),\n", + " ([9, 11], [1, 3, 2, 4, 10], [7, 8, 5]),\n", + " ([9, 11], [1, 3, 2, 4, 10], [8, 5, 7]),\n", + " ([9, 11], [1, 3, 2, 4, 10], [8, 7, 5]),\n", + " ([9, 11], [1, 3, 2, 10, 4], [5, 7, 8]),\n", + " ([9, 11], [1, 3, 2, 10, 4], [5, 8, 7]),\n", + " ([9, 11], [1, 3, 2, 10, 4], [7, 5, 8]),\n", + " ([9, 11], [1, 3, 2, 10, 4], [7, 8, 5]),\n", + " ([9, 11], [1, 3, 2, 10, 4], [8, 5, 7]),\n", + " ([9, 11], [1, 3, 2, 10, 4], [8, 7, 5]),\n", + " ([9, 11], [1, 3, 4, 2, 10], [5, 7, 8]),\n", + " ([9, 11], [1, 3, 4, 2, 10], [5, 8, 7]),\n", + " ([9, 11], [1, 3, 4, 2, 10], [7, 5, 8]),\n", + " ([9, 11], [1, 3, 4, 2, 10], [7, 8, 5]),\n", + " ([9, 11], [1, 3, 4, 2, 10], [8, 5, 7]),\n", + " ([9, 11], [1, 3, 4, 2, 10], [8, 7, 5]),\n", + " ([9, 11], [1, 3, 4, 5, 7], [2, 8, 10]),\n", + " ([9, 11], [1, 3, 4, 5, 7], [2, 10, 8]),\n", + " ([9, 11], [1, 3, 4, 5, 7], [8, 2, 10]),\n", + " ([9, 11], [1, 3, 4, 5, 7], [8, 10, 2]),\n", + " ([9, 11], [1, 3, 4, 5, 7], [10, 2, 8]),\n", + " ([9, 11], [1, 3, 4, 5, 7], [10, 8, 2]),\n", + " ([9, 11], [1, 3, 4, 7, 5], [2, 8, 10]),\n", + " ([9, 11], [1, 3, 4, 7, 5], [2, 10, 8]),\n", + " ([9, 11], [1, 3, 4, 7, 5], [8, 2, 10]),\n", + " ([9, 11], [1, 3, 4, 7, 5], [8, 10, 2]),\n", + " ([9, 11], [1, 3, 4, 7, 5], [10, 2, 8]),\n", + " ([9, 11], [1, 3, 4, 7, 5], [10, 8, 2]),\n", + " ([9, 11], [1, 3, 4, 10, 2], [5, 7, 8]),\n", + " ([9, 11], [1, 3, 4, 10, 2], [5, 8, 7]),\n", + " ([9, 11], [1, 3, 4, 10, 2], [7, 5, 8]),\n", + " ([9, 11], [1, 3, 4, 10, 2], [7, 8, 5]),\n", + " ([9, 11], [1, 3, 4, 10, 2], [8, 5, 7]),\n", + " ([9, 11], [1, 3, 4, 10, 2], [8, 7, 5]),\n", + " ([9, 11], [1, 3, 5, 4, 7], [2, 8, 10]),\n", + " ([9, 11], [1, 3, 5, 4, 7], [2, 10, 8]),\n", + " ([9, 11], [1, 3, 5, 4, 7], [8, 2, 10]),\n", + " ([9, 11], [1, 3, 5, 4, 7], [8, 10, 2]),\n", + " ([9, 11], [1, 3, 5, 4, 7], [10, 2, 8]),\n", + " ([9, 11], [1, 3, 5, 4, 7], [10, 8, 2]),\n", + " ([9, 11], [1, 3, 5, 7, 4], [2, 8, 10]),\n", + " ([9, 11], [1, 3, 5, 7, 4], [2, 10, 8]),\n", + " ([9, 11], [1, 3, 5, 7, 4], [8, 2, 10]),\n", + " ([9, 11], [1, 3, 5, 7, 4], [8, 10, 2]),\n", + " ([9, 11], [1, 3, 5, 7, 4], [10, 2, 8]),\n", + " ([9, 11], [1, 3, 5, 7, 4], [10, 8, 2]),\n", + " ([9, 11], [1, 3, 7, 4, 5], [2, 8, 10]),\n", + " ([9, 11], [1, 3, 7, 4, 5], [2, 10, 8]),\n", + " ([9, 11], [1, 3, 7, 4, 5], [8, 2, 10]),\n", + " ([9, 11], [1, 3, 7, 4, 5], [8, 10, 2]),\n", + " ([9, 11], [1, 3, 7, 4, 5], [10, 2, 8]),\n", + " ([9, 11], [1, 3, 7, 4, 5], [10, 8, 2]),\n", + " ([9, 11], [1, 3, 7, 5, 4], [2, 8, 10]),\n", + " ([9, 11], [1, 3, 7, 5, 4], [2, 10, 8]),\n", + " ([9, 11], [1, 3, 7, 5, 4], [8, 2, 10]),\n", + " ([9, 11], [1, 3, 7, 5, 4], [8, 10, 2]),\n", + " ([9, 11], [1, 3, 7, 5, 4], [10, 2, 8]),\n", + " ([9, 11], [1, 3, 7, 5, 4], [10, 8, 2]),\n", + " ([9, 11], [1, 3, 10, 2, 4], [5, 7, 8]),\n", + " ([9, 11], [1, 3, 10, 2, 4], [5, 8, 7]),\n", + " ([9, 11], [1, 3, 10, 2, 4], [7, 5, 8]),\n", + " ([9, 11], [1, 3, 10, 2, 4], [7, 8, 5]),\n", + " ([9, 11], [1, 3, 10, 2, 4], [8, 5, 7]),\n", + " ([9, 11], [1, 3, 10, 2, 4], [8, 7, 5]),\n", + " ([9, 11], [1, 3, 10, 4, 2], [5, 7, 8]),\n", + " ([9, 11], [1, 3, 10, 4, 2], [5, 8, 7]),\n", + " ([9, 11], [1, 3, 10, 4, 2], [7, 5, 8]),\n", + " ([9, 11], [1, 3, 10, 4, 2], [7, 8, 5]),\n", + " ([9, 11], [1, 3, 10, 4, 2], [8, 5, 7]),\n", + " ([9, 11], [1, 3, 10, 4, 2], [8, 7, 5]),\n", + " ([9, 11], [1, 4, 2, 3, 10], [5, 7, 8]),\n", + " ([9, 11], [1, 4, 2, 3, 10], [5, 8, 7]),\n", + " ([9, 11], [1, 4, 2, 3, 10], [7, 5, 8]),\n", + " ([9, 11], [1, 4, 2, 3, 10], [7, 8, 5]),\n", + " ([9, 11], [1, 4, 2, 3, 10], [8, 5, 7]),\n", + " ([9, 11], [1, 4, 2, 3, 10], [8, 7, 5]),\n", + " ([9, 11], [1, 4, 2, 5, 8], [3, 7, 10]),\n", + " ([9, 11], [1, 4, 2, 5, 8], [3, 10, 7]),\n", + " ([9, 11], [1, 4, 2, 5, 8], [7, 3, 10]),\n", + " ([9, 11], [1, 4, 2, 5, 8], [7, 10, 3]),\n", + " ([9, 11], [1, 4, 2, 5, 8], [10, 3, 7]),\n", + " ([9, 11], [1, 4, 2, 5, 8], [10, 7, 3]),\n", + " ([9, 11], [1, 4, 2, 8, 5], [3, 7, 10]),\n", + " ([9, 11], [1, 4, 2, 8, 5], [3, 10, 7]),\n", + " ([9, 11], [1, 4, 2, 8, 5], [7, 3, 10]),\n", + " ([9, 11], [1, 4, 2, 8, 5], [7, 10, 3]),\n", + " ([9, 11], [1, 4, 2, 8, 5], [10, 3, 7]),\n", + " ([9, 11], [1, 4, 2, 8, 5], [10, 7, 3]),\n", + " ([9, 11], [1, 4, 2, 10, 3], [5, 7, 8]),\n", + " ([9, 11], [1, 4, 2, 10, 3], [5, 8, 7]),\n", + " ([9, 11], [1, 4, 2, 10, 3], [7, 5, 8]),\n", + " ([9, 11], [1, 4, 2, 10, 3], [7, 8, 5]),\n", + " ([9, 11], [1, 4, 2, 10, 3], [8, 5, 7]),\n", + " ([9, 11], [1, 4, 2, 10, 3], [8, 7, 5]),\n", + " ([9, 11], [1, 4, 3, 2, 10], [5, 7, 8]),\n", + " ([9, 11], [1, 4, 3, 2, 10], [5, 8, 7]),\n", + " ([9, 11], [1, 4, 3, 2, 10], [7, 5, 8]),\n", + " ([9, 11], [1, 4, 3, 2, 10], [7, 8, 5]),\n", + " ([9, 11], [1, 4, 3, 2, 10], [8, 5, 7]),\n", + " ([9, 11], [1, 4, 3, 2, 10], [8, 7, 5]),\n", + " ([9, 11], [1, 4, 3, 5, 7], [2, 8, 10]),\n", + " ([9, 11], [1, 4, 3, 5, 7], [2, 10, 8]),\n", + " ([9, 11], [1, 4, 3, 5, 7], [8, 2, 10]),\n", + " ([9, 11], [1, 4, 3, 5, 7], [8, 10, 2]),\n", + " ([9, 11], [1, 4, 3, 5, 7], [10, 2, 8]),\n", + " ([9, 11], [1, 4, 3, 5, 7], [10, 8, 2]),\n", + " ([9, 11], [1, 4, 3, 7, 5], [2, 8, 10]),\n", + " ([9, 11], [1, 4, 3, 7, 5], [2, 10, 8]),\n", + " ([9, 11], [1, 4, 3, 7, 5], [8, 2, 10]),\n", + " ([9, 11], [1, 4, 3, 7, 5], [8, 10, 2]),\n", + " ([9, 11], [1, 4, 3, 7, 5], [10, 2, 8]),\n", + " ([9, 11], [1, 4, 3, 7, 5], [10, 8, 2]),\n", + " ([9, 11], [1, 4, 3, 10, 2], [5, 7, 8]),\n", + " ([9, 11], [1, 4, 3, 10, 2], [5, 8, 7]),\n", + " ([9, 11], [1, 4, 3, 10, 2], [7, 5, 8]),\n", + " ([9, 11], [1, 4, 3, 10, 2], [7, 8, 5]),\n", + " ([9, 11], [1, 4, 3, 10, 2], [8, 5, 7]),\n", + " ([9, 11], [1, 4, 3, 10, 2], [8, 7, 5]),\n", + " ([9, 11], [1, 4, 5, 2, 8], [3, 7, 10]),\n", + " ([9, 11], [1, 4, 5, 2, 8], [3, 10, 7]),\n", + " ([9, 11], [1, 4, 5, 2, 8], [7, 3, 10]),\n", + " ([9, 11], [1, 4, 5, 2, 8], [7, 10, 3]),\n", + " ([9, 11], [1, 4, 5, 2, 8], [10, 3, 7]),\n", + " ([9, 11], [1, 4, 5, 2, 8], [10, 7, 3]),\n", + " ([9, 11], [1, 4, 5, 3, 7], [2, 8, 10]),\n", + " ([9, 11], [1, 4, 5, 3, 7], [2, 10, 8]),\n", + " ([9, 11], [1, 4, 5, 3, 7], [8, 2, 10]),\n", + " ([9, 11], [1, 4, 5, 3, 7], [8, 10, 2]),\n", + " ([9, 11], [1, 4, 5, 3, 7], [10, 2, 8]),\n", + " ([9, 11], [1, 4, 5, 3, 7], [10, 8, 2]),\n", + " ([9, 11], [1, 4, 5, 7, 3], [2, 8, 10]),\n", + " ([9, 11], [1, 4, 5, 7, 3], [2, 10, 8]),\n", + " ([9, 11], [1, 4, 5, 7, 3], [8, 2, 10]),\n", + " ([9, 11], [1, 4, 5, 7, 3], [8, 10, 2]),\n", + " ([9, 11], [1, 4, 5, 7, 3], [10, 2, 8]),\n", + " ([9, 11], [1, 4, 5, 7, 3], [10, 8, 2]),\n", + " ([9, 11], [1, 4, 5, 8, 2], [3, 7, 10]),\n", + " ([9, 11], [1, 4, 5, 8, 2], [3, 10, 7]),\n", + " ([9, 11], [1, 4, 5, 8, 2], [7, 3, 10]),\n", + " ([9, 11], [1, 4, 5, 8, 2], [7, 10, 3]),\n", + " ([9, 11], [1, 4, 5, 8, 2], [10, 3, 7]),\n", + " ([9, 11], [1, 4, 5, 8, 2], [10, 7, 3]),\n", + " ([9, 11], [1, 4, 5, 10], [2, 3, 7, 8]),\n", + " ([9, 11], [1, 4, 5, 10], [2, 3, 8, 7]),\n", + " ([9, 11], [1, 4, 5, 10], [2, 7, 3, 8]),\n", + " ([9, 11], [1, 4, 5, 10], [2, 7, 8, 3]),\n", + " ([9, 11], [1, 4, 5, 10], [2, 8, 3, 7]),\n", + " ([9, 11], [1, 4, 5, 10], [2, 8, 7, 3]),\n", + " ([9, 11], [1, 4, 5, 10], [3, 2, 7, 8]),\n", + " ([9, 11], [1, 4, 5, 10], [3, 2, 8, 7]),\n", + " ([9, 11], [1, 4, 5, 10], [3, 7, 2, 8]),\n", + " ([9, 11], [1, 4, 5, 10], [3, 7, 8, 2]),\n", + " ([9, 11], [1, 4, 5, 10], [3, 8, 2, 7]),\n", + " ([9, 11], [1, 4, 5, 10], [3, 8, 7, 2]),\n", + " ([9, 11], [1, 4, 5, 10], [7, 2, 3, 8]),\n", + " ([9, 11], [1, 4, 5, 10], [7, 2, 8, 3]),\n", + " ([9, 11], [1, 4, 5, 10], [7, 3, 2, 8]),\n", + " ([9, 11], [1, 4, 5, 10], [7, 3, 8, 2]),\n", + " ([9, 11], [1, 4, 5, 10], [7, 8, 2, 3]),\n", + " ([9, 11], [1, 4, 5, 10], [7, 8, 3, 2]),\n", + " ([9, 11], [1, 4, 5, 10], [8, 2, 3, 7]),\n", + " ([9, 11], [1, 4, 5, 10], [8, 2, 7, 3]),\n", + " ([9, 11], [1, 4, 5, 10], [8, 3, 2, 7]),\n", + " ([9, 11], [1, 4, 5, 10], [8, 3, 7, 2]),\n", + " ([9, 11], [1, 4, 5, 10], [8, 7, 2, 3]),\n", + " ([9, 11], [1, 4, 5, 10], [8, 7, 3, 2]),\n", + " ([9, 11], [1, 4, 7, 3, 5], [2, 8, 10]),\n", + " ([9, 11], [1, 4, 7, 3, 5], [2, 10, 8]),\n", + " ([9, 11], [1, 4, 7, 3, 5], [8, 2, 10]),\n", + " ([9, 11], [1, 4, 7, 3, 5], [8, 10, 2]),\n", + " ([9, 11], [1, 4, 7, 3, 5], [10, 2, 8]),\n", + " ([9, 11], [1, 4, 7, 3, 5], [10, 8, 2]),\n", + " ([9, 11], [1, 4, 7, 5, 3], [2, 8, 10]),\n", + " ([9, 11], [1, 4, 7, 5, 3], [2, 10, 8]),\n", + " ([9, 11], [1, 4, 7, 5, 3], [8, 2, 10]),\n", + " ([9, 11], [1, 4, 7, 5, 3], [8, 10, 2]),\n", + " ([9, 11], [1, 4, 7, 5, 3], [10, 2, 8]),\n", + " ([9, 11], [1, 4, 7, 5, 3], [10, 8, 2]),\n", + " ([9, 11], [1, 4, 7, 8], [2, 3, 5, 10]),\n", + " ([9, 11], [1, 4, 7, 8], [2, 3, 10, 5]),\n", + " ([9, 11], [1, 4, 7, 8], [2, 5, 3, 10]),\n", + " ([9, 11], [1, 4, 7, 8], [2, 5, 10, 3]),\n", + " ([9, 11], [1, 4, 7, 8], [2, 10, 3, 5]),\n", + " ([9, 11], [1, 4, 7, 8], [2, 10, 5, 3]),\n", + " ([9, 11], [1, 4, 7, 8], [3, 2, 5, 10]),\n", + " ([9, 11], [1, 4, 7, 8], [3, 2, 10, 5]),\n", + " ([9, 11], [1, 4, 7, 8], [3, 5, 2, 10]),\n", + " ([9, 11], [1, 4, 7, 8], [3, 5, 10, 2]),\n", + " ([9, 11], [1, 4, 7, 8], [3, 10, 2, 5]),\n", + " ([9, 11], [1, 4, 7, 8], [3, 10, 5, 2]),\n", + " ([9, 11], [1, 4, 7, 8], [5, 2, 3, 10]),\n", + " ([9, 11], [1, 4, 7, 8], [5, 2, 10, 3]),\n", + " ([9, 11], [1, 4, 7, 8], [5, 3, 2, 10]),\n", + " ([9, 11], [1, 4, 7, 8], [5, 3, 10, 2]),\n", + " ([9, 11], [1, 4, 7, 8], [5, 10, 2, 3]),\n", + " ([9, 11], [1, 4, 7, 8], [5, 10, 3, 2]),\n", + " ([9, 11], [1, 4, 7, 8], [10, 2, 3, 5]),\n", + " ([9, 11], [1, 4, 7, 8], [10, 2, 5, 3]),\n", + " ([9, 11], [1, 4, 7, 8], [10, 3, 2, 5]),\n", + " ([9, 11], [1, 4, 7, 8], [10, 3, 5, 2]),\n", + " ([9, 11], [1, 4, 7, 8], [10, 5, 2, 3]),\n", + " ([9, 11], [1, 4, 7, 8], [10, 5, 3, 2]),\n", + " ([9, 11], [1, 4, 8, 2, 5], [3, 7, 10]),\n", + " ([9, 11], [1, 4, 8, 2, 5], [3, 10, 7]),\n", + " ([9, 11], [1, 4, 8, 2, 5], [7, 3, 10]),\n", + " ([9, 11], [1, 4, 8, 2, 5], [7, 10, 3]),\n", + " ([9, 11], [1, 4, 8, 2, 5], [10, 3, 7]),\n", + " ([9, 11], [1, 4, 8, 2, 5], [10, 7, 3]),\n", + " ([9, 11], [1, 4, 8, 5, 2], [3, 7, 10]),\n", + " ([9, 11], [1, 4, 8, 5, 2], [3, 10, 7]),\n", + " ([9, 11], [1, 4, 8, 5, 2], [7, 3, 10]),\n", + " ([9, 11], [1, 4, 8, 5, 2], [7, 10, 3]),\n", + " ([9, 11], [1, 4, 8, 5, 2], [10, 3, 7]),\n", + " ([9, 11], [1, 4, 8, 5, 2], [10, 7, 3]),\n", + " ([9, 11], [1, 4, 8, 7], [2, 3, 5, 10]),\n", + " ([9, 11], [1, 4, 8, 7], [2, 3, 10, 5]),\n", + " ([9, 11], [1, 4, 8, 7], [2, 5, 3, 10]),\n", + " ([9, 11], [1, 4, 8, 7], [2, 5, 10, 3]),\n", + " ([9, 11], [1, 4, 8, 7], [2, 10, 3, 5]),\n", + " ([9, 11], [1, 4, 8, 7], [2, 10, 5, 3]),\n", + " ([9, 11], [1, 4, 8, 7], [3, 2, 5, 10]),\n", + " ([9, 11], [1, 4, 8, 7], [3, 2, 10, 5]),\n", + " ([9, 11], [1, 4, 8, 7], [3, 5, 2, 10]),\n", + " ([9, 11], [1, 4, 8, 7], [3, 5, 10, 2]),\n", + " ([9, 11], [1, 4, 8, 7], [3, 10, 2, 5]),\n", + " ([9, 11], [1, 4, 8, 7], [3, 10, 5, 2]),\n", + " ([9, 11], [1, 4, 8, 7], [5, 2, 3, 10]),\n", + " ([9, 11], [1, 4, 8, 7], [5, 2, 10, 3]),\n", + " ([9, 11], [1, 4, 8, 7], [5, 3, 2, 10]),\n", + " ([9, 11], [1, 4, 8, 7], [5, 3, 10, 2]),\n", + " ([9, 11], [1, 4, 8, 7], [5, 10, 2, 3]),\n", + " ([9, 11], [1, 4, 8, 7], [5, 10, 3, 2]),\n", + " ([9, 11], [1, 4, 8, 7], [10, 2, 3, 5]),\n", + " ([9, 11], [1, 4, 8, 7], [10, 2, 5, 3]),\n", + " ([9, 11], [1, 4, 8, 7], [10, 3, 2, 5]),\n", + " ([9, 11], [1, 4, 8, 7], [10, 3, 5, 2]),\n", + " ([9, 11], [1, 4, 8, 7], [10, 5, 2, 3]),\n", + " ([9, 11], [1, 4, 8, 7], [10, 5, 3, 2]),\n", + " ([9, 11], [1, 4, 10, 2, 3], [5, 7, 8]),\n", + " ([9, 11], [1, 4, 10, 2, 3], [5, 8, 7]),\n", + " ([9, 11], [1, 4, 10, 2, 3], [7, 5, 8]),\n", + " ([9, 11], [1, 4, 10, 2, 3], [7, 8, 5]),\n", + " ([9, 11], [1, 4, 10, 2, 3], [8, 5, 7]),\n", + " ([9, 11], [1, 4, 10, 2, 3], [8, 7, 5]),\n", + " ([9, 11], [1, 4, 10, 3, 2], [5, 7, 8]),\n", + " ([9, 11], [1, 4, 10, 3, 2], [5, 8, 7]),\n", + " ([9, 11], [1, 4, 10, 3, 2], [7, 5, 8]),\n", + " ([9, 11], [1, 4, 10, 3, 2], [7, 8, 5]),\n", + " ([9, 11], [1, 4, 10, 3, 2], [8, 5, 7]),\n", + " ([9, 11], [1, 4, 10, 3, 2], [8, 7, 5]),\n", + " ([9, 11], [1, 4, 10, 5], [2, 3, 7, 8]),\n", + " ([9, 11], [1, 4, 10, 5], [2, 3, 8, 7]),\n", + " ([9, 11], [1, 4, 10, 5], [2, 7, 3, 8]),\n", + " ([9, 11], [1, 4, 10, 5], [2, 7, 8, 3]),\n", + " ([9, 11], [1, 4, 10, 5], [2, 8, 3, 7]),\n", + " ([9, 11], [1, 4, 10, 5], [2, 8, 7, 3]),\n", + " ([9, 11], [1, 4, 10, 5], [3, 2, 7, 8]),\n", + " ([9, 11], [1, 4, 10, 5], [3, 2, 8, 7]),\n", + " ([9, 11], [1, 4, 10, 5], [3, 7, 2, 8]),\n", + " ([9, 11], [1, 4, 10, 5], [3, 7, 8, 2]),\n", + " ([9, 11], [1, 4, 10, 5], [3, 8, 2, 7]),\n", + " ([9, 11], [1, 4, 10, 5], [3, 8, 7, 2]),\n", + " ([9, 11], [1, 4, 10, 5], [7, 2, 3, 8]),\n", + " ([9, 11], [1, 4, 10, 5], [7, 2, 8, 3]),\n", + " ([9, 11], [1, 4, 10, 5], [7, 3, 2, 8]),\n", + " ([9, 11], [1, 4, 10, 5], [7, 3, 8, 2]),\n", + " ([9, 11], [1, 4, 10, 5], [7, 8, 2, 3]),\n", + " ([9, 11], [1, 4, 10, 5], [7, 8, 3, 2]),\n", + " ([9, 11], [1, 4, 10, 5], [8, 2, 3, 7]),\n", + " ([9, 11], [1, 4, 10, 5], [8, 2, 7, 3]),\n", + " ([9, 11], [1, 4, 10, 5], [8, 3, 2, 7]),\n", + " ([9, 11], [1, 4, 10, 5], [8, 3, 7, 2]),\n", + " ([9, 11], [1, 4, 10, 5], [8, 7, 2, 3]),\n", + " ([9, 11], [1, 4, 10, 5], [8, 7, 3, 2]),\n", + " ([9, 11], [1, 5, 2, 4, 8], [3, 7, 10]),\n", + " ([9, 11], [1, 5, 2, 4, 8], [3, 10, 7]),\n", + " ([9, 11], [1, 5, 2, 4, 8], [7, 3, 10]),\n", + " ([9, 11], [1, 5, 2, 4, 8], [7, 10, 3]),\n", + " ([9, 11], [1, 5, 2, 4, 8], [10, 3, 7]),\n", + " ([9, 11], [1, 5, 2, 4, 8], [10, 7, 3]),\n", + " ([9, 11], [1, 5, 2, 8, 4], [3, 7, 10]),\n", + " ([9, 11], [1, 5, 2, 8, 4], [3, 10, 7]),\n", + " ([9, 11], [1, 5, 2, 8, 4], [7, 3, 10]),\n", + " ([9, 11], [1, 5, 2, 8, 4], [7, 10, 3]),\n", + " ([9, 11], [1, 5, 2, 8, 4], [10, 3, 7]),\n", + " ([9, 11], [1, 5, 2, 8, 4], [10, 7, 3]),\n", + " ([9, 11], [1, 5, 3, 4, 7], [2, 8, 10]),\n", + " ([9, 11], [1, 5, 3, 4, 7], [2, 10, 8]),\n", + " ([9, 11], [1, 5, 3, 4, 7], [8, 2, 10]),\n", + " ([9, 11], [1, 5, 3, 4, 7], [8, 10, 2]),\n", + " ([9, 11], [1, 5, 3, 4, 7], [10, 2, 8]),\n", + " ([9, 11], [1, 5, 3, 4, 7], [10, 8, 2]),\n", + " ([9, 11], [1, 5, 3, 7, 4], [2, 8, 10]),\n", + " ([9, 11], [1, 5, 3, 7, 4], [2, 10, 8]),\n", + " ([9, 11], [1, 5, 3, 7, 4], [8, 2, 10]),\n", + " ([9, 11], [1, 5, 3, 7, 4], [8, 10, 2]),\n", + " ([9, 11], [1, 5, 3, 7, 4], [10, 2, 8]),\n", + " ([9, 11], [1, 5, 3, 7, 4], [10, 8, 2]),\n", + " ([9, 11], [1, 5, 4, 2, 8], [3, 7, 10]),\n", + " ([9, 11], [1, 5, 4, 2, 8], [3, 10, 7]),\n", + " ([9, 11], [1, 5, 4, 2, 8], [7, 3, 10]),\n", + " ([9, 11], [1, 5, 4, 2, 8], [7, 10, 3]),\n", + " ([9, 11], [1, 5, 4, 2, 8], [10, 3, 7]),\n", + " ([9, 11], [1, 5, 4, 2, 8], [10, 7, 3]),\n", + " ([9, 11], [1, 5, 4, 3, 7], [2, 8, 10]),\n", + " ([9, 11], [1, 5, 4, 3, 7], [2, 10, 8]),\n", + " ([9, 11], [1, 5, 4, 3, 7], [8, 2, 10]),\n", + " ([9, 11], [1, 5, 4, 3, 7], [8, 10, 2]),\n", + " ([9, 11], [1, 5, 4, 3, 7], [10, 2, 8]),\n", + " ([9, 11], [1, 5, 4, 3, 7], [10, 8, 2]),\n", + " ([9, 11], [1, 5, 4, 7, 3], [2, 8, 10]),\n", + " ([9, 11], [1, 5, 4, 7, 3], [2, 10, 8]),\n", + " ([9, 11], [1, 5, 4, 7, 3], [8, 2, 10]),\n", + " ([9, 11], [1, 5, 4, 7, 3], [8, 10, 2]),\n", + " ([9, 11], [1, 5, 4, 7, 3], [10, 2, 8]),\n", + " ([9, 11], [1, 5, 4, 7, 3], [10, 8, 2]),\n", + " ([9, 11], [1, 5, 4, 8, 2], [3, 7, 10]),\n", + " ([9, 11], [1, 5, 4, 8, 2], [3, 10, 7]),\n", + " ([9, 11], [1, 5, 4, 8, 2], [7, 3, 10]),\n", + " ([9, 11], [1, 5, 4, 8, 2], [7, 10, 3]),\n", + " ([9, 11], [1, 5, 4, 8, 2], [10, 3, 7]),\n", + " ([9, 11], [1, 5, 4, 8, 2], [10, 7, 3]),\n", + " ([9, 11], [1, 5, 4, 10], [2, 3, 7, 8]),\n", + " ([9, 11], [1, 5, 4, 10], [2, 3, 8, 7]),\n", + " ([9, 11], [1, 5, 4, 10], [2, 7, 3, 8]),\n", + " ([9, 11], [1, 5, 4, 10], [2, 7, 8, 3]),\n", + " ([9, 11], [1, 5, 4, 10], [2, 8, 3, 7]),\n", + " ([9, 11], [1, 5, 4, 10], [2, 8, 7, 3]),\n", + " ([9, 11], [1, 5, 4, 10], [3, 2, 7, 8]),\n", + " ([9, 11], [1, 5, 4, 10], [3, 2, 8, 7]),\n", + " ([9, 11], [1, 5, 4, 10], [3, 7, 2, 8]),\n", + " ([9, 11], [1, 5, 4, 10], [3, 7, 8, 2]),\n", + " ([9, 11], [1, 5, 4, 10], [3, 8, 2, 7]),\n", + " ([9, 11], [1, 5, 4, 10], [3, 8, 7, 2]),\n", + " ([9, 11], [1, 5, 4, 10], [7, 2, 3, 8]),\n", + " ([9, 11], [1, 5, 4, 10], [7, 2, 8, 3]),\n", + " ([9, 11], [1, 5, 4, 10], [7, 3, 2, 8]),\n", + " ([9, 11], [1, 5, 4, 10], [7, 3, 8, 2]),\n", + " ([9, 11], [1, 5, 4, 10], [7, 8, 2, 3]),\n", + " ([9, 11], [1, 5, 4, 10], [7, 8, 3, 2]),\n", + " ([9, 11], [1, 5, 4, 10], [8, 2, 3, 7]),\n", + " ([9, 11], [1, 5, 4, 10], [8, 2, 7, 3]),\n", + " ([9, 11], [1, 5, 4, 10], [8, 3, 2, 7]),\n", + " ([9, 11], [1, 5, 4, 10], [8, 3, 7, 2]),\n", + " ([9, 11], [1, 5, 4, 10], [8, 7, 2, 3]),\n", + " ([9, 11], [1, 5, 4, 10], [8, 7, 3, 2]),\n", + " ([9, 11], [1, 5, 7, 3, 4], [2, 8, 10]),\n", + " ([9, 11], [1, 5, 7, 3, 4], [2, 10, 8]),\n", + " ([9, 11], [1, 5, 7, 3, 4], [8, 2, 10]),\n", + " ([9, 11], [1, 5, 7, 3, 4], [8, 10, 2]),\n", + " ([9, 11], [1, 5, 7, 3, 4], [10, 2, 8]),\n", + " ([9, 11], [1, 5, 7, 3, 4], [10, 8, 2]),\n", + " ([9, 11], [1, 5, 7, 4, 3], [2, 8, 10]),\n", + " ([9, 11], [1, 5, 7, 4, 3], [2, 10, 8]),\n", + " ([9, 11], [1, 5, 7, 4, 3], [8, 2, 10]),\n", + " ([9, 11], [1, 5, 7, 4, 3], [8, 10, 2]),\n", + " ([9, 11], [1, 5, 7, 4, 3], [10, 2, 8]),\n", + " ([9, 11], [1, 5, 7, 4, 3], [10, 8, 2]),\n", + " ([9, 11], [1, 5, 8, 2, 4], [3, 7, 10]),\n", + " ([9, 11], [1, 5, 8, 2, 4], [3, 10, 7]),\n", + " ([9, 11], [1, 5, 8, 2, 4], [7, 3, 10]),\n", + " ([9, 11], [1, 5, 8, 2, 4], [7, 10, 3]),\n", + " ([9, 11], [1, 5, 8, 2, 4], [10, 3, 7]),\n", + " ([9, 11], [1, 5, 8, 2, 4], [10, 7, 3]),\n", + " ([9, 11], [1, 5, 8, 4, 2], [3, 7, 10]),\n", + " ([9, 11], [1, 5, 8, 4, 2], [3, 10, 7]),\n", + " ([9, 11], [1, 5, 8, 4, 2], [7, 3, 10]),\n", + " ([9, 11], [1, 5, 8, 4, 2], [7, 10, 3]),\n", + " ([9, 11], [1, 5, 8, 4, 2], [10, 3, 7]),\n", + " ([9, 11], [1, 5, 8, 4, 2], [10, 7, 3]),\n", + " ([9, 11], [1, 5, 10, 4], [2, 3, 7, 8]),\n", + " ([9, 11], [1, 5, 10, 4], [2, 3, 8, 7]),\n", + " ([9, 11], [1, 5, 10, 4], [2, 7, 3, 8]),\n", + " ([9, 11], [1, 5, 10, 4], [2, 7, 8, 3]),\n", + " ([9, 11], [1, 5, 10, 4], [2, 8, 3, 7]),\n", + " ([9, 11], [1, 5, 10, 4], [2, 8, 7, 3]),\n", + " ([9, 11], [1, 5, 10, 4], [3, 2, 7, 8]),\n", + " ([9, 11], [1, 5, 10, 4], [3, 2, 8, 7]),\n", + " ([9, 11], [1, 5, 10, 4], [3, 7, 2, 8]),\n", + " ([9, 11], [1, 5, 10, 4], [3, 7, 8, 2]),\n", + " ([9, 11], [1, 5, 10, 4], [3, 8, 2, 7]),\n", + " ([9, 11], [1, 5, 10, 4], [3, 8, 7, 2]),\n", + " ([9, 11], [1, 5, 10, 4], [7, 2, 3, 8]),\n", + " ([9, 11], [1, 5, 10, 4], [7, 2, 8, 3]),\n", + " ([9, 11], [1, 5, 10, 4], [7, 3, 2, 8]),\n", + " ([9, 11], [1, 5, 10, 4], [7, 3, 8, 2]),\n", + " ([9, 11], [1, 5, 10, 4], [7, 8, 2, 3]),\n", + " ([9, 11], [1, 5, 10, 4], [7, 8, 3, 2]),\n", + " ([9, 11], [1, 5, 10, 4], [8, 2, 3, 7]),\n", + " ([9, 11], [1, 5, 10, 4], [8, 2, 7, 3]),\n", + " ([9, 11], [1, 5, 10, 4], [8, 3, 2, 7]),\n", + " ([9, 11], [1, 5, 10, 4], [8, 3, 7, 2]),\n", + " ([9, 11], [1, 5, 10, 4], [8, 7, 2, 3]),\n", + " ([9, 11], [1, 5, 10, 4], [8, 7, 3, 2]),\n", + " ([9, 11], [1, 7, 2, 10], [3, 4, 5, 8]),\n", + " ([9, 11], [1, 7, 2, 10], [3, 4, 8, 5]),\n", + " ([9, 11], [1, 7, 2, 10], [3, 5, 4, 8]),\n", + " ([9, 11], [1, 7, 2, 10], [3, 5, 8, 4]),\n", + " ([9, 11], [1, 7, 2, 10], [3, 8, 4, 5]),\n", + " ([9, 11], [1, 7, 2, 10], [3, 8, 5, 4]),\n", + " ([9, 11], [1, 7, 2, 10], [4, 3, 5, 8]),\n", + " ([9, 11], [1, 7, 2, 10], [4, 3, 8, 5]),\n", + " ([9, 11], [1, 7, 2, 10], [4, 5, 3, 8]),\n", + " ([9, 11], [1, 7, 2, 10], [4, 5, 8, 3]),\n", + " ([9, 11], [1, 7, 2, 10], [4, 8, 3, 5]),\n", + " ([9, 11], [1, 7, 2, 10], [4, 8, 5, 3]),\n", + " ([9, 11], [1, 7, 2, 10], [5, 3, 4, 8]),\n", + " ([9, 11], [1, 7, 2, 10], [5, 3, 8, 4]),\n", + " ([9, 11], [1, 7, 2, 10], [5, 4, 3, 8]),\n", + " ([9, 11], [1, 7, 2, 10], [5, 4, 8, 3]),\n", + " ([9, 11], [1, 7, 2, 10], [5, 8, 3, 4]),\n", + " ([9, 11], [1, 7, 2, 10], [5, 8, 4, 3]),\n", + " ([9, 11], [1, 7, 2, 10], [8, 3, 4, 5]),\n", + " ([9, 11], [1, 7, 2, 10], [8, 3, 5, 4]),\n", + " ([9, 11], [1, 7, 2, 10], [8, 4, 3, 5]),\n", + " ([9, 11], [1, 7, 2, 10], [8, 4, 5, 3]),\n", + " ([9, 11], [1, 7, 2, 10], [8, 5, 3, 4]),\n", + " ([9, 11], [1, 7, 2, 10], [8, 5, 4, 3]),\n", + " ([9, 11], [1, 7, 3, 4, 5], [2, 8, 10]),\n", + " ([9, 11], [1, 7, 3, 4, 5], [2, 10, 8]),\n", + " ([9, 11], [1, 7, 3, 4, 5], [8, 2, 10]),\n", + " ([9, 11], [1, 7, 3, 4, 5], [8, 10, 2]),\n", + " ([9, 11], [1, 7, 3, 4, 5], [10, 2, 8]),\n", + " ([9, 11], [1, 7, 3, 4, 5], [10, 8, 2]),\n", + " ([9, 11], [1, 7, 3, 5, 4], [2, 8, 10]),\n", + " ([9, 11], [1, 7, 3, 5, 4], [2, 10, 8]),\n", + " ([9, 11], [1, 7, 3, 5, 4], [8, 2, 10]),\n", + " ([9, 11], [1, 7, 3, 5, 4], [8, 10, 2]),\n", + " ([9, 11], [1, 7, 3, 5, 4], [10, 2, 8]),\n", + " ([9, 11], [1, 7, 3, 5, 4], [10, 8, 2]),\n", + " ([9, 11], [1, 7, 4, 3, 5], [2, 8, 10]),\n", + " ([9, 11], [1, 7, 4, 3, 5], [2, 10, 8]),\n", + " ([9, 11], [1, 7, 4, 3, 5], [8, 2, 10]),\n", + " ([9, 11], [1, 7, 4, 3, 5], [8, 10, 2]),\n", + " ([9, 11], [1, 7, 4, 3, 5], [10, 2, 8]),\n", + " ([9, 11], [1, 7, 4, 3, 5], [10, 8, 2]),\n", + " ([9, 11], [1, 7, 4, 5, 3], [2, 8, 10]),\n", + " ([9, 11], [1, 7, 4, 5, 3], [2, 10, 8]),\n", + " ([9, 11], [1, 7, 4, 5, 3], [8, 2, 10]),\n", + " ([9, 11], [1, 7, 4, 5, 3], [8, 10, 2]),\n", + " ([9, 11], [1, 7, 4, 5, 3], [10, 2, 8]),\n", + " ([9, 11], [1, 7, 4, 5, 3], [10, 8, 2]),\n", + " ([9, 11], [1, 7, 4, 8], [2, 3, 5, 10]),\n", + " ([9, 11], [1, 7, 4, 8], [2, 3, 10, 5]),\n", + " ([9, 11], [1, 7, 4, 8], [2, 5, 3, 10]),\n", + " ([9, 11], [1, 7, 4, 8], [2, 5, 10, 3]),\n", + " ([9, 11], [1, 7, 4, 8], [2, 10, 3, 5]),\n", + " ([9, 11], [1, 7, 4, 8], [2, 10, 5, 3]),\n", + " ([9, 11], [1, 7, 4, 8], [3, 2, 5, 10]),\n", + " ([9, 11], [1, 7, 4, 8], [3, 2, 10, 5]),\n", + " ([9, 11], [1, 7, 4, 8], [3, 5, 2, 10]),\n", + " ([9, 11], [1, 7, 4, 8], [3, 5, 10, 2]),\n", + " ([9, 11], [1, 7, 4, 8], [3, 10, 2, 5]),\n", + " ([9, 11], [1, 7, 4, 8], [3, 10, 5, 2]),\n", + " ([9, 11], [1, 7, 4, 8], [5, 2, 3, 10]),\n", + " ([9, 11], [1, 7, 4, 8], [5, 2, 10, 3]),\n", + " ([9, 11], [1, 7, 4, 8], [5, 3, 2, 10]),\n", + " ([9, 11], [1, 7, 4, 8], [5, 3, 10, 2]),\n", + " ([9, 11], [1, 7, 4, 8], [5, 10, 2, 3]),\n", + " ([9, 11], [1, 7, 4, 8], [5, 10, 3, 2]),\n", + " ([9, 11], [1, 7, 4, 8], [10, 2, 3, 5]),\n", + " ([9, 11], [1, 7, 4, 8], [10, 2, 5, 3]),\n", + " ([9, 11], [1, 7, 4, 8], [10, 3, 2, 5]),\n", + " ([9, 11], [1, 7, 4, 8], [10, 3, 5, 2]),\n", + " ([9, 11], [1, 7, 4, 8], [10, 5, 2, 3]),\n", + " ([9, 11], [1, 7, 4, 8], [10, 5, 3, 2]),\n", + " ([9, 11], [1, 7, 5, 3, 4], [2, 8, 10]),\n", + " ([9, 11], [1, 7, 5, 3, 4], [2, 10, 8]),\n", + " ([9, 11], [1, 7, 5, 3, 4], [8, 2, 10]),\n", + " ([9, 11], [1, 7, 5, 3, 4], [8, 10, 2]),\n", + " ([9, 11], [1, 7, 5, 3, 4], [10, 2, 8]),\n", + " ([9, 11], [1, 7, 5, 3, 4], [10, 8, 2]),\n", + " ([9, 11], [1, 7, 5, 4, 3], [2, 8, 10]),\n", + " ([9, 11], [1, 7, 5, 4, 3], [2, 10, 8]),\n", + " ([9, 11], [1, 7, 5, 4, 3], [8, 2, 10]),\n", + " ([9, 11], [1, 7, 5, 4, 3], [8, 10, 2]),\n", + " ([9, 11], [1, 7, 5, 4, 3], [10, 2, 8]),\n", + " ([9, 11], [1, 7, 5, 4, 3], [10, 8, 2]),\n", + " ([9, 11], [1, 7, 8, 4], [2, 3, 5, 10]),\n", + " ([9, 11], [1, 7, 8, 4], [2, 3, 10, 5]),\n", + " ([9, 11], [1, 7, 8, 4], [2, 5, 3, 10]),\n", + " ([9, 11], [1, 7, 8, 4], [2, 5, 10, 3]),\n", + " ([9, 11], [1, 7, 8, 4], [2, 10, 3, 5]),\n", + " ([9, 11], [1, 7, 8, 4], [2, 10, 5, 3]),\n", + " ([9, 11], [1, 7, 8, 4], [3, 2, 5, 10]),\n", + " ([9, 11], [1, 7, 8, 4], [3, 2, 10, 5]),\n", + " ([9, 11], [1, 7, 8, 4], [3, 5, 2, 10]),\n", + " ([9, 11], [1, 7, 8, 4], [3, 5, 10, 2]),\n", + " ([9, 11], [1, 7, 8, 4], [3, 10, 2, 5]),\n", + " ([9, 11], [1, 7, 8, 4], [3, 10, 5, 2]),\n", + " ([9, 11], [1, 7, 8, 4], [5, 2, 3, 10]),\n", + " ([9, 11], [1, 7, 8, 4], [5, 2, 10, 3]),\n", + " ([9, 11], [1, 7, 8, 4], [5, 3, 2, 10]),\n", + " ([9, 11], [1, 7, 8, 4], [5, 3, 10, 2]),\n", + " ([9, 11], [1, 7, 8, 4], [5, 10, 2, 3]),\n", + " ([9, 11], [1, 7, 8, 4], [5, 10, 3, 2]),\n", + " ([9, 11], [1, 7, 8, 4], [10, 2, 3, 5]),\n", + " ([9, 11], [1, 7, 8, 4], [10, 2, 5, 3]),\n", + " ([9, 11], [1, 7, 8, 4], [10, 3, 2, 5]),\n", + " ([9, 11], [1, 7, 8, 4], [10, 3, 5, 2]),\n", + " ([9, 11], [1, 7, 8, 4], [10, 5, 2, 3]),\n", + " ([9, 11], [1, 7, 8, 4], [10, 5, 3, 2]),\n", + " ([9, 11], [1, 7, 10, 2], [3, 4, 5, 8]),\n", + " ([9, 11], [1, 7, 10, 2], [3, 4, 8, 5]),\n", + " ([9, 11], [1, 7, 10, 2], [3, 5, 4, 8]),\n", + " ([9, 11], [1, 7, 10, 2], [3, 5, 8, 4]),\n", + " ([9, 11], [1, 7, 10, 2], [3, 8, 4, 5]),\n", + " ([9, 11], [1, 7, 10, 2], [3, 8, 5, 4]),\n", + " ([9, 11], [1, 7, 10, 2], [4, 3, 5, 8]),\n", + " ([9, 11], [1, 7, 10, 2], [4, 3, 8, 5]),\n", + " ([9, 11], [1, 7, 10, 2], [4, 5, 3, 8]),\n", + " ([9, 11], [1, 7, 10, 2], [4, 5, 8, 3]),\n", + " ([9, 11], [1, 7, 10, 2], [4, 8, 3, 5]),\n", + " ([9, 11], [1, 7, 10, 2], [4, 8, 5, 3]),\n", + " ([9, 11], [1, 7, 10, 2], [5, 3, 4, 8]),\n", + " ([9, 11], [1, 7, 10, 2], [5, 3, 8, 4]),\n", + " ([9, 11], [1, 7, 10, 2], [5, 4, 3, 8]),\n", + " ([9, 11], [1, 7, 10, 2], [5, 4, 8, 3]),\n", + " ([9, 11], [1, 7, 10, 2], [5, 8, 3, 4]),\n", + " ([9, 11], [1, 7, 10, 2], [5, 8, 4, 3]),\n", + " ([9, 11], [1, 7, 10, 2], [8, 3, 4, 5]),\n", + " ([9, 11], [1, 7, 10, 2], [8, 3, 5, 4]),\n", + " ([9, 11], [1, 7, 10, 2], [8, 4, 3, 5]),\n", + " ([9, 11], [1, 7, 10, 2], [8, 4, 5, 3]),\n", + " ([9, 11], [1, 7, 10, 2], [8, 5, 3, 4]),\n", + " ([9, 11], [1, 7, 10, 2], [8, 5, 4, 3]),\n", + " ([9, 11], [1, 8, 2, 4, 5], [3, 7, 10]),\n", + " ([9, 11], [1, 8, 2, 4, 5], [3, 10, 7]),\n", + " ([9, 11], [1, 8, 2, 4, 5], [7, 3, 10]),\n", + " ([9, 11], [1, 8, 2, 4, 5], [7, 10, 3]),\n", + " ([9, 11], [1, 8, 2, 4, 5], [10, 3, 7]),\n", + " ([9, 11], [1, 8, 2, 4, 5], [10, 7, 3]),\n", + " ([9, 11], [1, 8, 2, 5, 4], [3, 7, 10]),\n", + " ([9, 11], [1, 8, 2, 5, 4], [3, 10, 7]),\n", + " ([9, 11], [1, 8, 2, 5, 4], [7, 3, 10]),\n", + " ([9, 11], [1, 8, 2, 5, 4], [7, 10, 3]),\n", + " ([9, 11], [1, 8, 2, 5, 4], [10, 3, 7]),\n", + " ([9, 11], [1, 8, 2, 5, 4], [10, 7, 3]),\n", + " ([9, 11], [1, 8, 4, 2, 5], [3, 7, 10]),\n", + " ([9, 11], [1, 8, 4, 2, 5], [3, 10, 7]),\n", + " ([9, 11], [1, 8, 4, 2, 5], [7, 3, 10]),\n", + " ([9, 11], [1, 8, 4, 2, 5], [7, 10, 3]),\n", + " ([9, 11], [1, 8, 4, 2, 5], [10, 3, 7]),\n", + " ([9, 11], [1, 8, 4, 2, 5], [10, 7, 3]),\n", + " ([9, 11], [1, 8, 4, 5, 2], [3, 7, 10]),\n", + " ([9, 11], [1, 8, 4, 5, 2], [3, 10, 7]),\n", + " ([9, 11], [1, 8, 4, 5, 2], [7, 3, 10]),\n", + " ([9, 11], [1, 8, 4, 5, 2], [7, 10, 3]),\n", + " ([9, 11], [1, 8, 4, 5, 2], [10, 3, 7]),\n", + " ([9, 11], [1, 8, 4, 5, 2], [10, 7, 3]),\n", + " ([9, 11], [1, 8, 4, 7], [2, 3, 5, 10]),\n", + " ([9, 11], [1, 8, 4, 7], [2, 3, 10, 5]),\n", + " ([9, 11], [1, 8, 4, 7], [2, 5, 3, 10]),\n", + " ([9, 11], [1, 8, 4, 7], [2, 5, 10, 3]),\n", + " ([9, 11], [1, 8, 4, 7], [2, 10, 3, 5]),\n", + " ([9, 11], [1, 8, 4, 7], [2, 10, 5, 3]),\n", + " ([9, 11], [1, 8, 4, 7], [3, 2, 5, 10]),\n", + " ([9, 11], [1, 8, 4, 7], [3, 2, 10, 5]),\n", + " ([9, 11], [1, 8, 4, 7], [3, 5, 2, 10]),\n", + " ([9, 11], [1, 8, 4, 7], [3, 5, 10, 2]),\n", + " ([9, 11], [1, 8, 4, 7], [3, 10, 2, 5]),\n", + " ([9, 11], [1, 8, 4, 7], [3, 10, 5, 2]),\n", + " ([9, 11], [1, 8, 4, 7], [5, 2, 3, 10]),\n", + " ([9, 11], [1, 8, 4, 7], [5, 2, 10, 3]),\n", + " ([9, 11], [1, 8, 4, 7], [5, 3, 2, 10]),\n", + " ([9, 11], [1, 8, 4, 7], [5, 3, 10, 2]),\n", + " ([9, 11], [1, 8, 4, 7], [5, 10, 2, 3]),\n", + " ([9, 11], [1, 8, 4, 7], [5, 10, 3, 2]),\n", + " ([9, 11], [1, 8, 4, 7], [10, 2, 3, 5]),\n", + " ([9, 11], [1, 8, 4, 7], [10, 2, 5, 3]),\n", + " ([9, 11], [1, 8, 4, 7], [10, 3, 2, 5]),\n", + " ([9, 11], [1, 8, 4, 7], [10, 3, 5, 2]),\n", + " ([9, 11], [1, 8, 4, 7], [10, 5, 2, 3]),\n", + " ([9, 11], [1, 8, 4, 7], [10, 5, 3, 2]),\n", + " ([9, 11], [1, 8, 5, 2, 4], [3, 7, 10]),\n", + " ([9, 11], [1, 8, 5, 2, 4], [3, 10, 7]),\n", + " ([9, 11], [1, 8, 5, 2, 4], [7, 3, 10]),\n", + " ([9, 11], [1, 8, 5, 2, 4], [7, 10, 3]),\n", + " ([9, 11], [1, 8, 5, 2, 4], [10, 3, 7]),\n", + " ([9, 11], [1, 8, 5, 2, 4], [10, 7, 3]),\n", + " ([9, 11], [1, 8, 5, 4, 2], [3, 7, 10]),\n", + " ([9, 11], [1, 8, 5, 4, 2], [3, 10, 7]),\n", + " ([9, 11], [1, 8, 5, 4, 2], [7, 3, 10]),\n", + " ([9, 11], [1, 8, 5, 4, 2], [7, 10, 3]),\n", + " ([9, 11], [1, 8, 5, 4, 2], [10, 3, 7]),\n", + " ([9, 11], [1, 8, 5, 4, 2], [10, 7, 3]),\n", + " ([9, 11], [1, 8, 7, 4], [2, 3, 5, 10]),\n", + " ([9, 11], [1, 8, 7, 4], [2, 3, 10, 5]),\n", + " ([9, 11], [1, 8, 7, 4], [2, 5, 3, 10]),\n", + " ([9, 11], [1, 8, 7, 4], [2, 5, 10, 3]),\n", + " ([9, 11], [1, 8, 7, 4], [2, 10, 3, 5]),\n", + " ([9, 11], [1, 8, 7, 4], [2, 10, 5, 3]),\n", + " ([9, 11], [1, 8, 7, 4], [3, 2, 5, 10]),\n", + " ([9, 11], [1, 8, 7, 4], [3, 2, 10, 5]),\n", + " ([9, 11], [1, 8, 7, 4], [3, 5, 2, 10]),\n", + " ([9, 11], [1, 8, 7, 4], [3, 5, 10, 2]),\n", + " ([9, 11], [1, 8, 7, 4], [3, 10, 2, 5]),\n", + " ([9, 11], [1, 8, 7, 4], [3, 10, 5, 2]),\n", + " ([9, 11], [1, 8, 7, 4], [5, 2, 3, 10]),\n", + " ([9, 11], [1, 8, 7, 4], [5, 2, 10, 3]),\n", + " ([9, 11], [1, 8, 7, 4], [5, 3, 2, 10]),\n", + " ([9, 11], [1, 8, 7, 4], [5, 3, 10, 2]),\n", + " ([9, 11], [1, 8, 7, 4], [5, 10, 2, 3]),\n", + " ([9, 11], [1, 8, 7, 4], [5, 10, 3, 2]),\n", + " ([9, 11], [1, 8, 7, 4], [10, 2, 3, 5]),\n", + " ([9, 11], [1, 8, 7, 4], [10, 2, 5, 3]),\n", + " ([9, 11], [1, 8, 7, 4], [10, 3, 2, 5]),\n", + " ([9, 11], [1, 8, 7, 4], [10, 3, 5, 2]),\n", + " ([9, 11], [1, 8, 7, 4], [10, 5, 2, 3]),\n", + " ([9, 11], [1, 8, 7, 4], [10, 5, 3, 2]),\n", + " ([9, 11], [1, 10, 2, 3, 4], [5, 7, 8]),\n", + " ([9, 11], [1, 10, 2, 3, 4], [5, 8, 7]),\n", + " ([9, 11], [1, 10, 2, 3, 4], [7, 5, 8]),\n", + " ([9, 11], [1, 10, 2, 3, 4], [7, 8, 5]),\n", + " ([9, 11], [1, 10, 2, 3, 4], [8, 5, 7]),\n", + " ([9, 11], [1, 10, 2, 3, 4], [8, 7, 5]),\n", + " ([9, 11], [1, 10, 2, 4, 3], [5, 7, 8]),\n", + " ([9, 11], [1, 10, 2, 4, 3], [5, 8, 7]),\n", + " ([9, 11], [1, 10, 2, 4, 3], [7, 5, 8]),\n", + " ([9, 11], [1, 10, 2, 4, 3], [7, 8, 5]),\n", + " ([9, 11], [1, 10, 2, 4, 3], [8, 5, 7]),\n", + " ([9, 11], [1, 10, 2, 4, 3], [8, 7, 5]),\n", + " ([9, 11], [1, 10, 2, 7], [3, 4, 5, 8]),\n", + " ([9, 11], [1, 10, 2, 7], [3, 4, 8, 5]),\n", + " ([9, 11], [1, 10, 2, 7], [3, 5, 4, 8]),\n", + " ([9, 11], [1, 10, 2, 7], [3, 5, 8, 4]),\n", + " ([9, 11], [1, 10, 2, 7], [3, 8, 4, 5]),\n", + " ([9, 11], [1, 10, 2, 7], [3, 8, 5, 4]),\n", + " ([9, 11], [1, 10, 2, 7], [4, 3, 5, 8]),\n", + " ([9, 11], [1, 10, 2, 7], [4, 3, 8, 5]),\n", + " ([9, 11], [1, 10, 2, 7], [4, 5, 3, 8]),\n", + " ([9, 11], [1, 10, 2, 7], [4, 5, 8, 3]),\n", + " ([9, 11], [1, 10, 2, 7], [4, 8, 3, 5]),\n", + " ([9, 11], [1, 10, 2, 7], [4, 8, 5, 3]),\n", + " ([9, 11], [1, 10, 2, 7], [5, 3, 4, 8]),\n", + " ([9, 11], [1, 10, 2, 7], [5, 3, 8, 4]),\n", + " ([9, 11], [1, 10, 2, 7], [5, 4, 3, 8]),\n", + " ([9, 11], [1, 10, 2, 7], [5, 4, 8, 3]),\n", + " ([9, 11], [1, 10, 2, 7], [5, 8, 3, 4]),\n", + " ([9, 11], [1, 10, 2, 7], [5, 8, 4, 3]),\n", + " ([9, 11], [1, 10, 2, 7], [8, 3, 4, 5]),\n", + " ([9, 11], [1, 10, 2, 7], [8, 3, 5, 4]),\n", + " ([9, 11], [1, 10, 2, 7], [8, 4, 3, 5]),\n", + " ([9, 11], [1, 10, 2, 7], [8, 4, 5, 3]),\n", + " ([9, 11], [1, 10, 2, 7], [8, 5, 3, 4]),\n", + " ([9, 11], [1, 10, 2, 7], [8, 5, 4, 3]),\n", + " ([9, 11], [1, 10, 3, 2, 4], [5, 7, 8]),\n", + " ([9, 11], [1, 10, 3, 2, 4], [5, 8, 7]),\n", + " ([9, 11], [1, 10, 3, 2, 4], [7, 5, 8]),\n", + " ([9, 11], [1, 10, 3, 2, 4], [7, 8, 5]),\n", + " ([9, 11], [1, 10, 3, 2, 4], [8, 5, 7]),\n", + " ([9, 11], [1, 10, 3, 2, 4], [8, 7, 5]),\n", + " ([9, 11], [1, 10, 3, 4, 2], [5, 7, 8]),\n", + " ([9, 11], [1, 10, 3, 4, 2], [5, 8, 7]),\n", + " ([9, 11], [1, 10, 3, 4, 2], [7, 5, 8]),\n", + " ([9, 11], [1, 10, 3, 4, 2], [7, 8, 5]),\n", + " ([9, 11], [1, 10, 3, 4, 2], [8, 5, 7]),\n", + " ([9, 11], [1, 10, 3, 4, 2], [8, 7, 5]),\n", + " ([9, 11], [1, 10, 4, 2, 3], [5, 7, 8]),\n", + " ([9, 11], [1, 10, 4, 2, 3], [5, 8, 7]),\n", + " ([9, 11], [1, 10, 4, 2, 3], [7, 5, 8]),\n", + " ([9, 11], [1, 10, 4, 2, 3], [7, 8, 5]),\n", + " ([9, 11], [1, 10, 4, 2, 3], [8, 5, 7]),\n", + " ([9, 11], [1, 10, 4, 2, 3], [8, 7, 5]),\n", + " ([9, 11], [1, 10, 4, 3, 2], [5, 7, 8]),\n", + " ([9, 11], [1, 10, 4, 3, 2], [5, 8, 7]),\n", + " ([9, 11], [1, 10, 4, 3, 2], [7, 5, 8]),\n", + " ([9, 11], [1, 10, 4, 3, 2], [7, 8, 5]),\n", + " ([9, 11], [1, 10, 4, 3, 2], [8, 5, 7]),\n", + " ([9, 11], [1, 10, 4, 3, 2], [8, 7, 5]),\n", + " ([9, 11], [1, 10, 4, 5], [2, 3, 7, 8]),\n", + " ([9, 11], [1, 10, 4, 5], [2, 3, 8, 7]),\n", + " ([9, 11], [1, 10, 4, 5], [2, 7, 3, 8]),\n", + " ([9, 11], [1, 10, 4, 5], [2, 7, 8, 3]),\n", + " ([9, 11], [1, 10, 4, 5], [2, 8, 3, 7]),\n", + " ([9, 11], [1, 10, 4, 5], [2, 8, 7, 3]),\n", + " ([9, 11], [1, 10, 4, 5], [3, 2, 7, 8]),\n", + " ([9, 11], [1, 10, 4, 5], [3, 2, 8, 7]),\n", + " ([9, 11], [1, 10, 4, 5], [3, 7, 2, 8]),\n", + " ([9, 11], [1, 10, 4, 5], [3, 7, 8, 2]),\n", + " ([9, 11], [1, 10, 4, 5], [3, 8, 2, 7]),\n", + " ([9, 11], [1, 10, 4, 5], [3, 8, 7, 2]),\n", + " ([9, 11], [1, 10, 4, 5], [7, 2, 3, 8]),\n", + " ([9, 11], [1, 10, 4, 5], [7, 2, 8, 3]),\n", + " ([9, 11], [1, 10, 4, 5], [7, 3, 2, 8]),\n", + " ([9, 11], [1, 10, 4, 5], [7, 3, 8, 2]),\n", + " ([9, 11], [1, 10, 4, 5], [7, 8, 2, 3]),\n", + " ([9, 11], [1, 10, 4, 5], [7, 8, 3, 2]),\n", + " ([9, 11], [1, 10, 4, 5], [8, 2, 3, 7]),\n", + " ([9, 11], [1, 10, 4, 5], [8, 2, 7, 3]),\n", + " ([9, 11], [1, 10, 4, 5], [8, 3, 2, 7]),\n", + " ([9, 11], [1, 10, 4, 5], [8, 3, 7, 2]),\n", + " ([9, 11], [1, 10, 4, 5], [8, 7, 2, 3]),\n", + " ([9, 11], [1, 10, 4, 5], [8, 7, 3, 2]),\n", + " ([9, 11], [1, 10, 5, 4], [2, 3, 7, 8]),\n", + " ([9, 11], [1, 10, 5, 4], [2, 3, 8, 7]),\n", + " ([9, 11], [1, 10, 5, 4], [2, 7, 3, 8]),\n", + " ([9, 11], [1, 10, 5, 4], [2, 7, 8, 3]),\n", + " ([9, 11], [1, 10, 5, 4], [2, 8, 3, 7]),\n", + " ([9, 11], [1, 10, 5, 4], [2, 8, 7, 3]),\n", + " ([9, 11], [1, 10, 5, 4], [3, 2, 7, 8]),\n", + " ([9, 11], [1, 10, 5, 4], [3, 2, 8, 7]),\n", + " ([9, 11], [1, 10, 5, 4], [3, 7, 2, 8]),\n", + " ([9, 11], [1, 10, 5, 4], [3, 7, 8, 2]),\n", + " ([9, 11], [1, 10, 5, 4], [3, 8, 2, 7]),\n", + " ([9, 11], [1, 10, 5, 4], [3, 8, 7, 2]),\n", + " ([9, 11], [1, 10, 5, 4], [7, 2, 3, 8]),\n", + " ([9, 11], [1, 10, 5, 4], [7, 2, 8, 3]),\n", + " ([9, 11], [1, 10, 5, 4], [7, 3, 2, 8]),\n", + " ([9, 11], [1, 10, 5, 4], [7, 3, 8, 2]),\n", + " ([9, 11], [1, 10, 5, 4], [7, 8, 2, 3]),\n", + " ([9, 11], [1, 10, 5, 4], [7, 8, 3, 2]),\n", + " ([9, 11], [1, 10, 5, 4], [8, 2, 3, 7]),\n", + " ([9, 11], [1, 10, 5, 4], [8, 2, 7, 3]),\n", + " ([9, 11], [1, 10, 5, 4], [8, 3, 2, 7]),\n", + " ([9, 11], [1, 10, 5, 4], [8, 3, 7, 2]),\n", + " ([9, 11], [1, 10, 5, 4], [8, 7, 2, 3]),\n", + " ([9, 11], [1, 10, 5, 4], [8, 7, 3, 2]),\n", + " ([9, 11], [1, 10, 7, 2], [3, 4, 5, 8]),\n", + " ([9, 11], [1, 10, 7, 2], [3, 4, 8, 5]),\n", + " ([9, 11], [1, 10, 7, 2], [3, 5, 4, 8]),\n", + " ([9, 11], [1, 10, 7, 2], [3, 5, 8, 4]),\n", + " ([9, 11], [1, 10, 7, 2], [3, 8, 4, 5]),\n", + " ([9, 11], [1, 10, 7, 2], [3, 8, 5, 4]),\n", + " ([9, 11], [1, 10, 7, 2], [4, 3, 5, 8]),\n", + " ([9, 11], [1, 10, 7, 2], [4, 3, 8, 5]),\n", + " ([9, 11], [1, 10, 7, 2], [4, 5, 3, 8]),\n", + " ([9, 11], [1, 10, 7, 2], [4, 5, 8, 3]),\n", + " ([9, 11], [1, 10, 7, 2], [4, 8, 3, 5]),\n", + " ([9, 11], [1, 10, 7, 2], [4, 8, 5, 3]),\n", + " ([9, 11], [1, 10, 7, 2], [5, 3, 4, 8]),\n", + " ([9, 11], [1, 10, 7, 2], [5, 3, 8, 4]),\n", + " ([9, 11], [1, 10, 7, 2], [5, 4, 3, 8]),\n", + " ([9, 11], [1, 10, 7, 2], [5, 4, 8, 3]),\n", + " ([9, 11], [1, 10, 7, 2], [5, 8, 3, 4]),\n", + " ([9, 11], [1, 10, 7, 2], [5, 8, 4, 3]),\n", + " ([9, 11], [1, 10, 7, 2], [8, 3, 4, 5]),\n", + " ([9, 11], [1, 10, 7, 2], [8, 3, 5, 4]),\n", + " ([9, 11], [1, 10, 7, 2], [8, 4, 3, 5]),\n", + " ([9, 11], [1, 10, 7, 2], [8, 4, 5, 3]),\n", + " ([9, 11], [1, 10, 7, 2], [8, 5, 3, 4]),\n", + " ([9, 11], [1, 10, 7, 2], [8, 5, 4, 3]),\n", + " ([9, 11], [2, 1, 3, 4, 10], [5, 7, 8]),\n", + " ([9, 11], [2, 1, 3, 4, 10], [5, 8, 7]),\n", + " ([9, 11], [2, 1, 3, 4, 10], [7, 5, 8]),\n", + " ([9, 11], [2, 1, 3, 4, 10], [7, 8, 5]),\n", + " ([9, 11], [2, 1, 3, 4, 10], [8, 5, 7]),\n", + " ([9, 11], [2, 1, 3, 4, 10], [8, 7, 5]),\n", + " ([9, 11], [2, 1, 3, 10, 4], [5, 7, 8]),\n", + " ([9, 11], [2, 1, 3, 10, 4], [5, 8, 7]),\n", + " ([9, 11], [2, 1, 3, 10, 4], [7, 5, 8]),\n", + " ([9, 11], [2, 1, 3, 10, 4], [7, 8, 5]),\n", + " ([9, 11], [2, 1, 3, 10, 4], [8, 5, 7]),\n", + " ([9, 11], [2, 1, 3, 10, 4], [8, 7, 5]),\n", + " ([9, 11], [2, 1, 4, 3, 10], [5, 7, 8]),\n", + " ([9, 11], [2, 1, 4, 3, 10], [5, 8, 7]),\n", + " ([9, 11], [2, 1, 4, 3, 10], [7, 5, 8]),\n", + " ([9, 11], [2, 1, 4, 3, 10], [7, 8, 5]),\n", + " ([9, 11], [2, 1, 4, 3, 10], [8, 5, 7]),\n", + " ([9, 11], [2, 1, 4, 3, 10], [8, 7, 5]),\n", + " ([9, 11], [2, 1, 4, 5, 8], [3, 7, 10]),\n", + " ([9, 11], [2, 1, 4, 5, 8], [3, 10, 7]),\n", + " ([9, 11], [2, 1, 4, 5, 8], [7, 3, 10]),\n", + " ([9, 11], [2, 1, 4, 5, 8], [7, 10, 3]),\n", + " ([9, 11], [2, 1, 4, 5, 8], [10, 3, 7]),\n", + " ([9, 11], [2, 1, 4, 5, 8], [10, 7, 3]),\n", + " ([9, 11], [2, 1, 4, 8, 5], [3, 7, 10]),\n", + " ([9, 11], [2, 1, 4, 8, 5], [3, 10, 7]),\n", + " ([9, 11], [2, 1, 4, 8, 5], [7, 3, 10]),\n", + " ([9, 11], [2, 1, 4, 8, 5], [7, 10, 3]),\n", + " ([9, 11], [2, 1, 4, 8, 5], [10, 3, 7]),\n", + " ([9, 11], [2, 1, 4, 8, 5], [10, 7, 3]),\n", + " ([9, 11], [2, 1, 4, 10, 3], [5, 7, 8]),\n", + " ([9, 11], [2, 1, 4, 10, 3], [5, 8, 7]),\n", + " ([9, 11], [2, 1, 4, 10, 3], [7, 5, 8]),\n", + " ([9, 11], [2, 1, 4, 10, 3], [7, 8, 5]),\n", + " ([9, 11], [2, 1, 4, 10, 3], [8, 5, 7]),\n", + " ([9, 11], [2, 1, 4, 10, 3], [8, 7, 5]),\n", + " ([9, 11], [2, 1, 5, 4, 8], [3, 7, 10]),\n", + " ([9, 11], [2, 1, 5, 4, 8], [3, 10, 7]),\n", + " ([9, 11], [2, 1, 5, 4, 8], [7, 3, 10]),\n", + " ([9, 11], [2, 1, 5, 4, 8], [7, 10, 3]),\n", + " ([9, 11], [2, 1, 5, 4, 8], [10, 3, 7]),\n", + " ([9, 11], [2, 1, 5, 4, 8], [10, 7, 3]),\n", + " ([9, 11], [2, 1, 5, 8, 4], [3, 7, 10]),\n", + " ([9, 11], [2, 1, 5, 8, 4], [3, 10, 7]),\n", + " ([9, 11], [2, 1, 5, 8, 4], [7, 3, 10]),\n", + " ([9, 11], [2, 1, 5, 8, 4], [7, 10, 3]),\n", + " ([9, 11], [2, 1, 5, 8, 4], [10, 3, 7]),\n", + " ([9, 11], [2, 1, 5, 8, 4], [10, 7, 3]),\n", + " ([9, 11], [2, 1, 7, 10], [3, 4, 5, 8]),\n", + " ([9, 11], [2, 1, 7, 10], [3, 4, 8, 5]),\n", + " ([9, 11], [2, 1, 7, 10], [3, 5, 4, 8]),\n", + " ([9, 11], [2, 1, 7, 10], [3, 5, 8, 4]),\n", + " ([9, 11], [2, 1, 7, 10], [3, 8, 4, 5]),\n", + " ([9, 11], [2, 1, 7, 10], [3, 8, 5, 4]),\n", + " ([9, 11], [2, 1, 7, 10], [4, 3, 5, 8]),\n", + " ([9, 11], [2, 1, 7, 10], [4, 3, 8, 5]),\n", + " ([9, 11], [2, 1, 7, 10], [4, 5, 3, 8]),\n", + " ([9, 11], [2, 1, 7, 10], [4, 5, 8, 3]),\n", + " ([9, 11], [2, 1, 7, 10], [4, 8, 3, 5]),\n", + " ([9, 11], [2, 1, 7, 10], [4, 8, 5, 3]),\n", + " ([9, 11], [2, 1, 7, 10], [5, 3, 4, 8]),\n", + " ([9, 11], [2, 1, 7, 10], [5, 3, 8, 4]),\n", + " ([9, 11], [2, 1, 7, 10], [5, 4, 3, 8]),\n", + " ([9, 11], [2, 1, 7, 10], [5, 4, 8, 3]),\n", + " ([9, 11], [2, 1, 7, 10], [5, 8, 3, 4]),\n", + " ([9, 11], [2, 1, 7, 10], [5, 8, 4, 3]),\n", + " ([9, 11], [2, 1, 7, 10], [8, 3, 4, 5]),\n", + " ([9, 11], [2, 1, 7, 10], [8, 3, 5, 4]),\n", + " ([9, 11], [2, 1, 7, 10], [8, 4, 3, 5]),\n", + " ([9, 11], [2, 1, 7, 10], [8, 4, 5, 3]),\n", + " ([9, 11], [2, 1, 7, 10], [8, 5, 3, 4]),\n", + " ([9, 11], [2, 1, 7, 10], [8, 5, 4, 3]),\n", + " ([9, 11], [2, 1, 8, 4, 5], [3, 7, 10]),\n", + " ([9, 11], [2, 1, 8, 4, 5], [3, 10, 7]),\n", + " ([9, 11], [2, 1, 8, 4, 5], [7, 3, 10]),\n", + " ([9, 11], [2, 1, 8, 4, 5], [7, 10, 3]),\n", + " ([9, 11], [2, 1, 8, 4, 5], [10, 3, 7]),\n", + " ([9, 11], [2, 1, 8, 4, 5], [10, 7, 3]),\n", + " ([9, 11], [2, 1, 8, 5, 4], [3, 7, 10]),\n", + " ([9, 11], [2, 1, 8, 5, 4], [3, 10, 7]),\n", + " ([9, 11], [2, 1, 8, 5, 4], [7, 3, 10]),\n", + " ([9, 11], [2, 1, 8, 5, 4], [7, 10, 3]),\n", + " ([9, 11], [2, 1, 8, 5, 4], [10, 3, 7]),\n", + " ([9, 11], [2, 1, 8, 5, 4], [10, 7, 3]),\n", + " ([9, 11], [2, 1, 10, 3, 4], [5, 7, 8]),\n", + " ([9, 11], [2, 1, 10, 3, 4], [5, 8, 7]),\n", + " ([9, 11], [2, 1, 10, 3, 4], [7, 5, 8]),\n", + " ([9, 11], [2, 1, 10, 3, 4], [7, 8, 5]),\n", + " ([9, 11], [2, 1, 10, 3, 4], [8, 5, 7]),\n", + " ([9, 11], [2, 1, 10, 3, 4], [8, 7, 5]),\n", + " ([9, 11], [2, 1, 10, 4, 3], [5, 7, 8]),\n", + " ([9, 11], [2, 1, 10, 4, 3], [5, 8, 7]),\n", + " ([9, 11], [2, 1, 10, 4, 3], [7, 5, 8]),\n", + " ([9, 11], [2, 1, 10, 4, 3], [7, 8, 5]),\n", + " ([9, 11], [2, 1, 10, 4, 3], [8, 5, 7]),\n", + " ([9, 11], [2, 1, 10, 4, 3], [8, 7, 5]),\n", + " ([9, 11], [2, 1, 10, 7], [3, 4, 5, 8]),\n", + " ([9, 11], [2, 1, 10, 7], [3, 4, 8, 5]),\n", + " ([9, 11], [2, 1, 10, 7], [3, 5, 4, 8]),\n", + " ([9, 11], [2, 1, 10, 7], [3, 5, 8, 4]),\n", + " ([9, 11], [2, 1, 10, 7], [3, 8, 4, 5]),\n", + " ([9, 11], [2, 1, 10, 7], [3, 8, 5, 4]),\n", + " ([9, 11], [2, 1, 10, 7], [4, 3, 5, 8]),\n", + " ([9, 11], [2, 1, 10, 7], [4, 3, 8, 5]),\n", + " ([9, 11], [2, 1, 10, 7], [4, 5, 3, 8]),\n", + " ([9, 11], [2, 1, 10, 7], [4, 5, 8, 3]),\n", + " ([9, 11], [2, 1, 10, 7], [4, 8, 3, 5]),\n", + " ([9, 11], [2, 1, 10, 7], [4, 8, 5, 3]),\n", + " ([9, 11], [2, 1, 10, 7], [5, 3, 4, 8]),\n", + " ([9, 11], [2, 1, 10, 7], [5, 3, 8, 4]),\n", + " ([9, 11], [2, 1, 10, 7], [5, 4, 3, 8]),\n", + " ([9, 11], [2, 1, 10, 7], [5, 4, 8, 3]),\n", + " ([9, 11], [2, 1, 10, 7], [5, 8, 3, 4]),\n", + " ([9, 11], [2, 1, 10, 7], [5, 8, 4, 3]),\n", + " ([9, 11], [2, 1, 10, 7], [8, 3, 4, 5]),\n", + " ([9, 11], [2, 1, 10, 7], [8, 3, 5, 4]),\n", + " ([9, 11], [2, 1, 10, 7], [8, 4, 3, 5]),\n", + " ([9, 11], [2, 1, 10, 7], [8, 4, 5, 3]),\n", + " ([9, 11], [2, 1, 10, 7], [8, 5, 3, 4]),\n", + " ([9, 11], [2, 1, 10, 7], [8, 5, 4, 3]),\n", + " ([9, 11], [2, 3, 1, 4, 10], [5, 7, 8]),\n", + " ([9, 11], [2, 3, 1, 4, 10], [5, 8, 7]),\n", + " ([9, 11], [2, 3, 1, 4, 10], [7, 5, 8]),\n", + " ([9, 11], [2, 3, 1, 4, 10], [7, 8, 5]),\n", + " ([9, 11], [2, 3, 1, 4, 10], [8, 5, 7]),\n", + " ([9, 11], [2, 3, 1, 4, 10], [8, 7, 5]),\n", + " ([9, 11], [2, 3, 1, 10, 4], [5, 7, 8]),\n", + " ([9, 11], [2, 3, 1, 10, 4], [5, 8, 7]),\n", + " ([9, 11], [2, 3, 1, 10, 4], [7, 5, 8]),\n", + " ([9, 11], [2, 3, 1, 10, 4], [7, 8, 5]),\n", + " ([9, 11], [2, 3, 1, 10, 4], [8, 5, 7]),\n", + " ([9, 11], [2, 3, 1, 10, 4], [8, 7, 5]),\n", + " ([9, 11], [2, 3, 4, 1, 10], [5, 7, 8]),\n", + " ([9, 11], [2, 3, 4, 1, 10], [5, 8, 7]),\n", + " ([9, 11], [2, 3, 4, 1, 10], [7, 5, 8]),\n", + " ([9, 11], [2, 3, 4, 1, 10], [7, 8, 5]),\n", + " ...]" + ] + }, + "execution_count": 18, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "#valids = []\n", + "#for p in itertools.permutations(presents):\n", + "# totals = itertools.accumulate(p)\n", + "# pairs = zip(p, totals)\n", + "# g1, g2, g3 = split(pairs)\n", + "# if valid(g1, g2, g3):\n", + "# valids += [(g1, g2, g3)]\n", + "#valids" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "def subsets_with_sum(items, dsum):\n", + " subsets = set()\n", + " for i in range(len(items)):\n", + " subsets |= set(frozenset(s) for s in itertools.combinations(items, i)\n", + " if sum(s) == dsum)\n", + " return subsets" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "data": { + "text/plain": [ + "[(1, 2, 17), (2, 5, 13)]" + ] + }, + "execution_count": 5, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "list(filter(lambda s: sum(s) == 20, (s for s in itertools.combinations(presents, 3))))" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "data": { + "text/plain": [ + "429102" + ] + }, + "execution_count": 6, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "subsets = subsets_with_sum(presents, group_weight)\n", + "len(subsets)" + ] + }, + { + "cell_type": "code", + "execution_count": 23, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "data": { + "text/plain": [ + "6" + ] + }, + "execution_count": 23, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "min(len(s) for s in subsets)" + ] + }, + { + "cell_type": "code", + "execution_count": 24, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "data": { + "text/plain": [ + "True" + ] + }, + "execution_count": 24, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "g1_size = min(len(s) for s in subsets)\n", + "g1_candidates = [s for s in subsets if len(s) == 6]\n", + "g23_candidates = [s for s in subsets if len(s) > 6]\n", + "len(subsets) == (len(g1_candidates) + len(g23_candidates))" + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "data": { + "text/plain": [ + "248" + ] + }, + "execution_count": 25, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "len(g1_candidates)" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "data": { + "text/plain": [ + "[(frozenset({43, 79, 89, 97, 101, 103}),\n", + " (frozenset({2, 7, 23, 43, 61, 71, 89, 107, 109}),\n", + " frozenset({2, 7, 23, 53, 61, 71, 79, 107, 109}))),\n", + " (frozenset({43, 79, 89, 97, 101, 103}),\n", + " (frozenset({2, 7, 23, 43, 61, 71, 89, 107, 109}),\n", + " frozenset({1, 5, 13, 19, 29, 31, 43, 59, 67, 73, 83, 89}))),\n", + " (frozenset({43, 79, 89, 97, 101, 103}),\n", + " (frozenset({2, 7, 23, 53, 61, 71, 79, 107, 109}),\n", + " frozenset({1, 5, 13, 19, 29, 31, 43, 59, 67, 73, 83, 89}))),\n", + " (frozenset({67, 73, 79, 89, 101, 103}),\n", + " (frozenset({2, 7, 23, 43, 61, 71, 89, 107, 109}),\n", + " frozenset({2, 7, 23, 53, 61, 71, 79, 107, 109}))),\n", + " (frozenset({67, 73, 79, 89, 101, 103}),\n", + " (frozenset({2, 7, 23, 43, 61, 71, 89, 107, 109}),\n", + " frozenset({1, 5, 13, 19, 29, 31, 43, 59, 67, 73, 83, 89}))),\n", + " (frozenset({67, 73, 79, 89, 101, 103}),\n", + " (frozenset({2, 7, 23, 53, 61, 71, 79, 107, 109}),\n", + " frozenset({1, 5, 13, 19, 29, 31, 43, 59, 67, 73, 83, 89})))]" + ] + }, + "execution_count": 10, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "list(itertools.product(g1_candidates[:2], \n", + " itertools.combinations(g23_candidates[:3], 2)))" + ] + }, + { + "cell_type": "code", + "execution_count": 33, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "def solutions(g1s, g23s):\n", + " solutions = []\n", + " for g1 in g1s:\n", + " vg23s = [g for g in g23s if not g1 & g]\n", + " if any(g23 for g23 in itertools.combinations(vg23s, 2)\n", + " if not g23[0] & g23[1]):\n", + " solutions += [g1]\n", + " return solutions" + ] + }, + { + "cell_type": "code", + "execution_count": 30, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "data": { + "text/plain": [ + "23901" + ] + }, + "execution_count": 30, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "vg23s = [g for g in g23_candidates if not g1_candidates[0] & g]\n", + "len(vg23s)" + ] + }, + { + "cell_type": "code", + "execution_count": 34, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "data": { + "text/plain": [ + "[frozenset({43, 79, 89, 97, 101, 103}),\n", + " frozenset({67, 73, 79, 89, 101, 103}),\n", + " frozenset({17, 73, 97, 103, 109, 113}),\n", + " frozenset({43, 67, 83, 103, 107, 109}),\n", + " frozenset({19, 71, 97, 103, 109, 113}),\n", + " frozenset({19, 61, 103, 107, 109, 113}),\n", + " frozenset({59, 61, 73, 97, 109, 113}),\n", + " frozenset({53, 59, 83, 97, 107, 113}),\n", + " frozenset({23, 83, 89, 97, 107, 113}),\n", + " frozenset({53, 73, 83, 89, 101, 113}),\n", + " frozenset({41, 59, 89, 103, 107, 113}),\n", + " frozenset({41, 53, 89, 107, 109, 113}),\n", + " frozenset({41, 61, 97, 101, 103, 109}),\n", + " frozenset({61, 73, 79, 89, 97, 113}),\n", + " frozenset({13, 89, 97, 101, 103, 109}),\n", + " frozenset({53, 67, 73, 97, 109, 113}),\n", + " frozenset({19, 73, 97, 103, 107, 113}),\n", + " frozenset({43, 73, 83, 97, 107, 109}),\n", + " frozenset({5, 83, 101, 103, 107, 113}),\n", + " frozenset({61, 79, 83, 89, 97, 103}),\n", + " frozenset({43, 59, 89, 101, 107, 113}),\n", + " frozenset({53, 59, 79, 101, 107, 113}),\n", + " frozenset({23, 73, 97, 103, 107, 109}),\n", + " frozenset({37, 61, 89, 103, 109, 113}),\n", + " frozenset({37, 53, 97, 103, 109, 113}),\n", + " frozenset({41, 79, 83, 97, 103, 109}),\n", + " frozenset({53, 61, 89, 97, 103, 109}),\n", + " frozenset({67, 71, 73, 97, 101, 103}),\n", + " frozenset({43, 73, 83, 97, 103, 113}),\n", + " frozenset({41, 61, 89, 101, 107, 113}),\n", + " frozenset({59, 61, 71, 101, 107, 113}),\n", + " frozenset({13, 73, 97, 107, 109, 113}),\n", + " frozenset({37, 73, 89, 97, 107, 109}),\n", + " frozenset({5, 89, 97, 101, 107, 113}),\n", + " frozenset({43, 73, 79, 97, 107, 113}),\n", + " frozenset({29, 79, 83, 101, 107, 113}),\n", + " frozenset({43, 67, 89, 101, 103, 109}),\n", + " frozenset({53, 67, 79, 101, 103, 109}),\n", + " frozenset({29, 73, 89, 101, 107, 113}),\n", + " frozenset({53, 59, 89, 101, 103, 107}),\n", + " frozenset({43, 73, 83, 101, 103, 109}),\n", + " frozenset({59, 71, 73, 89, 107, 113}),\n", + " frozenset({43, 61, 89, 103, 107, 109}),\n", + " frozenset({53, 61, 79, 103, 107, 109}),\n", + " frozenset({61, 71, 83, 89, 101, 107}),\n", + " frozenset({59, 73, 79, 89, 103, 109}),\n", + " frozenset({29, 83, 89, 101, 103, 107}),\n", + " frozenset({41, 73, 79, 103, 107, 109}),\n", + " frozenset({67, 73, 79, 83, 103, 107}),\n", + " frozenset({61, 67, 71, 101, 103, 109}),\n", + " frozenset({61, 71, 73, 97, 103, 107}),\n", + " frozenset({71, 73, 79, 89, 97, 103}),\n", + " frozenset({53, 59, 83, 101, 107, 109}),\n", + " frozenset({23, 79, 97, 101, 103, 109}),\n", + " frozenset({61, 67, 79, 89, 103, 113}),\n", + " frozenset({59, 71, 83, 89, 97, 113}),\n", + " frozenset({59, 61, 79, 97, 103, 113}),\n", + " frozenset({43, 67, 73, 107, 109, 113}),\n", + " frozenset({59, 71, 79, 89, 101, 113}),\n", + " frozenset({53, 71, 79, 89, 107, 113}),\n", + " frozenset({61, 71, 73, 97, 101, 109}),\n", + " frozenset({43, 71, 79, 97, 109, 113}),\n", + " frozenset({43, 71, 79, 103, 107, 109}),\n", + " frozenset({37, 67, 89, 97, 109, 113}),\n", + " frozenset({59, 71, 79, 83, 107, 113}),\n", + " frozenset({43, 73, 79, 101, 107, 109}),\n", + " frozenset({31, 61, 101, 103, 107, 109}),\n", + " frozenset({31, 73, 83, 103, 109, 113}),\n", + " frozenset({59, 67, 73, 97, 107, 109}),\n", + " frozenset({61, 73, 79, 83, 103, 113}),\n", + " frozenset({23, 59, 101, 107, 109, 113}),\n", + " frozenset({37, 73, 79, 103, 107, 113}),\n", + " frozenset({53, 59, 83, 101, 103, 113}),\n", + " frozenset({43, 53, 97, 103, 107, 109}),\n", + " frozenset({53, 71, 83, 89, 103, 113}),\n", + " frozenset({43, 71, 73, 103, 109, 113}),\n", + " frozenset({43, 79, 83, 97, 101, 109}),\n", + " frozenset({17, 71, 101, 103, 107, 113}),\n", + " frozenset({61, 73, 79, 89, 103, 107}),\n", + " frozenset({53, 59, 89, 97, 101, 113}),\n", + " frozenset({31, 79, 89, 97, 107, 109}),\n", + " frozenset({1, 89, 97, 103, 109, 113}),\n", + " frozenset({59, 71, 73, 97, 103, 109}),\n", + " frozenset({31, 83, 89, 97, 103, 109}),\n", + " frozenset({13, 79, 97, 101, 109, 113}),\n", + " frozenset({37, 79, 89, 97, 101, 109}),\n", + " frozenset({59, 71, 83, 89, 103, 107}),\n", + " frozenset({41, 67, 79, 103, 109, 113}),\n", + " frozenset({19, 73, 101, 103, 107, 109}),\n", + " frozenset({59, 61, 79, 101, 103, 109}),\n", + " frozenset({41, 67, 83, 101, 107, 113}),\n", + " frozenset({37, 67, 79, 107, 109, 113}),\n", + " frozenset({29, 59, 101, 103, 107, 113}),\n", + " frozenset({17, 83, 89, 101, 109, 113}),\n", + " frozenset({41, 73, 89, 97, 103, 109}),\n", + " frozenset({67, 71, 79, 83, 103, 109}),\n", + " frozenset({53, 71, 83, 97, 101, 107}),\n", + " frozenset({13, 73, 101, 103, 109, 113}),\n", + " frozenset({37, 73, 89, 101, 103, 109}),\n", + " frozenset({31, 73, 89, 97, 109, 113}),\n", + " frozenset({31, 67, 97, 101, 103, 113}),\n", + " frozenset({19, 67, 97, 107, 109, 113}),\n", + " frozenset({7, 89, 97, 103, 107, 109}),\n", + " frozenset({19, 79, 97, 101, 107, 109}),\n", + " frozenset({67, 73, 79, 83, 97, 113}),\n", + " frozenset({43, 61, 83, 103, 109, 113}),\n", + " frozenset({37, 71, 79, 103, 109, 113}),\n", + " frozenset({23, 71, 89, 107, 109, 113}),\n", + " frozenset({23, 83, 89, 101, 103, 113}),\n", + " frozenset({31, 79, 83, 97, 109, 113}),\n", + " frozenset({31, 61, 97, 101, 109, 113}),\n", + " frozenset({29, 71, 89, 101, 109, 113}),\n", + " frozenset({43, 67, 79, 103, 107, 113}),\n", + " frozenset({1, 79, 103, 107, 109, 113}),\n", + " frozenset({29, 61, 97, 103, 109, 113}),\n", + " frozenset({7, 73, 103, 107, 109, 113}),\n", + " frozenset({61, 73, 79, 83, 107, 109}),\n", + " frozenset({53, 67, 73, 103, 107, 109}),\n", + " frozenset({41, 71, 79, 101, 107, 113}),\n", + " frozenset({61, 67, 71, 97, 103, 113}),\n", + " frozenset({43, 73, 79, 101, 103, 113}),\n", + " frozenset({43, 73, 89, 97, 101, 109}),\n", + " frozenset({53, 73, 79, 97, 101, 109}),\n", + " frozenset({43, 67, 83, 97, 109, 113}),\n", + " frozenset({13, 83, 97, 103, 107, 109}),\n", + " frozenset({31, 73, 89, 103, 107, 109}),\n", + " frozenset({61, 67, 83, 89, 103, 109}),\n", + " frozenset({59, 71, 83, 89, 101, 109}),\n", + " frozenset({53, 71, 83, 89, 107, 109}),\n", + " frozenset({3, 79, 101, 107, 109, 113}),\n", + " frozenset({61, 71, 79, 97, 101, 103}),\n", + " frozenset({59, 73, 79, 97, 101, 103}),\n", + " frozenset({7, 79, 97, 107, 109, 113}),\n", + " frozenset({61, 67, 79, 89, 107, 109}),\n", + " frozenset({43, 67, 89, 97, 107, 109}),\n", + " frozenset({53, 67, 79, 97, 107, 109}),\n", + " frozenset({61, 67, 73, 97, 101, 113}),\n", + " frozenset({37, 73, 83, 103, 107, 109}),\n", + " frozenset({43, 73, 89, 97, 103, 107}),\n", + " frozenset({53, 73, 79, 97, 103, 107}),\n", + " frozenset({37, 73, 83, 97, 109, 113}),\n", + " frozenset({37, 67, 97, 101, 103, 107}),\n", + " frozenset({13, 79, 97, 103, 107, 113}),\n", + " frozenset({37, 79, 89, 97, 103, 107}),\n", + " frozenset({31, 67, 89, 103, 109, 113}),\n", + " frozenset({53, 67, 83, 97, 103, 109}),\n", + " frozenset({41, 71, 89, 97, 101, 113}),\n", + " frozenset({67, 71, 73, 79, 109, 113}),\n", + " frozenset({37, 79, 83, 97, 107, 109}),\n", + " frozenset({13, 67, 103, 107, 109, 113}),\n", + " frozenset({37, 67, 89, 103, 107, 109}),\n", + " frozenset({3, 83, 97, 107, 109, 113}),\n", + " frozenset({67, 73, 79, 83, 101, 109}),\n", + " frozenset({41, 73, 79, 97, 109, 113}),\n", + " frozenset({37, 71, 83, 101, 107, 113}),\n", + " frozenset({59, 61, 67, 103, 109, 113}),\n", + " frozenset({37, 79, 83, 97, 103, 113}),\n", + " frozenset({41, 79, 83, 89, 107, 113}),\n", + " frozenset({41, 53, 97, 101, 107, 113}),\n", + " frozenset({37, 73, 89, 97, 103, 113}),\n", + " frozenset({23, 67, 97, 103, 109, 113}),\n", + " frozenset({23, 71, 97, 101, 107, 113}),\n", + " frozenset({3, 89, 97, 103, 107, 113}),\n", + " frozenset({19, 79, 89, 103, 109, 113}),\n", + " frozenset({37, 59, 97, 103, 107, 109}),\n", + " frozenset({19, 83, 97, 101, 103, 109}),\n", + " frozenset({61, 67, 73, 89, 109, 113}),\n", + " frozenset({7, 79, 101, 103, 109, 113}),\n", + " frozenset({17, 79, 97, 103, 107, 109}),\n", + " frozenset({41, 71, 89, 101, 103, 107}),\n", + " frozenset({31, 79, 89, 101, 103, 109}),\n", + " frozenset({29, 53, 101, 107, 109, 113}),\n", + " frozenset({61, 73, 83, 89, 97, 109}),\n", + " frozenset({43, 67, 89, 97, 103, 113}),\n", + " frozenset({53, 67, 79, 97, 103, 113}),\n", + " frozenset({43, 71, 89, 97, 103, 109}),\n", + " frozenset({53, 71, 79, 97, 103, 109}),\n", + " frozenset({53, 59, 71, 107, 109, 113}),\n", + " frozenset({67, 71, 79, 89, 97, 109}),\n", + " frozenset({53, 67, 83, 89, 107, 113}),\n", + " frozenset({59, 67, 83, 89, 101, 113}),\n", + " frozenset({31, 59, 97, 103, 109, 113}),\n", + " frozenset({59, 73, 83, 89, 101, 107}),\n", + " frozenset({59, 61, 83, 97, 103, 109}),\n", + " frozenset({41, 71, 83, 101, 107, 109}),\n", + " frozenset({3, 89, 97, 101, 109, 113}),\n", + " frozenset({31, 73, 79, 107, 109, 113}),\n", + " frozenset({61, 67, 79, 83, 109, 113}),\n", + " frozenset({17, 83, 89, 103, 107, 113}),\n", + " frozenset({71, 73, 79, 83, 97, 109}),\n", + " frozenset({43, 59, 97, 101, 103, 109}),\n", + " frozenset({41, 71, 83, 101, 103, 113}),\n", + " frozenset({59, 61, 83, 89, 107, 113}),\n", + " frozenset({53, 67, 71, 101, 107, 113}),\n", + " frozenset({61, 67, 71, 97, 107, 109}),\n", + " frozenset({59, 67, 79, 97, 103, 107}),\n", + " frozenset({3, 83, 101, 103, 109, 113}),\n", + " frozenset({23, 79, 89, 101, 107, 113}),\n", + " frozenset({31, 79, 83, 103, 107, 109}),\n", + " frozenset({61, 67, 83, 97, 101, 103}),\n", + " frozenset({53, 61, 73, 103, 109, 113}),\n", + " frozenset({7, 83, 97, 103, 109, 113}),\n", + " frozenset({13, 79, 101, 103, 107, 109}),\n", + " frozenset({29, 83, 89, 97, 101, 113}),\n", + " frozenset({31, 71, 89, 101, 107, 113}),\n", + " frozenset({19, 79, 97, 101, 103, 113}),\n", + " frozenset({61, 67, 73, 101, 103, 107}),\n", + " frozenset({31, 67, 97, 101, 107, 109}),\n", + " frozenset({41, 71, 83, 97, 107, 113}),\n", + " frozenset({19, 67, 101, 103, 109, 113}),\n", + " frozenset({43, 61, 89, 97, 109, 113}),\n", + " frozenset({53, 61, 79, 97, 109, 113}),\n", + " frozenset({37, 61, 97, 101, 107, 109}),\n", + " frozenset({31, 73, 97, 101, 103, 107}),\n", + " frozenset({29, 73, 97, 101, 103, 109}),\n", + " frozenset({31, 61, 97, 103, 107, 113}),\n", + " frozenset({61, 67, 79, 97, 101, 107}),\n", + " frozenset({61, 73, 79, 89, 101, 109}),\n", + " frozenset({67, 71, 73, 89, 103, 109}),\n", + " frozenset({41, 59, 89, 101, 109, 113}),\n", + " frozenset({59, 67, 73, 101, 103, 109}),\n", + " frozenset({43, 67, 79, 101, 109, 113}),\n", + " frozenset({67, 73, 79, 89, 97, 107}),\n", + " frozenset({43, 79, 83, 97, 103, 107}),\n", + " frozenset({59, 61, 73, 103, 107, 109}),\n", + " frozenset({43, 61, 97, 101, 103, 107}),\n", + " frozenset({61, 71, 79, 89, 103, 109}),\n", + " frozenset({59, 67, 73, 97, 103, 113}),\n", + " frozenset({43, 61, 79, 107, 109, 113}),\n", + " frozenset({59, 67, 79, 97, 101, 109}),\n", + " frozenset({29, 71, 89, 103, 107, 113}),\n", + " frozenset({31, 79, 89, 97, 103, 113}),\n", + " frozenset({3, 89, 101, 103, 107, 109}),\n", + " frozenset({19, 83, 89, 101, 107, 113}),\n", + " frozenset({19, 73, 97, 101, 109, 113}),\n", + " frozenset({37, 43, 103, 107, 109, 113}),\n", + " frozenset({29, 71, 83, 107, 109, 113}),\n", + " frozenset({37, 73, 79, 101, 109, 113}),\n", + " frozenset({59, 61, 79, 97, 107, 109}),\n", + " frozenset({53, 79, 83, 89, 101, 107}),\n", + " frozenset({41, 59, 83, 107, 109, 113}),\n", + " frozenset({31, 71, 97, 101, 103, 109}),\n", + " frozenset({37, 67, 83, 103, 109, 113}),\n", + " frozenset({67, 73, 83, 89, 97, 103}),\n", + " frozenset({37, 79, 83, 101, 103, 109}),\n", + " frozenset({29, 67, 97, 103, 107, 109}),\n", + " frozenset({37, 61, 97, 101, 103, 113}),\n", + " frozenset({23, 83, 89, 101, 107, 109})]" + ] + }, + "execution_count": 34, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "valid_g1s = solutions(g1_candidates, g23_candidates)\n", + "valid_g1s" + ] + }, + { + "cell_type": "code", + "execution_count": 35, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "data": { + "text/plain": [ + "10723906903" + ] + }, + "execution_count": 35, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "best_qe = min(prod(s) for s in valid_g1s) \n", + "best_qe" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#Part 2" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "data": { + "text/plain": [ + "384" + ] + }, + "execution_count": 18, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "group_weight2 = sum(presents) // 4\n", + "group_weight2" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "data": { + "text/plain": [ + "108230" + ] + }, + "execution_count": 20, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "subsets2 = subsets_with_sum(presents, group_weight2)\n", + "len(subsets2)" + ] + }, + { + "cell_type": "code", + "execution_count": 37, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "data": { + "text/plain": [ + "(4, 18)" + ] + }, + "execution_count": 37, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "g1_size = min(len(s) for s in subsets2)\n", + "g1_candidates = [s for s in subsets2 if len(s) == g1_size]\n", + "g234_candidates = [s for s in subsets2 if len(s) > g1_size]\n", + "g1_size, len(g1_candidates)" + ] + }, + { + "cell_type": "code", + "execution_count": 38, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "def solutions2(g1s, g234s):\n", + " solutions = []\n", + " for g1 in g1s:\n", + " vg234s = [g for g in g234s if not g1 & g]\n", + " if any(g234 for g234 in itertools.combinations(vg234s, 3)\n", + " if not g234[0] & g234[1]\n", + " if not g234[0] & g234[2]\n", + " if not g234[1] & g234[2]):\n", + " solutions += [g1]\n", + " return solutions" + ] + }, + { + "cell_type": "code", + "execution_count": 39, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "data": { + "text/plain": [ + "[frozenset({79, 83, 109, 113}),\n", + " frozenset({67, 101, 107, 109}),\n", + " frozenset({79, 97, 101, 107}),\n", + " frozenset({71, 101, 103, 109}),\n", + " frozenset({71, 97, 107, 109}),\n", + " frozenset({83, 89, 103, 109}),\n", + " frozenset({61, 103, 107, 113}),\n", + " frozenset({73, 89, 109, 113}),\n", + " frozenset({83, 97, 101, 103}),\n", + " frozenset({73, 97, 101, 113}),\n", + " frozenset({67, 97, 107, 113}),\n", + " frozenset({71, 97, 103, 113}),\n", + " frozenset({67, 101, 103, 113}),\n", + " frozenset({73, 101, 103, 107}),\n", + " frozenset({59, 103, 109, 113}),\n", + " frozenset({79, 89, 103, 113}),\n", + " frozenset({61, 101, 109, 113}),\n", + " frozenset({79, 89, 107, 109})]" + ] + }, + "execution_count": 39, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "valid_g1s = solutions2(g1_candidates, g234_candidates)\n", + "valid_g1s" + ] + }, + { + "cell_type": "code", + "execution_count": 40, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "data": { + "text/plain": [ + "74850409" + ] + }, + "execution_count": 40, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "best_qe = min(prod(s) for s in valid_g1s) \n", + "best_qe" + ] + }, + { + "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 +} diff --git a/advent24.txt b/advent24.txt new file mode 100644 index 0000000..b2b1dff --- /dev/null +++ b/advent24.txt @@ -0,0 +1,29 @@ +1 +2 +3 +5 +7 +13 +17 +19 +23 +29 +31 +37 +41 +43 +53 +59 +61 +67 +71 +73 +79 +83 +89 +97 +101 +103 +107 +109 +113 \ No newline at end of file -- 2.34.1