A submarine measurement of the Newtonian gravitational constant