with rand() it would be too easy!

19531 is the result if all rand5() return 1. so it's the minimum. i want the minimum to be 0 though so i do the subtraction.

hm... i think this solution isn't 100% mathematically correct though even if it seems to give correct results. the error just seems to get smaller the more rand5() you use in that row.

i think there is no solution without while() or if().