Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
The query is true if and only if your favorite day is in between the earliest and latest possible days to eat your favorite candy.
To get the earliest day, you need to eat dailyCap candies every day. To get the latest day, you need to eat 1 candy every day.
The latest possible day is the total number of candies with a smaller type plus the number of your favorite candy minus 1.
The earliest possible day that you can eat your favorite candy is the total number of candies with a smaller type divided by dailyCap.