• [deleted]
    + 0 comments

    Works, but it's a bit too much work. For input as trivial as this, val n = readLine().toInt should suffice.