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