solve 1799 polygon perimeter