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

Sequence

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 1194    Accepted Submission(s): 690


Problem Description
Today we have a number sequence A includes n elements.
Nero thinks a number sequence A is good only if the sum of its elements with odd index equals to the sum of its elements with even index and this sequence is not a palindrome.
Palindrome means no matter we read the sequence from head to tail or from tail to head,we get the same sequence.
Two sequence A and B are consider different if the length of A is different from the length of B or there exists an index i that $A_{i}\neq B_{i}$.
Now,give you the sequence A,check out it¡¯s good or not.
 

Input
The first line contains a single integer T,indicating the number of test cases.
Each test case begins with a line contains an integer n,the length of sequence A.
The next line follows n integers $A_{1},A_{2}, \ldots, A_{n}$.

[Technical Specification]
1 <= T <= 100
1 <= n <= 1000
0 <= $A_{i}$ <= 1000000
 

Output
For each case output one line,if the sequence is good ,output "Yes",otherwise output "No".
 

Sample Input
3 7 1 2 3 4 5 6 7 7 1 2 3 5 4 7 6 6 1 2 3 3 2 1
 

Sample Output
No Yes No
 

Source
 

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-04-29 11:34:33, Gzip enabled