It is a well-knowen question on Combination Math, and 'Hook' is a term of chess. You can query generic exclusive-inclusive function,and find the explain of 'Hook'.
--※ 交大資管心靈小站(bbs.iim.nctu.edu.tw) ◆ From: 140.123.2.31