Code Jam 2008, Problem A. Minimum Scalar Product