Language: C++

!!LCA

const int N = 1e5;
vector<int> edge[N],dist(N);
int MAX_LOG_V = log2(N)+1;
mat par(MAX_LOG_V,vec(N+1));

void dfs(int no,int p,int d){
  par[0][no]=p;
  dist[no]=d;
  for(auto to:edge[no]){
    if(to!=p) dfs(to,no,d+1);
  }
}

void init(int V, int root){
  dfs(root,-1,0); //root,parent,dist
  for(int k=0;k+1<MAX_LOG_V;++k){
    for(int v=0;v<V;v++){
      if(par[k][v]<0) par[k+1][v]=-1;
      else par[k+1][v]=par[k][par[k][v]];
    }
  }
}

int lca(int u,int v){
  if(dist[u]>dist[v]) swap(u,v);
  for(int k=0;k<MAX_LOG_V;++k){
    if((dist[v]-dist[u])>>k&1){
      v=par[k][v];
    }
  }
  if(u==v) return u;
  for(int k=MAX_LOG_V-1;k>=0;--k){
    if(par[k][u]!=par[k][v]){
      u=par[k][u];
      v=par[k][v];
    }
  }
  return par[0][u];
} 

//####################################################################

!!座標圧縮

template<typename T>
vector<T> compress(vector<T> v){
  sort(v.begin(),v.end());
  v.erase(unique(v.begin(),v.end()),v.end());
  return v;
}

template<typename T>
map<T, int> dict(const vector<T> &v){
  map<T, int> res;
  for(int i=0;i<(int)v.size();i++)
    res[v[i]]=i;
  return res;
}

//#######################################################################

!!約数列挙

vector<int> divisor(const int n){
  vector<int> ret;
  for(int i=1;i*i<=n;i++){
    if(n % i == 0){
      ret.push_back(i);
      if(i*i!= n) ret.push_back(n/i);
    }
  }
  sort(ret.begin(),ret.end());
  return ret;
}

//#######################################################################

!! BIT

struct BIT{
private:
  vector<int> bit;
  int num;

public:
  BIT(vector<int> v){
    num = v.size();
    bit.resize(num);
    REP(i,num) bit[i] = v[i];
  }

  int sum(int i){
    int s = 0;
    while(i > 0){
      s += bit[i];
      i -= i & -i;
    }
    return s;
  }

  void add(int i, int x){
    while(i <= num){
      bit[i] += x;
      i += i & -i;
    }
  }
};

//########################################################################

!! Zアルゴリズム

//文字列Sと、Sのi文字目からの文字列Tの最長一致の接頭辞長
vector<int> z_algorithm(string& s){
  int n = s.size(), c = 0;
  vec ret(n);
  FOR(i,1,n){
    if(i+ret[i-c] < c + ret[c]) ret[i] = ret[i-c];
    else{
      int j = max(0LL,c+ret[c]-i);
      while(i+j < n && s[j] == s[i+j]) j++;
      ret[i] = j;
      c = i;
    }
  }
  ret[0] = n;
  return ret;
}

//########################################################################

!! manacher

//文字列Sのi文字目を中心とした回文半径
vector<int> manacher(string &S){
  vector<int> R;
  R.resize(S.size());
  int i = 0, j = 0;
  while (i < S.size()){
    while (i-j >= 0 && i+j < S.size() && S[i-j] == S[i+j]) ++j;
    R[i] = j;
    int k = 1;
    while (i-k >= 0 && i+k < S.size() && k+R[i-k] < j) R[i+k] = R[i-k], ++k;
    i += k; j -= k;
  }
  return R;
}

//########################################################################


!! 最長部分増加列

int LIS(const vector<int> &v) {
  int n = v.size();
  vector<int> dp(n, INF);
  REP(i,n) *lower_bound(dp.begin(), dp.end(), v[i]) = v[i];
  return find(dp.begin(), dp.end(), INF) - dp.begin();
}

//#########################################################################################

!! FFT

!!typedef complex<double> C;
int fft_n;
vector<C> omega;

int mod_pow(int x, int y = MOD - 2) {
  int res = 1;
  while (y > 0) {
    if (y & 1) res = (res * x) % MOD;
    x = (x * x) % MOD;
    y >>= 1;
  }
  return res;
}

void init_fft(int n) {
  fft_n = n;
  omega.resize(n);
  double angle = 2 * M_PI / n;
  REP(i,n) {
    omega[i] = C(cos(i * angle), sin(i * angle));
  }
}

