Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from itertools import *
- def ways_to_make_sum(N,k,m):
- l=[1]+[0]*k*m
- for _ in range(k):
- new_l=[sum(l[:i][-m:]) for i in range(1+k*m)]
- l=new_l
- if len(l)<=N:return 0
- return l[N]
- for i in permutations(range(1,50),6):
- s=sum(i)
- p=reduce(int.__mul__,i)
- c=ways_to_make_sum(s,6,49)
- if p/s==c and s*c>2*10^6:print i
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement