Skip to content
geeksforgeeks
  • Tutorials
    • Python
    • Java
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
    • Practice Coding Problems
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • Quantitiative Aptitude
  • Logical Reasoning
  • Verbal Ability
  • Aptitude Quiz
  • Quantitiative Aptitude Quiz
  • Verbal Ability Quiz
  • Aptitude For Placements
  • Interview Corner
  • Practice Sets
Open In App
Next Article:
Puzzle | 100 Cows And Milk
Next article icon

Puzzle | 100 Cows And Milk

Last Updated : 22 Apr, 2024
Comments
Improve
Suggest changes
Like Article
Like
Report

A milkman has 100 cows number from 1 to 100. Every cow gives milk according to their numbers i.e i'th cow gives i litre milk. Milkman has 10 sons and he wants to divide his cows among his 10 sons so that every son should get an equal amount of milk, the task is to help him to know about the division of these cows among the sons.

Solution: As we know that the i'th cow gives i litre milk. So first let us count the total litre of milk which is obtained from these cows. This can be solved by using arithmetic progression sum.

We know that sum of n numbers starting from 1 is always, sum = n*(n+1)/2 .

So the total quantity of milk obtained if from 100 cows is total_milk = 100(100+1)/2=5050 litres.

As the problem says that the division of the cows should be done in a manner that every son get equal amount of milk. So every son should got 5050/10 = 505 litres of milk.

Now our main problem is to divide 1 to 100 numbers in such a way that every sons should get 10 cows who's number sum up to 505.

Let us reduce the complexity of this puzzle using the below example:

Now let us suppose you have 10 numbers and you have to divide it in to 5 people so that each one get equal sum of this numbers. so this 10 numbers sum up to 55 now each of the 5 people will get 11 as a sum so its obvious that every people will get two numbers whose sum is 11. so the division would be like this:

First_person ---> 1, 10
Second_person ---> 2, 9
Third_person ---> 3, 8
Fourth_person ---> 4, 7
Fifth_person ---> 5, 6 so each person will get 11 .

Now coming back to the problem, we have 100 numbers we have to divide this in 10 groups so that each son get 505 litre of milk. So,

First_son ---> 1, 2, 3, 4, 5, 96, 97, 98, 99, 100
Second_son ---> 6, 7, 8, 9, 10, 91, 92, 93, 94, 95
Third_son ---> 11, 12, 13, 14, 15, 86, 87, 88, 89, 90
Fourth_son ---> 16, 17, 18, 19, 20, 81, 82, 83, 84, 85
Fifth_son ---> 21, 22, 23, 24, 25, 76, 77, 78, 79, 80
Sixth_son ---> 26, 27, 28, 29, 30, 71, 72, 73, 74, 75
Seventh_son ---> 31, 32, 33, 34, 35, 66, 67, 68, 69, 70
Eighth_son ---> 36, 37, 38, 39, 40, 61, 62, 63, 64, 65
Ninth_son ---> 41, 42, 43, 44, 45, 56, 57, 58, 59, 60
Tenth_son ---> 46, 47, 48, 49, 50, 51, 52, 53, 54, 55

as the problem said each son should get equal amount of milk.


Next Article
Puzzle | 100 Cows And Milk

A

Asif_jafri
Improve
Article Tags :
  • Aptitude

Similar Reads

    Puzzle 39 | (100 coins puzzle)
    This puzzle is similar to 10 Coins Puzzle. Question: 100 coins are lying flat on a table. 10 of them are heads up and 90 are tails up.You can't see which one is which.How can we split the coins into two piles such that there are same number of heads up in each pile? Note: It is allowed to flip the c
    1 min read
    Puzzle 11 | ( 1000 Coins and 10 Bags )
    A dealer has 1000 coins and 10 bags. He has to divide the coins over the ten bags so that he can make any number of coins simply by handing over a few bags. How must divide his money into the ten bags? Find the ages of daughters Solution: The idea of filling coins in the powers of 2 can be get from
    2 min read
    Puzzle - Bank Cashier Mistake
    You went to a bank to cash your check. The bank clerk accidentally gives you: The dollar amount is in cents, and the Cent amount is in dollars. You spend 5 cents on the way home, and then you realize you have twice the amount of your cheque. What was the actual amount that was written on the cheque?
    3 min read
    Puzzle - Ali and 8 Loaves
    Question:Two men were dining together. Five loaves of bread were brought by the first man, and three by the second. Ali, a third man, arrived and joined them. They ate all eight loaves together. Ali offered the men 8 coins as a thank-you gift before he left. The first man offered to take 5 coins and
    2 min read
    Puzzle | Rat and Poisonous Milk Bottles
    You have 4 bottles of milk. One of them is poisonous while the other 3 are non-poisonous. There is a rat which dies exactly after 10 hours of drinking the poisoned bottle. You have a clock that measures time only in hours. Suggest an optimal strategy to identify the poisoned bottle within 24 hours.
    1 min read
geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences