We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
  • Practice
  • Certification
  • Compete
  • Career Fair
  • Hiring developers?
  1. Practice
  2. Algorithms
  3. Implementation
  4. Chocolate Feast
  5. Discussions

Chocolate Feast

Problem
Submissions
Leaderboard
Discussions
Editorial
Topics

    You are viewing a single comment's thread. Return to all comments →

  • dheeraj 6 years ago+ 0 comments
    43203 / 60 = 720 chocolates ( 3 dollars left and you cannot buy any more chocolate for 3 dollar ) 
    
    720 / 5 = 144 chocolates ( we can buy 144 chocolates from 720 wrappers ) 
    
    144 / 5 = 28 chocolates ( we can buy 28 chocolates from 144 wrappers, 4 wrappers left ) 
    
    (28 + 4 ) / 5 = 6 ( 28 wrappers + 4 wrappers left from 144, we can buy 6 chocolates ) 
    
    (6 + 2) / 5 = 1 ( 6 wrappers + 2 wrappers left from 32 wrappers, we can buy 1 chocolate ) 
    
    
    This sums to 720 + 144 + 28 + 6 + 1 = 899.
    
    45|
    ParentPermalink
  • Contest Calendar
  • Blog
  • Scoring
  • Environment
  • FAQ
  • About Us
  • Support
  • Careers
  • Terms Of Service
  • Privacy Policy
  • Request a Feature