In recent time, Hua Nong brothers' bamboo rat videos go viral and they have been Internet celebrities ever since then. As an investor, Boss Niu decides to build a breeding ba
se to culture bamboo rats. The breeding base can be described as a $n\times m$ matrix, each cell of which contains a bamboo rat. Generally, every bamboo rat has a weight $w$.
Today, Brother Wang comes to visit Boss Niu. Thus Boss Niu will select exactly k pretty bamboo rats to roast. In order not to make breeding base look so empty, Boss Niu can't select two adjacent bamboo rats. That is to say, if there are two bamboo rats sharing the same edge, he just can select one at most.
Among k bamboo rats he selects, Boss Niu wants the weight of the lightest bamboo rat maximum. Please tell him the maximum weight of the lightest one.