Universal Cup Judging System

Universal Cup

Time Limit: 12.0 s Memory Limit: 1024 MB Total points: 100 Hackable ✓
Statistics

문제 설명

새해 연휴가 끝나고, 당신의 건설 회사는 다시 업무에 복귀하고 있습니다. 안타깝게도 일부 직원들은 아직도 축제를 즐기고 있습니다...

오늘 당신의 회사에는 술에 취하지 않은 멀쩡한 작업자 $a$명과 술에 취한 작업자 $b$명이 출근했습니다. 각 작업자는 하루 종일 일할 수 있습니다. 또한 회사는 오늘 처리해야 할 주문 $m$건을 받았습니다. 각 주문은 수행해야 하는 시간 구간의 시작과 끝인 $[st, fn]$으로 지정됩니다. 이러한 주문은 시각 $st$부터 시각 $fn$까지(양 끝 포함) 한 명의 작업자가 작업해야 합니다. 시간 구간이 겹치지 않는다면 한 명의 작업자가 여러 주문을 완료할 수 있습니다. 또한 각 주문은 두 가지 유형 중 하나를 가집니다: 단순 주문은 어떤 작업자든 완료할 수 있는 반면, 복잡 주문은 술에 취하지 않은 작업자가 필요합니다.

당신의 회사는 오늘의 주문들을 모두 처리할 수 있을까요?

입력

첫 번째 줄에 테스트 케이스의 개수 $t$ ($1 \le t \le 2000$)가 주어집니다. 각 테스트 케이스에 대하여:

첫 번째 줄에 세 정수 $a$, $b$, $m$ ($0 \le a, b, m \le 10\,000$)이 주어집니다.

그다음 $m$개의 줄이 이어집니다. 각 줄에는 세 정수 $type$, $st$, $fn$이 주어지며, 이는 단순 주문($type = 1$인 경우) 또는 복잡 주문($type = 2$)과 그 시간 구간 $[st, fn]$ ($type \in \{1, 2\}$; $1 \le st \le fn \le 2 \cdot m$)을 나타냅니다. 예를 들어, 1 2 4라는 줄은 두 번째 시각부터 네 번째 시각까지(양 끝 포함) 총 세 시각이 필요한 단순 주문을 설명합니다.

모든 테스트 케이스에서 $m$의 합은 최대 $10\,000$입니다.

출력

각 테스트 케이스마다 한 줄에 정답인 "Yes" 또는 "No"(대소문자 구분 없음)를 출력하세요.

예제

1
1 1 2
1 1 2
2 2 4
Yes

Editorials

IDTypeStatusTitlePosted ByLast UpdatedActions
#1224EditorialOpen题解jianglyView

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.