report VI VI EN
Register | Login
  • HOME
  • PROBLEMSET
  • ROADMAP
  • COMPETITION
  • TOPIC
  • RANKING
  • GUIDE
  • MASHUP
  • ABOUT
  • CONTACT
  • Problem
  • Submit
  • Results
Chess - MarisaOJ: Marisa Online Judge

Chess

Time limit: 1000 ms
Memory limit: 256 MB
Count the number of ways to place knights on a chessboard of size $n \times m$ such that they do not attack each other. ### Input - A single line contains two integers $n,m$. ### Output - Print the number of way modulo $10^9+7$. ### Constraints - $ 1 \le n \le 10^9, 1 \le m \le 4$. ### Example Input: ``` 2 2 ``` Output: ``` 16 ```
Matrix multiplication
Fibonacci 2
Martian language 2
Hakurei Shrine 2
Number sequence
Chess
Topic
Dynamic Programming
Matrix
Bitmasks
Rating 1800
Solution (1) Solution