GCJ minimum scalar product solution