void fft(vector<C> & a) {
  int n = a.size();
  if (n == 1) return;
  int half = n >> 1;
  vector<C> even(half), odd(half);
  for (int i = 0, j = 0; i < n; i += 2, ++j) {
    even[j] = a[i];
    odd[j] = a[i+1];
  }
  fft(even); fft(odd);
  for (int i = 0, fact = fft_n / n; i < half; ++i) {
    C twiddle = odd[i] * omega[i * fact];
    a[i] = even[i] + twiddle;
    a[i + half] = even[i] - twiddle;
  }
}

vector<int> mul_fft(const vector<int> &a, const vector<int> &b) {
  vector<int> res;
  vector<C> fa(a.begin(), a.end()), fb(b.begin(), b.end());
  int n = 1;
  while (n < 2 * max (a.size(), b.size())) n <<= 1;
  fa.resize(n); fb.resize(n);
  init_fft(n);
  fft(fa); fft(fb);
  REP(i,n) fa[i] = conj(fa[i] * fb[i]);
  fft(fa);
  res.resize (n);
  REP(i,n) {
    res[i] = (int) (fa[i].real() / n + 0.5);
  }
  return res;
}
// vec hoge = mul_fft(a,b)で呼び出し
// hoge[i]はΣa[k]*b[i-k]
// a,bは1-indexedで取る(0があれば0に)

//##############################################################################

//配列サイズは1e6まで
const int NMAX = 1e6+10;
vector<int> T(NMAX,0);
int inversion(vector<int> &A, const int l, const int r) {
  if(r <= l+1) return 0;
  int cnt = 0;
  const int m = (l+r)/2;
  cnt += inversion(A,l,m) + inversion(A,m,r);

  int i = l, j = m, k = 0, c = 0;
  while(i < m && j < r){
    if(A[j] < A[i]) {
      T[k++] = A[j++];
      c++;
    }
    else{
      T[k++] = A[i++];
      cnt += c;
    }
  }

  while(i < m){
    T[k++] = A[i++];
      cnt += c;
  }

  while(j < r) T[k++] = A[j++];

  for(int t = l; t < r; ++t) A[t] = T[t-l];

  return cnt;
}

//###############################################################################

!!分割数

// pn.R(i,j) でi個をjグループで割り振る場合の数。 O(N^2)
template<typename T> struct PartitionNumber{
  int n;
  vector<T> _P; vector<vector<T>> _PP, _Q, _R;
  PartitionNumber(int _n){
    n = _n;
    _P.resize(n + 1);
    _PP.resize(n + 1, vector<T>(n + 1));
    _Q.resize(n + 1, vector<T>(n + 1));
    _R.resize(n + 1, vector<T>(n + 1));

    _Q[0][0] = 1;
    FOR(i, 1, n + 1) FOR(j, 1, n + 1) {
      _Q[i][j] += _Q[i - 1][j - 1];
      if (j <= i) _Q[i][j] += _Q[i - j][j];
      _Q[i][j] %= MOD;
    }
    FOR(i, 0, n + 1){
      _R[i][0] = _Q[i][0];
      FOR(j, 1, n + 1) _R[i][j] = _R[i][j - 1] + _Q[i][j];
    }
  }

  int R(int i, int j){
    assert(0 <= j and 0 <= i and j <= n and i <= n);
    return _R[i][j] % MOD;
  }
};
PartitionNumber<int> pn(1010);

//####################################################################################

!! Union-Find

struct UnionFind {
  private:
  vector<int> child,tree,sum;

public:
  UnionFind(int v) {
    tree.resize(v);
    sum.resize(v);
    REP(i,v) tree[i] = i, sum[i] = 1;
  }

  int root(int i){
    if(i == tree[i]){
      REP(j,child.size()) tree[child[j]] = i;
      child.clear(); 
      return i;
    }
    else{
      child.push_back(i);
      return i = root(tree[i]);
    }
  }

  int size(int i){
    return sum[root(i)];
  }

  int unit(int x, int y){
    if(isUnit(x,y)) return 0;
    x = root(x);
    y = root(y);
    sum[min(x,y)] += sum[max(x,y)];
    tree[max(x,y)] = min(x,y);
  }

  bool isUnit(int x, int y){
    return root(x) == root(y);
  }
};

//######################################################################################

!! 部分永続UnionFind

class Array {
public:
  Array() {}

  Array(int n) {
    h = 0;
    for (int i = 1; i < n; i *= 8) h += 3;
  }

  int *mutable_get(int k) {
    auto p = mutable_get(k, root, 0, h);
    root = p.first;
    return &p.second->value;
  }

  int operator[](int k) {
    node *res = immutable_get(k, root, 0, h);
    return res != nullptr ? res->value : -1;
  }

private:
  struct node {
    node *ch[8] = {};
    int value = -1;
  };

  int h;
  node *root = nullptr;

