public class Egg{
public static void main(String[] args){
int sum = 2856;
// 100,50,20,10,5,1
for(int i = 1; i <= sum / 100; i++){
for(int j = 1; j <= sum / 50; j++){
for(int k = 1; k <= sum / 20; k++){
for(int m = 1; m <= sum / 10; m++){
for(int n = 1; n <= sum / 5; n++){
for(int p = 1; p <= sum / 1; p++){
if(i * 100 + j * 50 + k * 20 + m * 10 + n * 5 + p * 1 ==
sum){
System.out.printf("100: %d, 50: %d, 20: %d, 10: %d, 5:
%d, 1: %d%n", i,j,k,m,n,p);
}
}
}
}
}
}
}
}
}