#includeusingnamespacestd;constintM=3;constintN=5;intAva[M]={3,3,2};intAll[N][M]={{0,1,0},{2,0,0},{3,0,2},{2,1,1},{0,0,2}};intNee[N][M]={{7,4,3},{1,2,2},{6,0,0},{0,1,1},{4,3,1}};intwork[N+1][M]={{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}};intflag[N][2]={{0,0},{0,0},{0,0},{0,0},{0,0}};