chiark / gitweb /
Fill in a lot of the web page.
[matchsticks-search.git] / partition.py
index b539d32ec38b8d97c902c2872109d0428aa18179..4e2766d253c9b54bddf71fd23c5fb334c298e735 100755 (executable)
@@ -145,10 +145,10 @@ def search_and_report(n, m):
     d = best[1]
     print "%d into %d best min fragment found: %s" % (n, m, best[0])
     print "  Cut up %d sticks of length %d like this:" % (n, m)
-    for row, count in sorted(best[2].items(), reverse=True):
+    for row, count in sorted(best[3].items(), reverse=True):
         print "    %d x (%s)" % (count, " + ".join([str(Fraction(k,d)) for k in row]))
     print "  Reassemble as %d sticks of length %d like this:" % (m, n)
-    for col, count in sorted(best[3].items(), reverse=True):
+    for col, count in sorted(best[2].items(), reverse=True):
         print "    %d x (%s)" % (count, " + ".join([str(Fraction(k,d)) for k in col]))
 
 def main():