# Nuts, girl and boys

Milena collected fallen nuts and called a bunch of boys let them share. She took a condition: the first boy takes one nut and tenth of the rest, the second takes 2 nuts and tenth new rest, the third takes 3 nuts and tenth new rest and so on. Thus managed to distribute all the nuts and everyone got same amounth.

Determine how many nuts gathered Milena and many boys divided the nuts.

Result

nuts:  81
boys:  9

#### Solution:

Program in PHP:
```for(\$o=2;\$o<1000; \$o++)
{
\$oo = \$o;
\$ch = 1;

\$stack = array();
do
{
\$d = \$ch + (\$oo-\$ch)/10;
if(\$d != (int)\$d)
{
continue(2);
}
\$oo -= \$d;
\$ch++;
\$stack[] = \$d;
}while(\$oo>0);

if(\$oo==0)
{
echo "nuts=\$o boys=\$ch";
print_r(\$stack);
exit;
}
}
```

Leave us a comment of example and its solution (i.e. if it is still somewhat unclear...):

Be the first to comment!

## Next similar examples:

1. Cuboid walls
Calculate the volume of the cuboid if its different walls have area of 195cm², 135cm² and 117cm².
2. R triangle
Calculate the area of a right triangle whose longer leg is 6 dm shorter than the hypotenuse and 3 dm longer than the shorter leg.
3. Plumber
Plumber had to cut the metal strip with dimensions 380 cm and 60 cm to the largest squares so that no waste. Calculate the length of the sides of a square. How many squares cut it?
4. The Hotel
The Holiday Hotel has the same number of rooms on each floor. Rooms are numbered with natural numbers sequentially from the first floor, no number is omitted, and each room has a different number. Three tourists arrived at the hotel. The first one was in r
5. Segments
Line segments 62 cm and 2.2 dm long we divide into equal parts which lengths in centimeters is expressed integer. How many ways can we divide?
6. Sales of products
For 80 pieces of two quality products a total sales is 175 Eur. If the first quality product was sold for n EUR per piece (n natural number) and the second quality product after 2 EUR per piece. How many pieces of the first quality were sold?
7. The gardener
The gardener bought trees for 960 CZK. If every tree was cheaper by 12 CZK, he would have gotten four more trees for the same money. How many trees did he buy?
8. Right triangle eq2
Find the lengths of the sides and the angles in the right triangle. Given area S = 210 and perimeter o = 70.
9. MO Z8-I-1 2018
Fero and David meet daily in the elevator. One morning they found that if they multiply their current age, they get 238. If they did the same after four years, this product would be 378. Determine the sum of the current ages of Fero and David.
10. Digit sum
The digit sum of the two-digit number is nine. When we turn figures and multiply by the original two-digit number, we get the number 2430. What is the original two-digit number?
11. Diamond diagonals
Find the diamond diagonal's lengths if the area is 156 cm2 and side is 13 cm long.
12. Marriage sttus
In our city, there are 3/5 of the women married to 2/3 of the men. Find what part of the population is free.
13. Substitution method
Solve goniometric equation: sin4 θ - 1/cos2 θ=cos2 θ - 2
14. Right triangle Alef
The area of a right triangle is 294 cm2, the hypotenuse is 35 cm long. Determine the lengths of the legs.
15. Cherries
Cherries in the bowl can be divided equally among 8 or 10 or 11 children. How many is the minimum cherries in the bowl?
16. Diofant 2
Is equation ? solvable on the set of integers Z?
17. Seedcake
Seedcake costs 44 cents. How many minimum seedcakes we must buy that we can pay in cash only whole euros?