  node *immutable_get(int a, node *x, int l, int d) {
    if (x == nullptr) return x;
    if (d == 0) return x;
    int id = (a - l) >> (d - 3);
    return immutable_get(a, x->ch[id], l + (id << (d - 3)), d - 3);
        }

  pair<node *, node *> mutable_get(int a, node *x, int l, int d) {
    x = x != nullptr ? new node(*x) : new node();
    if (d == 0) return make_pair(x, x);
    int id = (a - l) >> (d - 3);
    auto p = mutable_get(a, x->ch[id], l + (id << (d - 3)), d - 3);
    x->ch[id] = p.first;
    return make_pair(x, p.second);
  }
};

// root: O(logN loglogN)
// merge: O(logN loglogN)
struct UnionFind {
  Array uf;

  UnionFind() : uf(0) {}

  UnionFind(int n) : uf(n) {}

  int root(int x) {
    int nd = uf[x];
    if (nd < 0) return x;
    return root(nd);
  }

  void unit(int x, int y) {
    x = root(x);
    y = root(y);
    if (x == y) return;

    int *u = uf.mutable_get(x);
    int *v = uf.mutable_get(y);
    if (-*u < -*v) swap(u, v), swap(x, y);

    *u += *v;
    *v = x;
  }

  bool isUnit(int x, int y) {
    x = root(x);
    y = root(y);
    return x == y;
  }

  int size(int x) {
    return -uf[root(x)];
  }

  int query(int x, int y) {
    x = root(x);
    y = root(y);
    if (x == y) return -uf[x];
    else  return -uf[x] - uf[y];
  }
};

//#######################################################################################

!! 最小費用流

struct edge{int to,cap,cost,rev;};

const int MAX_V = 3e5;
int V;
vector<edge> G[MAX_V];
vector<int> h,dist,prevv(MAX_V),preve(MAX_V);

void add_edge(int from, int to, int cap, int cost){
  G[from].push_back((edge){to,cap,cost,G[to].size()});
  G[to].push_back((edge){from,0,-cost,G[from].size()-1});
}

int min_cost_flow(int s, int t, int f){
  int res = 0;
  h.assign(V,0);
  while(f > 0){
    priority_queue<P,vector<P>,greater<P> > que;
    dist.assign(V,INF);
    dist[s] = 0;
    que.push(P(0,s));
    while(!que.empty()){
      P p = que.top();
      que.pop();
      int v = p.sc;
      if(dist[v] < p.fs) continue;
      REP(i,G[v].size()){
        edge &e = G[v][i];
        if(e.cap > 0 && dist[e.to] > dist[v]+e.cost+h[v]-h[e.to]){
          dist[e.to] = dist[v] + e.cost + h[v] - h[e.to];
          prevv[e.to] = v;
          preve[e.to] = i;
          que.push(P(dist[e.to],e.to));
        }
      }
    }
    if(dist[t] == INF) return -1;
    REP(v,V) h[v] += dist[v];
    int d = f;
    for(int v = t; v != s; v = prevv[v]) d = min(d,G[prevv[v]][preve[v]].cap);
    f -= d;
    res += d*h[t];
    for(int v = t; v != s; v = prevv[v]){
      edge &e = G[prevv[v]][preve[v]];
      e.cap -= d;
      G[v][e.rev].cap += d;
    }
  }
  return res;
}
// Vを頂点数で更新する！！

//############################################################################################

!!最大流

struct max_flow{
  public:
  struct edge {int to,cap,rev;};
  int V;
  vector<vector<edge>> G;
  vector<int> level,iter;

  max_flow(int v){
    V = v; G.resize(v);
  }

  void add_edge(int from, int to, int cap){
    G[from].push_back((edge){to,cap,G[to].size()});
    G[to].push_back((edge){from,0,G[from].size()-1});
  }

  void bfs(int s){
    level.assign(V,-1);
    queue<int> que;
    level[s] = 0;
    que.push(s);
    while(!que.empty()){
      int v = que.front();
      que.pop();
      REP(i,G[v].size()){
        edge &e = G[v][i];
        if(e.cap > 0 && level[e.to] < 0){
          level[e.to] = level[v] + 1;
          que.push(e.to);
        }
      }
    }
  }

  int dfs(int v, int t, int f){
    if(v == t) return f;
    for(int &i = iter[v]; i < G[v].size(); i++){
      edge &e = G[v][i];
      if(e.cap > 0 && level[v] < level[e.to]){
        int d = dfs(e.to,t,min(f,e.cap));
        if(d > 0){
          e.cap -= d;
          G[e.to][e.rev].cap += d;
          return d;
        }
      }
    }
    return 0;
  }

  int run(int s, int t){
    int flow = 0;
    while(1){
      bfs(s);
      if(level[t] < 0) return flow;
      iter.assign(V,0);
      int tmp;
      while((tmp = dfs(s,t,INF)) > 0){
        flow += tmp;
      }
    }
  }
};
// INFが大きすぎないか？

