poj solutions using c++