Skip to content

Instantly share code, notes, and snippets.

@Detry322
Last active October 3, 2017 01:32
Show Gist options
  • Save Detry322/3a1bcec061eb15936271bb9f2942e96b to your computer and use it in GitHub Desktop.
Save Detry322/3a1bcec061eb15936271bb9f2942e96b to your computer and use it in GitHub Desktop.
Code
values = [(num, count) for num in range(2, 8) for count in range(2, 7)]
def p(v, f):
vv = sorted(v, key=f)
for (num, count) in vv:
print ' '.join([str(num)]*count)
f1 = lambda (num, count): num + count
f2 = lambda (num, count): num + 2*count
f3 = lambda (num, count): 2*num + count
6: 2 2
7: 2 2 2
8: 2 2 2 2
8: 3 3
9: 2 2 2 2 2
9: 3 3 3
10: 2 2 2 2 2 2
10: 3 3 3 3
10: 4 4
11: 3 3 3 3 3
11: 4 4 4
12: 3 3 3 3 3 3
12: 4 4 4 4
12: 5 5
13: 4 4 4 4 4
13: 5 5 5
14: 4 4 4 4 4 4
14: 5 5 5 5
14: 6 6
15: 5 5 5 5 5
15: 6 6 6
16: 5 5 5 5 5 5
16: 6 6 6 6
16: 7 7
17: 6 6 6 6 6
17: 7 7 7
18: 6 6 6 6 6 6
18: 7 7 7 7
19: 7 7 7 7 7
20: 7 7 7 7 7 7
6: 2 2
7: 3 3
8: 2 2 2
8: 4 4
9: 3 3 3
9: 5 5
10: 2 2 2 2
10: 4 4 4
10: 6 6
11: 3 3 3 3
11: 5 5 5
11: 7 7
12: 2 2 2 2 2
12: 4 4 4 4
12: 6 6 6
13: 3 3 3 3 3
13: 5 5 5 5
13: 7 7 7
14: 2 2 2 2 2 2
14: 4 4 4 4 4
14: 6 6 6 6
15: 3 3 3 3 3 3
15: 5 5 5 5 5
15: 7 7 7 7
16: 4 4 4 4 4 4
16: 6 6 6 6 6
17: 5 5 5 5 5 5
17: 7 7 7 7 7
18: 6 6 6 6 6 6
19: 7 7 7 7 7 7
4: 2 2
5: 2 2 2
5: 3 3
6: 2 2 2 2
6: 3 3 3
6: 4 4
7: 2 2 2 2 2
7: 3 3 3 3
7: 4 4 4
7: 5 5
8: 2 2 2 2 2 2
8: 3 3 3 3 3
8: 4 4 4 4
8: 5 5 5
8: 6 6
9: 3 3 3 3 3 3
9: 4 4 4 4 4
9: 5 5 5 5
9: 6 6 6
9: 7 7
10: 4 4 4 4 4 4
10: 5 5 5 5 5
10: 6 6 6 6
10: 7 7 7
11: 5 5 5 5 5 5
11: 6 6 6 6 6
11: 7 7 7 7
12: 6 6 6 6 6 6
12: 7 7 7 7 7
13: 7 7 7 7 7 7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment