CF1468N Waste Sorting

题目描述

有三个桶,五种垃圾,每个桶有固定的容量。 $1$垃圾放入$1$号桶中,$2$垃圾放入$2$号桶中,$3$垃圾放入$3$号桶中,$4$垃圾可以放入$1$、$3$号桶中,$5$垃圾可以放入$2$、$3$号桶中。 对于给定的桶容量$c$和垃圾量$a$,请问垃圾是否可以全部放入桶中?

输入格式

**本题有多组数据** 第一行包含一个整数$t(1\le t\le 3 * 10^4)$——测试用例的数量。 每个测试用例由两行组成。每个测试用例的第一行包含三个整数$c_1,c_2,c_3(0\le c_1、c_2、c_3\le 10^8)$——容器的容量。 每个测试用例的第二行包含五个整数$a_1、a_2、a_3、a_4、a_5(0\le a_i\le 10^8)$,其中$a_ i$是必须丢弃的第$i$类垃圾的数量。

输出格式

对于每个测试用例,如果可以将所有项目装入容器,则打印 $YES$,否则打印 $NO$。您可以在任何情况下打印每个字母(例如,$YES,Yes,yes,yEs$都将被视为肯定答案)。

说明/提示

Explanations for the example test cases: 1. Monocarp can put $ 1 $ item of paper waste into the first container, $ 2 $ items of plastic waste into the second container, and $ 3 $ items of general waste into the third container; 2. Monocarp can put $ 1 $ item of paper waste and $ 1 $ item of partially-paper waste into the first container, $ 2 $ items of plastic waste into the second container, and $ 3 $ items of general waste into the third container; 3. there is no answer since either the second container should contain $ 3 $ items, or the third container should contain $ 4 $ items; 4. Monocarp can put $ 1 $ item of paper waste into the first container, $ 2 $ items of plastic waste into the second container, and $ 3 $ items of general waste, $ 1 $ item of partially-paper waste and $ 1 $ item of partially-plastic waste into the third container; 5. there is no waste at all, so all containers can be left empty; 6. there's no answer since it's impossible to put a paper item into the third container; 7. Monocarp can put $ 10 $ items of partially-paper waste into the first container, $ 37 $ items of partially-plastic waste into the second container, and $ 30 $ items of partially-paper waste and $ 10 $ items of partially-plastic waste into the third container.