-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.c
More file actions
executable file
·59 lines (51 loc) · 1.34 KB
/
main.c
File metadata and controls
executable file
·59 lines (51 loc) · 1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/******************************************************************************
Online C Compiler.
Code, Compile, Run and Debug C program online.
Write your code in this editor and press "Run" button to compile and execute it.
*******************************************************************************/
#include <stdio.h>
int main()
{
int a, b, d, r1, r2, r3;
scanf("%d", &a);
b = a / 3;
d = a % 3;
if (a > 4)
{
if (b % 2 == 1)
{
if (d == 0 || d == 2 || a <= 3)
{
printf("\nNo");
} else if (d == 1)
{
r1 = b - 1;
r2 = b + 1;
r3 = b + 1;
printf("\nYes");
printf("\n%d %d %d", r1, r2, r3);
}
} else if (b % 2 == 0)
{
if (d == 1)
{
printf("\nNo");
} else if (d == 2)
{
r1 = b;
r2 = b;
r3 = b + 2;
printf("\nYes");
printf("\n%d %d %d", r1, r2, r3);
} else
{
printf("\nYes");
printf("\n%d %d %d", b, b, b);
}
}
} else
{
printf("\nNo");
}
return 0;
}