|시간 제한||메모리 제한||제출||정답||맞은 사람||정답 비율|
|1 초||256 MB||44||44||43||100.000%|
ICPC donation center is preparing donation packages for people who faced disaster in every area in Thailand. The center gets several kinds of donation. In this year, the center gets a request to pack the basic items in one package which consists of three sets. The first set, called SetA, is water and beverage. The second one, SetB, consists of instant noodle, canned food and rice. And the last set, SetC, is first aid kits and tissue paper. In every day, we try to pack and distribute dotation packages as many as possible. We have constrains for packaging which are: one package has to comprise of SetA , SetB and SetC equally and one distribution contains the minimum of 30 packages. However, the center receives these 3 sets in different amount each day. Therefore, the center must wait until the accumulated amount of each and every set over 30 in order to pack a distribution.
The input will start with an integer T (1<= T <= 365), the number of consecutive donation days. The next T lines show donation in each day, consisting of three integers: the number of setA, SetB and setC, respectively.
For each day, print out the maximum number of packages to be distributed on that day. If the packages cannot be distributed on that day (number of packages is less than 30), print NO.
5 20 30 60 20 30 60 50 40 60 50 10 10 0 50 50
NO 40 50 NO 50