//##############################################################################################

!! 2部マッチング

const int MAX_V = 3e5;
int V;
vector<int> G[MAX_V],match,used(MAX_V,0);

void add_edge(int u, int v){
  G[u].pb(v);
  G[v].pb(u);
}

bool dfs(int v){
  used[v]++;
  REP(i,G[v].size()){
    int u = G[v][i], w = match[u];
    if(w < 0 || !used[w] && dfs(w)){
      match[v] = u;
      match[u] = v;
      return true;
      }
    }
  return false;
}

int bipartite_matching(){
  int res = 0;
  match.assign(V,-1);
  REP(s,V){
    if(match[s] < 0){
      used.assign(V,0);
      if(dfs(s)) res++;
      }
    }
  return res;
}
// Vを頂点数に更新する！！

//############################################################################################

!!トポロジカルソート

const int NMAX = 2e5+10;
vector<int> g[NMAX]; // g[i][j]-> iからjの有向辺
int h[NMAX]; //h[i]-> iの入り次数
int v,e;

vector<int> t_sort(){
  stack<int> st;
  REP(i, v) if(h[i] == 0) st.push(i);
  vector<int> res;
  while(st.size()) {
    int i = st.top(); st.pop();
    res.push_back(i);
    for(auto& j: g[i]) {
      h[j]--;
      if(h[j] == 0) st.push(j);
    }
  }
  return res;
}
// 頂点数v,　辺の本数e
// res.size()がvで無いなら閉路がある

//############################################################################################

!! 強連結成分分解

struct SCC{
public:
  int V,cnt = 0;
  mat G,rG,edge;
  vec vs,cmp,used;

  SCC(int node_size) : V(node_size), G(V), rG(V), cmp(V), used(V,0) {}

  void add_edge(int from, int to) {
    G[from].push_back(to);
    rG[to].push_back(from);
  }

  void dfs(int u) {
    used[u]++;
    for (int v:G[u]) if(!used[v]) dfs(v);
    vs.push_back(u);
  }

  void dfs(int u, int k) {
    used[u]++;
    cmp[u] = k;
    for (int v:rG[u]) if(!used[v]) dfs(v,k);
  }

  int solve(){
    REP(i,V) if(!used[i]) dfs(i); 
    REP(i,V) used[i] = 0;
    RREP(i,vs.size()) if(!used[vs[i]]) dfs(vs[i],cnt++);
    return cnt;
  }

  void make_graph(){
    edge.resize(cnt);
    REP(i,V){
      for(int v:G[i]){
        if(cmp[i] < cmp[v]) edge[cmp[i]].push_back(cmp[v]);
      }
    }
  }
};

//#############################################################################################

!!SegmentTree RMQ

struct SegmentTree {
  private:
    int n;
    vector<int> node;

public:
  SegmentTree(vector<int> v) {
    int sz = (int)v.size();
    n = 1; while(n < sz) n *= 2;
    node.resize(2*n-1);

    REP(i,sz) node[i+n-1] = v[i];
    RREP(i,n-1) node[i] = min(node[i*2+1],node[i*2+2]); //最大値ならmax
  }

  // 0_indexedでk番目の要素をaに変更
  void update(int k, int a){
    k += n-1;
    node[k] = a;
    while(k > 0){
      k = (k-1) / 2;
      node[k] = min(node[k*2+1],node[k*2+2]); //最大値ならmax
    }
  }

  // 半開区間[l,r)から、[a,b)に対するクエリ。
  int query(int a, int b, int k=0, int l=0, int r=-1){
    if(r < 0) r = n;
    if(r <= a || b <= l) return INF; // 最大値なら-INF
    if(a <= l && r <= b) return node[k];
    else{
      int vl = query(a,b,k*2+1,l,(l+r)/2);
      int vr = query(a,b,k*2+2,(l+r)/2,r);
      return min(vl,vr); //最大値ならmax
    }
  }
};


//############################################################################################

!! SegmentTree RSQ

struct SegmentTree {
  private:
    int n;
    vector<int> node;

public:
  SegmentTree(vector<int> v) {
    int sz = (int)v.size();
    n = 1; while(n < sz) n *= 2;
    node.resize(2*n-1);

    REP(i,sz) node[i+n-1] = v[i];
    RREP(i,n-1) node[i] = node[i*2+1]+node[i*2+2];
  }

  // 0_indexedでk番目の要素をaに変更
  void update(int k, int a){
    k += n-1;
    node[k] = a;
    while(k > 0){
      k = (k-1) / 2;
      node[k] = node[k*2+1]+node[k*2+2];
    }
  }

