write PNRP.cpp