using System; using System.Collections.Generic; using System.Collections; using System.Collections.Specialized; using System.Linq; using System.Text; using System.IO; using System.Reflection; using static System.Math; using System.Numerics; static class Program{ const int mod=(int)1e9+7; static void Main(){ Sc sc=new Sc(); int n=sc.I; var a=new long[n]; if(n==1){ Console.WriteLine(0); return; } for(int i = 0;i{ public int o,n,cnt=0; private T[] arr,h; private bool[] b; public List li; public Pe(int u,int v){o=v-u+1;n=o;Fu1(u);} public Pe(int u,int v,int x){o=v-u+1;n=x;Fu1(u);} public Pe(T[] a){n=a.Length;Fu2(a);} public Pe(T[] a,int x){n=x;Fu2(a);} public void Fu1(int u){ h=new T[o]; for(int i=0;i(); Rc(0); } private void Rc(int a){ for(int i=0;i(int n,Func f){var a=new T[n];for(int i=0;i(int n,Func f){var a=new T[n];for(int i=0;i(int n,Func f){var a=new T[n];for(int i=0;i(int n,Func f){var a=new T[n];for(int i=0;i