  // 半開区間[l,r)から、[a,b)に対するクエリ。
  int query(int a, int b, int k=0, int l=0, int r=-1){
    if(r < 0) r = n;
    if(r <= a || b <= l) return 0;
    if(a <= l && r <= b) return node[k];
    else{
      int vl = query(a,b,k*2+1,l,(l+r)/2);
      int vr = query(a,b,k*2+2,(l+r)/2,r);
      return vl+vr;
    }
  }
};

//##########################################################################################

!! 抽象SegmentTree

template <typename T>
struct SegmentTree{
  using F = function<T(T,T)>;
  int n;
  F f;
  T ti;
  vector<T> dat;
  SegmentTree(){};
  SegmentTree(F f,T ti):f(f),ti(ti){}
  void init(int n_){
    n=1;
    while(n<n_) n<<=1;
    dat.assign(n<<1,ti);
  }
  void build(const vector<T> &v){
    int n_=v.size();
    init(n_);
    for(int i=0;i<n_;i++) dat[n+i]=v[i];
    for(int i=n-1;i;i--)
      dat[i]=f(dat[(i<<1)|0],dat[(i<<1)|1]);
  }
  void update(int k,T x){
    dat[k+=n]=x;
    while(k>>=1)
      dat[k]=f(dat[(k<<1)|0],dat[(k<<1)|1]);
  }
  void add(int k,T x){
    dat[k+=n]+=x;
    while(k>>=1)
      dat[k]=f(dat[(k<<1)|0],dat[(k<<1)|1]);
  }
  T query(int a,int b){
    T vl=ti,vr=ti;
    for(int l=a+n,r=b+n;l<r;l>>=1,r>>=1) {
      if(l&1) vl=f(vl,dat[l++]);
      if(r&1) vr=f(dat[--r],vr);
    }
    return f(vl,vr);
  }
};

//#############################################################################################

!! 遅延セグ木 RSQ

struct LazySegmentTree {
  private:
    int n;
    vector<int> node, lazy_add, lazy_update;

public:
  LazySegmentTree(vector<int> v) {
    int sz = (int)v.size();
    n = 1; while(n < sz) n *= 2;
    node.resize(2*n-1);
    lazy_add.resize(2*n-1, 0);
    lazy_update.resize(2*n-1, -INF);

    REP(i,sz) node[i+n-1] = v[i];
    RREP(i,n-1) node[i] = node[i*2+1] + node[i*2+2];
  }

  void eval(int k, int l, int r) {
    if(lazy_add[k] != 0) {
      node[k] += lazy_add[k];
      if(r - l > 1) {
        lazy_add[2*k+1] += lazy_add[k] / 2;
        lazy_add[2*k+2] += lazy_add[k] / 2;
      }
      lazy_add[k] = 0;
    }
    if(lazy_update[k] != -INF) {
      node[k] = (r-l)*lazy_update[k];
      if(r - l > 1) {
        lazy_update[2*k+1] = lazy_update[k];
        lazy_update[2*k+2] = lazy_update[k];
      }
      lazy_update[k] = -INF;
    }
  }

  void add(int a, int b, int x, int k=0, int l=0, int r=-1) {
    if(r < 0) r = n;
    eval(k, l, r);
    if(b <= l || r <= a) return;
    if(a <= l && r <= b) {
      lazy_add[k] += (r - l) * x;
      eval(k, l, r);
    }
    else {
      add(a, b, x, 2*k+1, l, (l+r)/2);
      add(a, b, x, 2*k+2, (l+r)/2, r);
      node[k] = node[2*k+1] + node[2*k+2];
    }
  }

  void update(int a, int b, int x, int k=0, int l=0, int r=-1) {
    if(r < 0) r = n;
    eval(k, l, r);
    if(b <= l || r <= a) return;
    if(a <= l && r <= b) {
      lazy_update[k] = x;
      eval(k, l, r);
    }
    else {
      update(a, b, x, 2*k+1, l, (l+r)/2);
      update(a, b, x, 2*k+2, (l+r)/2, r);
      node[k] = node[2*k+1] + node[2*k+2];
    }
  }

  int query(int a, int b, int k=0, int l=0, int r=-1) {
    if(r < 0) r = n;
    eval(k, l, r);
    if(b <= l || r <= a) return 0;
    if(a <= l && r <= b) return node[k];
    int vl = query(a, b, 2*k+1, l, (l+r)/2);
    int vr = query(a, b, 2*k+2, (l+r)/2, r);
    return vl + vr;
  }
};

//#########################################################################################

!! 遅延セグ木　抽象

