#include<iostream>
usingnamespace std;
void mcnuggets(int n);
int main(){
int input[9],size[10];
cout<<"Welcome to McDonald's HK, what would you like to order?";
cout<<"(A)How many of Chicken McNuggets(s) you want to order(at least 4)? ";cin>>input[0];
cout<<"(B)How many set of McWings(s) you want to order? ";cin>>input[1];
cout<<"(C)How many of McSpicy Chicken Filet(s) you want to order? ";cin>>input[2];
cout<<"(D)How many of Sausage McMuffin with Egg(s) you want to order? ";cin>>input[3];
cout<<"(E)How many of Filet - O - Fish(s) you want to order? ";cin>>input[4];
cout<<"(F)How many of (small) Soft Drink(s) you want to order? ";cin>>input[5];
cout<<"(G)How many of (small) Fries(s) you want to order? ";cin>>input[6];
cout<<"(H)How many of Apple Pie(s) you want to order? ";cin>>input[7];
cout<<"(I)How many of Ice - cream(s) you want to order? ";cin>>input[8];
if(input[0]==4 || (input[0]>=6 && (input[0]%3==0 || (input[0]-4)%3==0) ) ){
if((input[0]-4)%3==0) input[0]-=4;
if(input[0]!=4) mcnuggets(input[0],size[0],size[1]);
}
else cout<<"No solution !"<<endl;
cout<<size[0]<<" "<<size[1]<<endl;
return 0;
}
void mcnuggets(int n,int value1,int value2){
bool stop(0);
for(int i=0;i<=n/6;i++){
if (stop)break;
for(int x=0;x<=n/6;x++){ //n/6 is the largest posible no. of meals or A la carte
if(n-i*6-x*9==0){
value1=i;
value2=x;
stop=1;
break;
}
}
}
}