class PeachNum
{
public static void main(String[] args)
{
int num;
int total = 5;
boolean b = true;
while (b)
{
total++;
num = total;
for(int x=0;x<5;x++)
{
if(((num-1)%5)!=0)
break;
else
num= 4*(num-1)/5;
if (x==4)
{
b = false;
System.out.println("共有"+total+"个桃子");
}
}
}
for(int x=1;x<=5;x++)
{
int m = (total-1)/5;
System.out.println("第"+x+"只猴子拿了" +m+"个桃子。");
total = 4*m;
}
}
}