template <typename T,typename E>
struct SegmentTree{
  using F = function<T(T,T)>;
  using G = function<T(T,E,int)>;
  using H = function<E(E,E)>;
  int n;
  F f;
  G g;
  H h;
  T ti;
  E ei;
  vector<T> dat;
  vector<E> laz;
  SegmentTree(F f,G g,H h,T ti,E ei):
    f(f),g(g),h(h),ti(ti),ei(ei){}

  void init(int n_){
    n=1;
    while(n<n_) n<<=1;
    dat.assign((n<<1)-1,ti);
    laz.assign((n<<1)-1,ei);
  }
  void build(const vector<T> &v){
    int n_=v.size();
    init(n_);
    for(int i=0;i<n_;i++) dat[n+i-1]=v[i];
    for(int i=n-2;i>=0;i--)
      dat[i]=f(dat[(i<<1)+2],dat[(i<<1)|1]);
  }
  void eval(int k,int l,int r){
    if(laz[k]==ei)return;
    dat[k] = g(dat[k], laz[k], r-l);
    if(r-l>1){
      laz[(k<<1)|1] = h(laz[(k<<1)|1], laz[k]);
      laz[(k<<1)+2] = h(laz[(k<<1)+2], laz[k]);
    }
    laz[k]=ei;
  }

  void update(int a, int b, E x,int k=0,int l=0,int r=-1){
    if(r<0)r=n;
    eval(k,l,r);
    if(r<=a||b<=l)return;
    if(a<=l&&r<=b){
      laz[k] = h(laz[k], x);
      eval(k,l,r);
    }
    else {
      update(a,b,x,(k<<1)|1,l,(l+r)/2);
      update(a,b,x,(k<<1)+2,(l+r)/2,r);
      dat[k]=f(dat[(k<<1)|1], dat[(k<<1)+2]);
    }
  }

  T query(int a,int b,int k=0,int l=0,int r=-1){
    if(r<0)r=n;
    eval(k,l,r);
    if(r<=a||b<=l)return ti;
    if(a<=l&&r<=b)return dat[k];
    T xl=query(a,b,(k<<1)|1,l,(l+r)/2);
    T xr=query(a,b,(k<<1)+2,(l+r)/2,r);
    return f(xl, xr);
  }

  //セグ木上の二分探索
  int find(int a, int b, int k=0,int l=0, int r=-1){
    if(r<0)r=n;
    eval(k,l,r);
    if(dat[k]<=0||r<=a||b<=l)return -1;
    if(r-l==1)return l;
    int xr = find(a,b,(k<<1)+2,(l+r)/2,r);
    if(xr>=0)return xr;
    return find(a,b,(k<<1)|1,l,(l+r)/2);
  }
};

//#######################################################################################



Compiler output:
a.cc:884:4: error: extended character 　 is not valid in an identifier
  884 | !! 遅延セグ木　抽象
      |    ^
a.cc:1:1: error: expected unqualified-id before '!' token
    1 | !!LCA
      | ^
a.cc:4:1: error: 'vector' does not name a type
    4 | vector<int> edge[N],dist(N);
      | ^~~~~~
a.cc:5:22: error: 'N' was not declared in this scope
    5 | int MAX_LOG_V = log2(N)+1;
      |                      ^
a.cc:5:17: error: 'log2' was not declared in this scope
    5 | int MAX_LOG_V = log2(N)+1;
      |                 ^~~~
a.cc:6:1: error: 'mat' does not name a type
    6 | mat par(MAX_LOG_V,vec(N+1));
      | ^~~
a.cc: In function 'void dfs(int, int, int)':
a.cc:9:3: error: 'par' was not declared in this scope
    9 |   par[0][no]=p;
      |   ^~~
a.cc:10:3: error: 'dist' was not declared in this scope
   10 |   dist[no]=d;
      |   ^~~~
