import java.io.IOException; import java.io.InputStream; import java.util.NoSuchElementException; public class Main { private static final Value used=new Value(-1,-1); public static void main(String[] args) { FastScanner scanner=new FastScanner(); int len=scanner.readInt(); Value[] unsorted=new Value[len]; Value[] sorted=new Value[len]; int sum=0; for(int i=0;i 0; } } private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1;} private static boolean isPrintableChar(int c) { return 33 <= c && c <= 126;} public int readInt(){ int b = readByte(); int n=0; while(true){ if ('0' <= b && b <= '9') { n *= 10; n += b - '0'; }else if(b == -1 || !isPrintableChar(b)){ return n; }else{ throw new NumberFormatException(); } b = readByte(); } } } }