Pupils contributed some money to help needy people. They bought twenty four 2-kg packets of flour, thirty six 1-kg packets of flour and a 50 kilogram bag of sugar. The flour was packed in 500g packets and the sugar in 250 g packets. How many people got both a packet of flour and a packet of sugar?

packets of flour: 24*2000 / 500 = 96

packets of sugar: 36*1000 / 250 = 144

so, what next? Did they hand out packets of both as long as they had both, or did they just give one or the other to anyone?

To find out how many people got both a packet of flour and a packet of sugar, we need to calculate the total amount of flour and sugar available and then determine how many 500g flour packets and 250g sugar packets we can make from it.

First, let's calculate the total amount of flour:
- 24 packets of 2kg flour each: 24 * 2kg = 48kg
- 36 packets of 1kg flour each: 36 * 1kg = 36kg

The total amount of flour is 48kg + 36kg = 84kg.

Next, let's determine the number of 500g flour packets we can make from this amount:
- 1kg is equivalent to 1000g, so 84kg is equal to 84kg * 1000g/kg = 84000g of flour.
- Since each packet of flour is 500g, the number of 500g flour packets is 84000g / 500g = 168.

Now, let's calculate the total amount of sugar:
- 1 bag of sugar weighing 50kg.

The total amount of sugar is 50kg.

Next, let's determine the number of 250g sugar packets we can make from this amount:
- 1kg is equivalent to 1000g, so 50kg is equal to 50kg * 1000g/kg = 50000g of sugar.
- Since each packet of sugar is 250g, the number of 250g sugar packets is 50000g / 250g = 200.

Finally, to find out how many people got both a packet of flour and a packet of sugar, we need to find the minimum number of packets between flour and sugar. Since there are 168 packets of flour and 200 packets of sugar, the number of people who received both is 168 (the smaller number).

Therefore, 168 people got both a packet of flour and a packet of sugar.