Skip to content

Instantly share code, notes, and snippets.

@jackliusr
Last active August 29, 2015 14:04
Show Gist options
  • Save jackliusr/d133691f8600f9c538cb to your computer and use it in GitHub Desktop.
Save jackliusr/d133691f8600f9c538cb to your computer and use it in GitHub Desktop.
Hackerrank Halloween party in Scala
object Solution {
def main(args: Array[String]) {
val lines = io.Source.stdin.getLines().filter(_.length > 0).drop(1)
val nums = lines.map(_.toLong)
nums.foreach( n => println( (n /2) * ( n - n /2) ))
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment