1. 程式人生 > >HDU6185 Covering【矩陣快速冪】

HDU6185 Covering【矩陣快速冪】

Bob's school has a big playground, boys and girls always play games here after school.

To protect boys and girls from getting hurt when playing happily on the playground, rich boy Bob decided to cover the playground using his carpets.

Meanwhile, Bob is a mean boy, so he acquired that his carpets can not overlap one cell twice or more.

He has infinite carpets with sizes of1×2and2×1, and the size of the playground is4
×n
.

Can you tell Bob the total number of schemes where the carpets can cover the playground completely without overlapping?