Sum Indexes
Submissions: 678   Accuracy:

29.13%

  Difficulty: Easy   Marks: 2

You are given 3 different array A,B and C of same size N. Find number of index i such that:
Ai=Bi+Ck
where k can lie between [1,N].

Input:
The first line of the input contains an integer T, denoting number of test cases. The first line of each test case contains an integer N denoting the size of the array. The next 3 line of the contains N space separated integers each, of the array A, B and C respectively.

Output:
For each test case, print the count of number of such index which satisfies the given condition.

Constraints:
1<=T<=4.7*10^3
1<=N<=300
1<=Ai,Bi<=100
-100<=Ci<=100

Example:
Input

1
3
1 2 3
3 2 4
0 5 -2
Output
2

** For More Input/Output Examples Use 'Expected Output' option **

Author: ShivamKD


If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.



Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.


to report an issue on this page.