1. 程式人生 > >【倍增】T-shirt @2018acm徐州邀請賽 I

【倍增】T-shirt @2018acm徐州邀請賽 I

JSZKC is going to spend his vacation! 
His vacation has N days. Each day, he can choose a T-shirt to wear. Obviously, he doesn’t want to wear a singer color T-shirt since others will consider he has worn one T-shirt all the time. 
To avoid this problem, he has M different T-shirt with different color. If he wears A color T-shirt this day and B color T-shirt the next day, then he will get the pleasure of f[A][B].(notice: He is able to wear one T-shirt in two continuous days but may get a low pleasure) 

Please calculate the max pleasure he can get.