1
+ import java .io .BufferedReader ;
2
+ import java .io .DataInputStream ;
3
+ import java .io .FileInputStream ;
4
+ import java .io .IOException ;
5
+ import java .io .InputStreamReader ;
6
+ import java .util .ArrayList ;
7
+ import java .util .Arrays ;
8
+
9
+
10
+
11
+ /**
12
+ * @author Mustansir
13
+ *
14
+ */
15
+ public class trying {
16
+
17
+ /**
18
+ * @param args
19
+ */
20
+
21
+
22
+ static class Reader
23
+ {
24
+ final private int BUFFER_SIZE = 1 << 16 ;
25
+ private DataInputStream din ;
26
+ private byte [] buffer ;
27
+ private int bufferPointer , bytesRead ;
28
+
29
+ public Reader ()
30
+ {
31
+ din = new DataInputStream (System .in );
32
+ buffer = new byte [BUFFER_SIZE ];
33
+ bufferPointer = bytesRead = 0 ;
34
+ }
35
+ public Reader (String file_name ) throws IOException
36
+ {
37
+ din = new DataInputStream (new FileInputStream (file_name ));
38
+ buffer = new byte [BUFFER_SIZE ];
39
+ bufferPointer = bytesRead = 0 ;
40
+ }
41
+ public String readLine () throws IOException
42
+ {
43
+ byte [] buf = new byte [64 ]; // line length
44
+ int cnt = 0 , c ;
45
+ while ((c = read ()) != -1 )
46
+ {
47
+ if (c == '\n' )
48
+ break ;
49
+ buf [cnt ++] = (byte ) c ;
50
+ }
51
+ return new String (buf , 0 , cnt );
52
+ }
53
+ public int nextInt () throws IOException
54
+ {
55
+ int ret = 0 ;
56
+ byte c = read ();
57
+ while (c <= ' ' )
58
+ c = read ();
59
+ boolean neg = (c == '-' );
60
+ if (neg )
61
+ c = read ();
62
+ do
63
+ {
64
+ ret = ret * 10 + c - '0' ;
65
+ } while ((c = read ()) >= '0' && c <= '9' );
66
+ if (neg )
67
+ return -ret ;
68
+ return ret ;
69
+ }
70
+ public long nextLong () throws IOException
71
+ {
72
+ long ret = 0 ;
73
+ byte c = read ();
74
+ while (c <= ' ' )
75
+ c = read ();
76
+ boolean neg = (c == '-' );
77
+ if (neg )
78
+ c = read ();
79
+ do {
80
+ ret = ret * 10 + c - '0' ;
81
+ }
82
+ while ((c = read ()) >= '0' && c <= '9' );
83
+ if (neg )
84
+ return -ret ;
85
+ return ret ;
86
+ }
87
+ public double nextDouble () throws IOException
88
+ {
89
+ double ret = 0 , div = 1 ;
90
+ byte c = read ();
91
+ while (c <= ' ' )
92
+ c = read ();
93
+ boolean neg = (c == '-' );
94
+ if (neg )
95
+ c = read ();
96
+ do {
97
+ ret = ret * 10 + c - '0' ;
98
+ }
99
+ while ((c = read ()) >= '0' && c <= '9' );
100
+ if (c == '.' )
101
+ {
102
+ while ((c = read ()) >= '0' && c <= '9' )
103
+ {
104
+ ret += (c - '0' ) / (div *= 10 );
105
+ }
106
+ }
107
+ if (neg )
108
+ return -ret ;
109
+ return ret ;
110
+ }
111
+ private void fillBuffer () throws IOException
112
+ {
113
+ bytesRead = din .read (buffer , bufferPointer = 0 , BUFFER_SIZE );
114
+ if (bytesRead == -1 )
115
+ buffer [0 ] = -1 ;
116
+ }
117
+ private byte read () throws IOException
118
+ {
119
+ if (bufferPointer == bytesRead )
120
+ fillBuffer ();
121
+ return buffer [bufferPointer ++];
122
+ }
123
+ public void close () throws IOException
124
+ {
125
+ if (din == null )
126
+ return ;
127
+ din .close ();
128
+ }
129
+ }
130
+
131
+ public static void main (String [] args )throws IOException {
132
+ // TODO Auto-generated method stub
133
+ Reader s = new Reader ();
134
+ long n =s .nextLong ();
135
+
136
+ }
137
+ }
0 commit comments