public static double rand(double money, int people, List<Double> l) {
if (people == 1) {
double red = Math.round(money * 100) / 100.0;
l.add(red+0.01);
return 0;
}
Random random = new Random();
double min = 0;
double max = money / people * 2.0;
double red = random.nextDouble() * max;
red = red <= min ? min : red;
red = Math.floor(red * 100) / 100.0;
l.add(red+0.01);
double remain = Math.round((money - red) * 100) / 100.0;
return remain;
}