Hackerrank – Halloween Party

Problem Statement
A description of the problem can be found on Hackerrank.

Solution
Calculate chocolate pieces as:

    \[horizontal = slices / 2\]

    \[vertical = slices - horizontal\]

    \[pieces = horizontal * vertical\]

I created solution in:

All solutions are also available on my GitHub.

Java

JavaScript

Scala

Ruby