Description
The New Year holidays are over, and your construction company is getting back to work. Unfortunately, some employees are still celebrating...
Today, $a$ sober and $b$ drunk workers came to work for you. Each worker will be available for the whole day. Your company also received $m$ orders for today. Each order is specified by the start and the end of the time span to perform it: $[st, fn]$. Such an order requires a single worker to work on it from moment $st$ to moment $fn$, inclusive. A worker can complete multiple orders if their time spans do not intersect. Additionally, each order has one of the two types: a simple order can be completed by any worker, while a complex order requires a sober worker.
Will your company be able to handle today's orders?
Input
The first line contains an integer $t$, the number of test cases ($1 \le t \le 2000$). For each test case:
The first line contains three integers: $a$, $b$, and $m$ ($0 \le a, b, m \le 10\,000$).
Then $m$ lines follow. Each line contains three integers, $type$, $st$, and $fn$, describing a simple (if $type = 1$) or complex ($type = 2$) order with the time span $[st, fn]$ ($type \in \{1, 2\}$; $1 \le st \le fn \le 2 \cdot m$). For example, a line 1 2 4 describes a simple order which requires three moments, from second to fourth, both ends included.
The sum of $m$ over all test cases is at most $10\,000$.
Output
For each test case, print a single line with the answer: "Yes" or "No" (case-insensitive).
Example
1
1 1 2
1 1 2
2 2 4
Yes