#include <iostream>using namespace std; int value[3]={5,3,1}; int weight[3]={1,1,3}; int num[3]={0,0,0}; int BuyHen(int money,int i) { if(i==2) { if(money%value[i]==0) { num[i]=weight[i]*money/value[i]; if(num[0]+num[1]+num[2]==100) { cout<<num[0]<<" "<<num[1]<<" "<<num[2]<<endl; return 1; } return 0; } for(int m=0;m<=money;m++) { if(m%value[i]==0) { num[i]=weight[i]*m/value[i]; BuyHen(money-m,i+1); } } } int main() { int i; cin>>i; BuyHen(100,0); }