CF1047A Little C Loves 3 I

版权声明:大佬您能赏脸,蒟蒻倍感荣幸,还请联系我让我好好膜拜。 https://blog.csdn.net/ShadyPi/article/details/82917034

原题链接:http://codeforces.com/contest/1047/problem/A

Little C Loves 3 I

Little C loves number «3» very much. He loves all things about it.

Now he has a positive integer n n . He wants to split n n into 3 3 positive integers a , b , c a,b,c , such that a + b + c = n a+b+c=n and none of the 3 3 integers is a ultiple of 3 3 . Help him to find a solution.

Input

A single line containing one integer n ( 3 n 1 0 9 ) n (3≤n≤10^9) — the integer Little C has.

Output

Print 3 3 positive integers a , b , c a,b,c in a single line, such that a + b + c = n a+b+c=n and none of them is a multiple of 3 3 .

It can be proved that there is at least one solution. If there are multiple solutions, print any of them.

Examples
input

3

output

1 1 1

input

233

output

77 77 79

题解

如果 n   m o d   3 = 0 n\ mod\ 3=0 输出 1 , 1 , n 2 1,1,n-2 ,否则输出 1 , 2 , n 3 1,2,n-3

代码
#include<bits/stdc++.h>
using namespace std;
int n;
void in(){scanf("%d",&n);}
void ac(){n%3?printf("1 2 %d",n-3):printf("1 1 %d",n-2);}
int main(){in();ac();}

猜你喜欢

转载自blog.csdn.net/ShadyPi/article/details/82917034