結果 : algorithm and logic formulation