Advertisement
Guest User

Untitled

a guest
Jul 10th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Kotlin 1.10 KB | None | 0 0
  1. import java.io.*
  2. import java.util.*
  3. import java.lang.Math.*
  4.  
  5. class $FILE$ {
  6.     fun solve(io: FastIO) {
  7.         $END$
  8.     }
  9.  
  10.     fun main(args: Array<String>) {
  11.         FastIO(System.`in`, System.out).use {
  12.             solve(it)
  13.         }
  14.     }
  15.  
  16.     class FastIO(inp: InputStream, out: OutputStream) : PrintWriter(out) {
  17.         private val reader = BufferedReader(InputStreamReader(inp))
  18.         private var tokenizer = StringTokenizer("")
  19.  
  20.         fun nextToken(): String? {
  21.             while (!tokenizer.hasMoreTokens()) {
  22.                 val s = reader.readLine() ?: return null
  23.                 tokenizer = StringTokenizer(s)
  24.             }
  25.  
  26.             return tokenizer.nextToken()
  27.         }
  28.  
  29.         fun nextInt() = nextToken()!!.toInt()
  30.         fun nextLong() = nextToken()!!.toLong()
  31.         fun nextDouble() = nextToken()!!.toDouble()
  32.         fun nextWord() = nextToken()!!
  33.         fun nextLine() = reader.readLine()
  34.     }
  35.  
  36.     fun run() {
  37.         FastIO(System.`in`, System.out).use {
  38.             solve(it)
  39.         }
  40.     }
  41. }
  42.  
  43. fun main(args: Array<String>) {
  44.     $FILE$().run()
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement