Some thought about the Popsicles problem | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

Some thought about the Popsicles problem

Correct me if I am wrong. I got some thoughts about this problem, what if there are at least 2n of popsicles and 2n >= siblings * 2, For example 9 popsicles and 4 siblings, if it is that case every siblings can at least have 2 piece of popsicles (it's evenly distributed), should I give away the popsicles for them or eat all of them myself???

19th Feb 2020, 2:50 AM
Nkzlxs
Nkzlxs - avatar
3 Answers
+ 1
9 % 4 = 1 While in reality, you kept one so that the 4 kids each have 2 sweets; In the context of this question, you are not supposed to keep even one single sweet yourself. In other words, you SHOULD KEEP 0, and see if ALL the sweets can be given out evenly.
19th Feb 2020, 4:12 AM
Gordon
Gordon - avatar
+ 5
If you feel that the Popsicles cannot be evenly distributed, you eat them all yourself and let your sibling starve. If they can be evenly distributed, you get nothing while your siblings equally share them.
19th Feb 2020, 2:55 AM
👑 Prometheus 🇸🇬
👑 Prometheus 🇸🇬 - avatar
+ 3
Nkzlxs the question want that either you eat the popsicles or your siblings. So just like 👑 Prometheus 🇸🇬 said , if ALL of the popsicles can be evenly distributed then only you should give the box to your siblings otherwise they will fight.
19th Feb 2020, 3:00 AM
Arsenic
Arsenic - avatar