Forked #10 in order to optimize and try and get the products instead of sum >B^D