Create mincost.cpp