algospot fortress.cpp