#K53127. Valid Game Setup

    ID: 29463 Type: Default 1000ms 256MiB

Valid Game Setup

Valid Game Setup

The task is to determine whether the initial game setup is valid based on the players' starting positions and their movement ranges. Each player is located on a one-dimensional board, and each player's range is represented as an interval \( [p-r, p+r] \). A game setup is considered valid if no two players have overlapping intervals. Specifically, if the intervals of any two players intersect (including at the boundary), the setup is invalid.

Input Format: The first line contains an integer \( T \), the number of test cases. Each test case begins with an integer \( N \) representing the number of players, followed by \( N \) lines each containing two space-separated integers \( p \) and \( r \) indicating the player's initial position and movement range.

Output Format: For each test case, output "YES" if the game setup is valid; otherwise, output "NO".

inputFormat

The input begins with an integer \( T \) (the number of test cases). For each test case, the first line contains an integer \( N \) (the number of players). This is followed by \( N \) lines, each containing two integers \( p \) and \( r \), where \( p \) is the starting position of a player and \( r \) is the movement range.

outputFormat

For each test case, print a single line containing "YES" if the game setup is valid (i.e., no overlapping intervals), or "NO" otherwise.

## sample
2
3
1 2
5 1
3 2
2
-3 3
4 2
NO

YES

</p>