use c solve problem