P2694 Catching Coins
Description
In a 2D coordinate system, there are $n$ coins, numbered $0\sim n-1$. Initially, the $i$-th coin is at $(x_i,y_i)$. All coins fall vertically downward by $1$ unit of height per second. For example, if a coin is currently at $(x,y)$, then after $t$ seconds its position will be $(x,y-t)$. Initially, FJ is at $(0,0)$. FJ can move left or right by $1$ unit per second, and FJ may also stay still. If at some moment a coin’s position coincides with FJ’s position, then FJ can catch that coin. Determine whether FJ can catch all the coins. If yes, output $\texttt{Abletocatch}$, otherwise output $\texttt{Notabletocatch}$.
Input Format
This problem has $g$ groups of testdata.
The first line contains an integer $g$, indicating there are $g$ groups of testdata.
For each group of testdata, the format is as follows:
- The first line contains an integer $n$.
- The next $n$ lines each contain two integers, representing $x_i,y_i$ for the $i$-th coin.
Output Format
Output $g$ lines. For each group, output $\texttt{Abletocatch}$ or $\texttt{Notabletocatch}$.
Explanation/Hint
For all testdata, $1 \le g \le 5$, $1 \le n \le 50$, $-10^3 \le x_i \le 10^3$, $0 \le y_i \le 10^3$.
Translated by ChatGPT 5