The amount of extra kids you can feed is the minimum amount of excess you have for each of the fruits you're buying. For example, if you have $1$ extra apple, $2$ extra bananas and $3$ extra oranges, then the amount of kids you can feed is:
$$\min(1,2,3)=1$$
You can find these $\min$ values using the following method. Let's pretend we have $10$ kids. Then we find that:
$$\frac{10\text{ kids}}{3\text{ apples}}=3\text{ Remainder }1$$
$$\frac{10\text{ kids}}{7\text{ bananas}}=1\text{ Remainder }3$$
$$\frac{10\text{ kids}}{4\text{ oranges}}=2\text{ Remainder }2$$
This calculation tells us how many bags of each fruit we need to buy in order to feed our $x=10$ kids. Obviously we cannot buy partial bags, so we can take the remainder terms and subtract it from the amount of each type of fruit, i.e.:
$$\text{For apples: }3-1=2$$
$$\text{For bananas: }7-3=4$$
$$\text{For oranges: }4-2=2$$
These values tell us how many fruit we have extra from each bag. As I stated at the beginning, you can take the $\min$ of these to find how many kids $y$ you can feed extra, in this case:
$$\min(2,4,2)=2\text{ Extra Kids}$$
Generally, for some number $x$, you can take the modulo of $x$ (what will provide you the remainder term in the above calculation) to find the remainder term for each fruit, then subtract that number from the amount of fruit sold in each bag, and then take the $\min$ of those numbers. So:
$$y=\min(a,b,o),\text{ where}$$
$$a=3-(x\mod(3)),b=7-(x\mod(7)),o=4-(x\mod(4))$$