A: Soylent

https://open.kattis.com/problems/soylent

We would like to find the minimum number of bottles that Yraglac needs to consume in order to hit his daily calorie requirement.

So, if the daily requirement is NN calories, we are interested in the smallest integer bb such that 400bN400 \cdot b \geq N . Thus, the required value of bb is N400\lceil{\frac{N}{400}}\rceil, where x\lceil x \rceildenotes the smallest integer greater than or equal to x.

int b = (N+399)/400;

Last updated