a.cc:11:15: error: 'edge' was not declared in this scope
   11 |   for(auto to:edge[no]){
      |               ^~~~
a.cc: In function 'void init(int, int)':
a.cc:20:10: error: 'par' was not declared in this scope
   20 |       if(par[k][v]<0) par[k+1][v]=-1;
      |          ^~~
a.cc: In function 'int lca(int, int)':
a.cc:27:6: error: 'dist' was not declared in this scope
   27 |   if(dist[u]>dist[v]) swap(u,v);
      |      ^~~~
a.cc:27:23: error: 'swap' was not declared in this scope
   27 |   if(dist[u]>dist[v]) swap(u,v);
      |                       ^~~~
a.cc:29:9: error: 'dist' was not declared in this scope
   29 |     if((dist[v]-dist[u])>>k&1){
      |         ^~~~
a.cc:30:9: error: 'par' was not declared in this scope
   30 |       v=par[k][v];
      |         ^~~
a.cc:35:8: error: 'par' was not declared in this scope
   35 |     if(par[k][u]!=par[k][v]){
      |        ^~~
a.cc:40:10: error: 'par' was not declared in this scope
   40 |   return par[0][u];
      |          ^~~
a.cc: At global scope:
a.cc:45:1: error: expected unqualified-id before '!' token
   45 | !!座標圧縮
      | ^
a.cc:55:1: error: 'map' does not name a type
   55 | map<T, int> dict(const vector<T> &v){
      | ^~~
a.cc:64:1: error: expected unqualified-id before '!' token
   64 | !!約数列挙
      | ^
a.cc:80:1: error: expected unqualified-id before '!' token
   80 | !! BIT
      | ^
a.cc:113:1: error: expected unqualified-id before '!' token
  113 | !! Zアルゴリズム
      | ^
a.cc:134:1: error: expected unqualified-id before '!' token
  134 | !! manacher
      | ^
a.cc:154:1: error: expected unqualified-id before '!' token
  154 | !! 最長部分増加列
      | ^
a.cc:165:1: error: expected unqualified-id before '!' token
  165 | !! FFT
      | ^
a.cc:169:1: error: 'vector' does not name a type
  169 | vector<C> omega;
      | ^~~~~~
a.cc:171:28: error: 'MOD' was not declared in this scope
  171 | int mod_pow(int x, int y = MOD - 2) {
      |                            ^~~
a.cc: In function 'int mod_pow(int, int)':
a.cc:174:34: error: 'MOD' was not declared in this scope
  174 |     if (y & 1) res = (res * x) % MOD;
      |                                  ^~~
a.cc:175:19: error: 'MOD' was not declared in this scope
  175 |     x = (x * x) % MOD;
      |                   ^~~
a.cc: In function 'void init_fft(int)':
a.cc:183:3: error: 'omega' was not declared in this scope
  183 |   omega.resize(n);
      |   ^~~~~
a.cc:184:22: error: 'M_PI' was not declared in this scope
  184 |   double angle = 2 * M_PI / n;
      |                      ^~~~
a.cc:185:7: error: 'i' was not declared in this scope
  185 |   REP(i,n) {
      |       ^
a.cc:185:3: error: 'REP' was not declared in this scope
  185 |   REP(i,n) {
      |   ^~~
a.cc: At global scope:
a.cc:190:6: error: variable or field 'fft' declared void
  190 | void fft(vector<C> & a) {
      |      ^~~
a.cc:190:10: error: 'vector' was not declared in this scope
  190 | void fft(vector<C> & a) {
      |          ^~~~~~
a.cc:190:17: error: 'C' was not declared in this scope
  190 | void fft(vector<C> & a) {
      |                 ^
a.cc:190:22: error: 'a' was not declared in this scope
  190 | void fft(vector<C> & a) {
      |                      ^
a.cc:207:1: error: 'vector' does not name a type
  207 | vector<int> mul_fft(const vector<int> &a, const vector<int> &b) {
      | ^~~~~~
a.cc:231:1: error: 'vector' does not name a type
  231 | vector<int> T(NMAX,0);
      | ^~~~~~
a.cc:232:15: error: 'vector' was not declared in this scope
  232 | int inversion(vector<int> &A, const int l, const int r) {
      |               ^~~~~~
a.cc:232:22: error: expected primary-expression before 'int'
  232 | int inversion(vector<int> &A, const int l, const int r) {
      |                      ^~~
a.cc:232:31: error: expected primary-expression before 'const'
  232 | int inversion(vector<int> &A, const int l, const int r) {
      |                               ^~~~~
a.cc:232:44: error: expected primary-expression before 'const'
  232 | int inversion(vector<int> &A, const int l, const int r) {
      |                                            ^~~~~
a.cc:232:55: error: expression list treated as compound expression in initializer [-fpermissive]
  232 | int inversion(vector<int> &A, const int l, const int r) {
      |                                                       ^
a.cc:264:1: error: expected unqualified-id before '!' token
  264 | !!分割数
      | ^
a.cc:294:1: error: 'PartitionNumber' does not name a type
  294 | PartitionNumber<int> pn(1010);
      | ^~~~~~~~~~~~~~~
a.cc:298:1: error: expected unqualified-id before '!' token
  298 | !! Union-Find
      | ^
a.cc:342:1: error: expected unqualified-id before '!' token
  342 | !! 部分永続UnionFind
      | ^
a.cc:393:3: error: 'Array' does not name a type
  393 |   Array uf;
      |   ^~~~~
a.cc: In constructor 'UnionFind::UnionFind()':
a.cc:395:17: error: class 'UnionFind' does not have any field named 'uf'
  395 |   UnionFind() : uf(0) {}
      |                 ^~
a.cc: In constructor 'UnionFind::UnionFind(int)':
a.cc:397:22: error: class 'UnionFind' does not have any field named 'uf'
  397 |   UnionFind(int n) : uf(n) {}
      |                      ^~
a.cc: In member function 'int UnionFind::root(int)':
a.cc:400:14: error: 'uf' was not declared in this scope
  400 |     int nd = uf[x];
      |              ^~
a.cc: In member function 'void UnionFind::unit(int, int)':
a.cc:410:14: error: 'uf' was not declared in this scope; did you mean 'u'?
  410 |     int *u = uf.mutable_get(x);
      |              ^~
      |              u
a.cc:412:20: error: 'swap' was not declared in this scope
  412 |     if (-*u < -*v) swap(u, v), swap(x, y);
      |                    ^~~~
a.cc: In member function 'int UnionFind::size(int)':
a.cc:425:13: error: 'uf' was not declared in this scope
  425 |     return -uf[root(x)];
      |             ^~
a.cc: In member function 'int UnionFind::query(int, int)':
a.cc:431:25: error: 'uf' was not declared in this scope
  431 |     if (x == y) return -uf[x];
      |                         ^~
a.cc:432:19: error: 'uf' was not declared in this scope
  432 |     else  return -uf[x] - uf[y];
      |                   ^~
a.cc: At global scope:
a.cc:438:1: error: expected unqualified-id before '!' token
  438 | !! 最小費用流
      | ^
a.cc:444:1: error: 'vector' does not name a type
  444 | vector<edge> G[MAX_V];
      | ^~~~~~
a.cc:445:1: error: 'vector' does not name a type
  445 | vector<int> h,dist,prevv(MAX_V),preve(MAX_V);
      | ^~~~~~
a.cc: In function 'void add_edge(int, int, int, int)':
a.cc:448:3: error: 'G' was not declared in this scope
  448 |   G[from].push_back((edge){to,cap,cost,G[to].size()});
      |   ^
a.cc:448:22: error: 'edge' was not declared in this scope
  448 |   G[from].push_back((edge){to,cap,cost,G[to].size()});
      |                      ^~~~
a.cc:449:25: error: expected ')' before '{' token
  449 |   G[to].push_back((edge){from,0,-cost,G[from].size()-1});
      |                  ~      ^
      |                         )
a.cc: In function 'int min_cost_flow(int, int, int)':
a.cc:454:3: error: 'h' was not declared in this scope
  454 |   h.assign(V,0);
      |   ^
a.cc:456:5: error: 'priority_queue' was not declared in this scope
  456 |     priority_queue<P,vector<P>,greater<P> > que;
      |     ^~~~~~~~~~~~~~
a.cc:456:20: error: 'P' was not declared in this scope
  456 |     priority_queue<P,vector<P>,greater<P> > que;
      |                    ^
a.cc:456:22: error: 'vector' was not declared in this scope
  456 |     priority_queue<P,vector<P>,greater<P> > que;
      |                      ^~~~~~
a.cc:456:31: error: expected primary-expression before ',' token
  456 |     priority_queue<P,vector<P>,greater<P> > que;
      |                               ^
a.cc:456:32: error: 'greater' was not declared in this scope
  456 |     priority_queue<P,vector<P>,greater<P> > que;
      |                                ^~~~~~~
a.cc:456:43: error: expected primary-expression before '>' token
  456 |     priority_queue<P,vector<P>,greater<P> > que;
      |                                           ^
a.cc:456:45: error: 'que' was not declared in this scope
  456 |     priority_queue<P,vector<P>,greater<P> > que;
      |                                             ^~~
a.cc:457:5: error: 'dist' was not declared in this scope
  457 |     dist.assign(V,INF);
      |     ^~~~
a.cc:457:19: error: 'INF' was not declared in this scope
  457 |     dist.assign(V,INF);
      |                   ^~~
a.cc:461:8: error: expected ';' before 'p'
  461 |       P p = que.top();
      |        ^~
      |        ;
a.cc:463:15: error: 'p' was not declared in this scope
  463 |       int v = p.sc;
      |               ^
a.cc:465:11: error: 'i' was not declared in this scope
  465 |       REP(i,G[v].size()){
      |           ^
a.cc:465:13: error: 'G' was not declared in this scope
  465 |       REP(i,G[v].size()){
      |             ^
a.cc:465:7: error: 'REP' was not declared in this scope
  465 |       REP(i,G[v].size()){
      |       ^~~
a.cc:476:9: error: 'v' was not declared in this scope
  476 |     REP(v,V) h[v] += dist[v];
      |         ^
a.cc:476:5: error: 'REP' was not declared in this scope
  476 |     REP(v,V) h[v] += dist[v];
      |     ^~~
a.cc:478:32: err