adding solution for NAJPF in C++. Time 0.48, Memory=6784