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

MG loves set

Time Limit: 6000/3000 MS (Java/Others)    Memory Limit: 262144/262144 K (Java/Others)
Total Submission(s): 283    Accepted Submission(s): 65


Problem Description
MG is an intelligent boy. One day he was challenged by the famous master called Douer:
if the sum of the square of every element in a set is less than or equal to the square of the sum of all the elements, then we regard this set as ˇ±A Harmony Setˇ±.

Now we give a set with $n$ different elements, ask you how many nonempty subset is ˇ°A Harmony Setˇ±.

MG thought it very easy and he had himself disdained to take the job. As a bystander, could you please help settle the problem and calculate the answer?
 

Input
The first line is an integer $T$ which indicates the case number.($1<=T<=10$)

And as for each case, there are $1$ integer $n$ in the first line which indicate the size of the set($n<=30$).

Then there are $n$ integers $V$ in the next line, the x-th integer means the x-th element of the set($0<=|V|<=100000000$).
 

Output
As for each case, you need to output a single line.

There should be one integer in the line which represents the number of ˇ°Harmony Setˇ±.
 

Sample Input
3 4 1 2 3 4 5 1 -1 2 3 -3 6 0 2 4 -4 -5 8
 

Sample Output
15 12 25
 

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-11-22 19:25:54, Gzip enabled