**Compilation/Execution Result:**

Suppose there are two friends and now they want to test their friendship that how much compatible they are. Given the numbers n numbered from 1 to n and they are asked to rank the numbers. The task is find the compatibility difference between them. Compatibility difference is the number of mis-matches in the relative ranking of the same movie given by them.

```
Input : a1[] = {3, 1, 2, 4, 5}
a2[] = {3, 2, 4, 1, 5}
Output : 2
Explanation : Compatibility difference is two
because first ranks movie 1 before 2 and 4 but
other ranks it after.
Input : a1[] = {5, 3, 1, 2, 4}
a2[] = {3, 1, 2, 4, 5}
Output : 5
Total difference is four due to mis-match in
position of 5
```

**Input:**

First line consists of T test cases. First line of every test case consists of N, denoting number of array elements. Second and third line respectively consists of A1 and A2 array.

**Output:**

Single line output, print the required answer.

**Constraints:**

1<=T<=100

1<=N<=1000

**Example:
Input:**

1

5

3 1 2 4 5

3 2 4 1 5

2

Author: saksham seth

Shashank_Pathak | 216 |

SANJAY5797 | 174 |

surbhi_7 | 168 |

yati493 | 167 |

dark_knights | 162 |

Shashank_Pathak | 572 |

surbhi_7 | 556 |

dark_knights | 501 |

Infinty | 341 |

Vasudha Gupta | 324 |

akhayrutdinov | 4156 |

sanjay05 | 3597 |

Quandray | 2782 |

Ibrahim Nash | 2475 |

Michael Riegger | 2284 |