There is a game in Chefland named Chefgame in which different villages of Chefland are participating. There is one group from each village and consist of two members one man and another woman. Judgement of the game depends on the sum of the points scored by each individual in a team. Chef is good at mathematics but little crazy. So, he decided to calculate the minimum point diffrence between two teams among all. Difference can not be negative.
- First line will contain $T$, number of testcases. Then the testcases follow.
- First line of each test case will contain $N$, number of participating villages.
- Second line of each test case will contain $N$ space separated integers. $M_i$denote points of each man from each village
- Third line of each test case will contain $N$ space separated integers. $W_i$denote points of each woman from each village
For each testcase, print a single integer, minimum difference between two team among all.
- $1 \leq T \leq 100$
- $2 \leq N \leq 10^5$
- $0 \leq M_i \leq 10^5$
- $0 \leq W_i \leq 10^5$
1 4 3 1 9 11 2 4 10 14
Explanation:Score difference of first two team is minimum i.e, 4.
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, rust, SCALA, swift, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, kotlin, PERL6, TEXT, SCM chicken, PYP3, CLOJ, R, COB, FS|
Fetching successful submissions