import java.io.IOException; import java.io.InputStream; import java.util.Arrays; import java.util.NoSuchElementException; class RMQ { int n=1; long[] v,lazy; long INF=Long.MAX_VALUE/3; public RMQ(int n_) { while (n Integer.MAX_VALUE) throw new NumberFormatException(); return (int) nl; } public double nextDouble() { return Double.parseDouble(next());} }