显示代码纯文本
#include<cstdio>
using namespace std;
int noi(){
freopen("noi_online2020pj_order.in","r",stdin);
freopen("noi_online2020pj_order.out","w",stdout);
int n,nn;
scanf("%d",&n);
if(n==1||n==2||n==5)
printf("-1");
else if(n%7==0)
printf("%d %d %d",n/14,n/7-n/14,n/7-n/14);
else if(n%7==1)
if(n>8){
if((n/7)%2==1)
printf("%d %d %d",n/14,n/7-n/14+1,n/7-n/14-1);
if((n/7)%2==0)
printf("%d %d %d",n/14-1,n/7-n/14-1,n/7-n/14+4);
}
else
printf("%d %d %d",(n/7-1)/2,n/7-(n/7-1)/2+1,n/7-(n/7-1)/2-1);
else if(n%7==2)
printf("%d %d %d",(n/7-1)/2,n/7-(n/7-1)/2-1,n/7-(n/7-1)/2+2);
else if(n%7==3&&(n/7)%2==0)
printf("%d %d %d",n/14,n/14,n/14+1);
else if(n%7==3&&(n/7)%2==1)
printf("%d %d %d",n/14,n/14+1,n/14+2);
else if(n%7==4)
printf("%d %d %d",n/14,n/7-n/14+1,n/7-n/14);
else if(n%7==5)
printf("%d %d %d",(n/7-1)/2,n/7-(n/7-1)/2-1,n/7-(n/7-1)/2+3);
else if(n%7==6)
printf("%d %d %d",n/14,n/7-n/14,n/7-n/14+2);
return 0;
}
int lol=noi();
int main(void){;}