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

Sum Zero

Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 65535/32768 K (Java/Others)
Total Submission(s): 1244    Accepted Submission(s): 351


Problem Description
There are 5 Integer Arrays and each of them contains no more than 300 integers whose value are between -100,000,000 and 100,000,000, You are to find how many such groups (i,j,k,l,m) can make A[0][i]+A[1][j]+A[2][k]+A[3][l]+A[4][m]=0. Maybe the result is too large, you only need tell me the remainder after divided by 1000000007.
 

Input
In the first line, there is an Integer T(0<T<20), means the test cases in the input file, then followed by T test cases.
For each test case, there are 5 lines Integers, In each line, the first one is the number of integers in its array.
 

Output
For each test case, just output the result, followed by a newline character.
 

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

Sample Output
11
 

Author
Sempr|CrazyBird|hust07p43
 

Source
 

Statistic | Submit | Discuss | Note
Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2025 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2025-04-01 09:48:44, Gzip enabled