Skip to content

Instantly share code, notes, and snippets.

@sooop
Last active September 20, 2017 11:43
Show Gist options
  • Select an option

  • Save sooop/ea69aee1b8e2f405d347fe4c712e0751 to your computer and use it in GitHub Desktop.

Select an option

Save sooop/ea69aee1b8e2f405d347fe4c712e0751 to your computer and use it in GitHub Desktop.
pen n = (flip div 2) $ n * (n * 3 - 1)
main = getLine >> getContents >>= putStrLn . unlines . map (show . pen .read) . lines
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment