Official algorithmic problem description and constraints.
The price of one yogurt at the "Vosmiorochka" store is π burles, but there is a promotion where you can buy two yogurts for π burles.
Maxim needs to buy exactly π yogurts. When buying two yogurts, he can choose to buy them at the regular price or at the promotion price.
What is the minimum amount of burles Maxim should spend to buy π yogurts?
Detailed video explanations, mathematical intuition, and clean C++ implementation code.