結果 : write an algorithm for big m method