Skip to main content
3 of 5
Oooops, thanks muddyfish
Manuel Allenspach
  • 4.8k
  • 1
  • 21
  • 44

#Hungry, Java

public class Hungry {
    public static void main(String[] args) {
        double[] arguments = new double[4];
        for (int i = 0; i < 4; i++) {
            arguments[i] = Double.parseDouble(args[i]);
        }
        int myCake = (int) Math.ceil(arguments[1]/arguments[3]);
        System.out.println(myCake);
    }
}

Always wants a little bit more than its fair share. If it is the last player, take everything.

Manuel Allenspach
  • 4.8k
  • 1
  • 21
  • 44