finding diamond riches formula qcpp