» Project Code 1.0 - MATE - Template for Chess Problems -- C++

Problem Link: CodeChef: Practical coding for everyone
How to solve this? I thought of Bruteforce, is it?
How to implement these problems efficiently?
Can someone attach a template for better implementation of these(chess) problems