There are total 2000 chocolates that are to be distributed among 500 students.
Write a program to find out how many chocolates each student will get?
Answers
Answer:
4 chocolates is the answer
Answer:
Assuming the chocolates are identical , the answer would be the number of factors of 500 - 1 .
By finding the factors we will know how many ways 500 can be divided into different integers .
For example 2 is a factor of 500 and thus 500 can be equally distributed between 2 people equally( each get 250 chocolates)
it cannot be distributed equally among 3 people because 3 is not a factor of 500.
4 is a factor and hence 500 distributed among 4 people is possible . ( each get 125 chocolates)
Thus finding the number of factors of 500 is necessary.
splitting 500 into powers of prime numbers we get 500=2^2 * 5^3
So the number of factors of 500 = (2+1)*(3+1) = 12
And here we need to note down that out of 12 factors , 1 is also a factor . But giving all chocolates to one person cannot be considered as distributing equally.
so the number of ways 500 can be distributed equally is 12–1 =11 .
Explanation: