C # program for the above approach
using System ; using System . Collections . Generic ; class GFG { static int INF64 = ( int ) 1e8 ; static int N = 200 * 1000 + 13 ; static int n ; static int [ ] arr = new int [ N ] ; static int [ ] brr = new int [ N ] ;