F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

Don't be angry

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 794    Accepted Submission(s): 413


Problem Description
Wiskey buys a cake and wants to eat with Michelle. The cake is very delicious with many chocolates on it.
The cake is big; Wiskey need cut it to 6 pieces.
Michelle is a perfectionist and she sets perfect standard for Wiskey that each piece must contains the same weight of chocolates.
At first the cake may be not perfect, so Wiskey get some chocolate sticks, but the chocolate stick is too long, it will occupy adjacent two pieces and add same weight on the adjacent two pieces.
You can assume Wiskey have infinite various weight chocolate sticks.
Quick, Help Wiskey! Michelle is beginning to be angry.
 

Input
First line will contain one integer means how many cases will be follow.
Each line will contain six integers means the weight of chocolates at first.
All integers range in signed 32 bits.
 

Output
Print "YES" if Wiskey could finish the task.
Else print "NO", and then you could visit Wiskey in hospital.
 

Sample Input
4 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 0 0 2 1 0 0 1 2
 

Sample Output
YES NO YES YES
 

Author
Wiskey
 

Statistic | Submit | Discuss | Note
Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-05-12 02:34:22, Gzip enabled