Update solve.cpp