Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.*;
- import java.io.*;
- public class Template {
- FastScanner in;
- PrintWriter out;
- public void solve() throws IOException {
- }
- public void run() {
- try {
- in = new FastScanner(new File(".in"));
- out = new PrintWriter(new File(".out"));
- solve();
- out.close();
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
- class FastScanner {
- BufferedReader br;
- StringTokenizer st;
- FastScanner(File f) {
- try {
- br = new BufferedReader(new FileReader(f));
- } catch (FileNotFoundException e) {
- e.printStackTrace();
- }
- }
- boolean hasNext() {
- while (st == null || !st.hasMoreTokens()) {
- try {
- String line = br.readLine();
- if (line == null)
- return false;
- st = new StringTokenizer(line);
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
- return true;
- }
- String next() {
- return hasNext() ? st.nextToken() : null;
- }
- int nextInt() {
- return Integer.parseInt(next());
- }
- }
- public static void main(String[] arg) {
- new Template().run();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment