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
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.
bruceewayne | 119 |
rajupraaa1234 | 110 |
SUZAKU | 104 |
yash_sharan | 104 |
Core_Ka_Bachha | 99 |
mr_kksparrow | 433 |
manvirag982 | 302 |
rajupraaa1234 | 245 |
Exception_404 | 244 |
snow_den_ | 236 |
blackshadows | 5331 |
Ibrahim Nash | 5219 |
akhayrutdinov | 5111 |
mb1973 | 4929 |
Quandray | 4567 |