Alcatraz
시간 제한1초메모리 제한2048 MB
가로 w, 세로 h인 영역에서 감시 범위가 원인 경비병들을 피해 (0,0)에서 (w,h)까지 이동할 수 있는지 판정한다.
문제
After breaking into the database of the TU Delft and releasing sensitive information to the public, Anton the cyber criminal got the CIA looking for him. After being arrested, Anton was transported to the heavily guarded prison Alcatraz. Disabling the security system was a piece of cake, so he could easily get outside of the prison walls. However, behind these walls a number of guards are positioned and they will immediately sound the alarm if they spot any escaped prisoner.

To escape, Anton needs to cross a field with width and height that is being guarded by guards, without being spotted by any of the guards. He starts at position and can only escape if he reaches position without being spotted. Even if the criminal is only spotted at position the guards will sound the alarm and he will be captured. Some guards have better views that others, so every guard has an associated range of view . If the distance between the guard and the escaped prisoner is or less, the guard will sound the alarm and the prisoner will return to his cell.
Your job is now to find out whether Anton can escape Alcatraz or if he cannot escape without being spotted. If he can escape, output ESCAPE. Otherwise output NO ESCAPE.
입력
-
A line with 3 integers:
- : the width of the area .
- : the height of the area .
- : the number of guards .
-
lines with 3 integers each:
- : the -coordinate of the guard .
- : the -coordinate of the guard .
- : the range of the guard's vision .
출력
ESCAPE if the prisoner can escape Alcatraz, NO ESCAPE otherwise.