高速Java入力

良い一日!

この記事は、アプリケーションプログラマやスポーツプログラミングに興味のある人に役立ちます。 彼女はJava言語での高速データ入力について話します。



私はしばしばウェブサイトwww.spoj.plで問題を解決しますが、時々Javaの速度の問題に遭遇します。 基本的に、これはかなり遅いデータ入力に関するもので、 StreamTokenizerでさえ一部のタスクには適していません。

このために、ストリームからデータをバイト単位で読み取り、それらを数値または文字列に変換するクラスを作成しました。 判明したように、このクラスはC ++のscanf()よりも数倍高速に動作します。 以下に彼のコードを引用します。

Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }



  1. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }



  2. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }



  3. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }



  4. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }



  5. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }



  6. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }



  7. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }



  8. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }



  9. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }



  10. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }



  11. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }



  12. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }



  13. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }



  14. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }



  15. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }



  16. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }



  17. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }



  18. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }



  19. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }



  20. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }



  21. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }



  22. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }



  23. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }



  24. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }



  25. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }



  26. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }



  27. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }



  28. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }



  29. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }



  30. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }



  31. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }



  32. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }



  33. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }



  34. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }



  35. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }



  36. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }



  37. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }



  38. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }



  39. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }



  40. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }



  41. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }



  42. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }



  43. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }



  44. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }



  45. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }



  46. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }



  47. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }



  48. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }



  49. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }



  50. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }



  51. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }



  52. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }



  53. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }



  54. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }



  55. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }



  56. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }



  57. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }



  58. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }



  59. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }



  60. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }



  61. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }



  62. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }



  63. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }



  64. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }



  65. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }



  66. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }



  67. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }



  68. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }



  69. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }



  70. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }



  71. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }



  72. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }



  73. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }





INTESTタスクでデータ入力速度を確認または比較できます



All Articles