Back
Close

If it is a triangle...

Statement
In mathematics, when proving inequalities, we are sometimes given a statement that variables [[a]], [[b]] and [[c]] are edges of a triangle and thus [[a]]<[[b]]+[[c]], [[b]]<[[c]]+[[a]] and [[c]]<[[a]]+[[b]]. In such conditions, it is a good idea to introduce new variables [[x]], [[y]] and [[z]] so that: [[a]] = [[x]] + [[y]] [[b]] = [[y]] + [[z]] [[c]] = [[z]] + [[x]] Then the inequalities simplify down to 0<[[x]], 0<[[y]], and 0<[[z]]. Your task is to find these [[x]], [[y]] and [[z]].

Input description
<<Three lines:>> integers [[a]], [[b]] and [[c]] - the lengths of the three sides of an alleged triangle.

Output description
<<Three lines:>> [[x]], [[y]], [[z]] sorted in <<ascending order>>. [[x]], [[y]] and [[z]] may only be integers or half-integers, in which case output them with a "{{.5}}" ending. If a triangle with the given borders does not exist (positive [[x]], [[y]] and [[z]] do not exist), instead write "{{NO}}".

Constraints
0 < [[a]], [[b]], [[c]] ≤ 10^3

Game modes

Test cases
We all know the 3-4-5! Test
Input
3 4 5
Output
1 2 3

Validator 1 Validator
Input
32 40 52
Output
10 22 30

Let's try an isosceles triangle Test
Input
4 4 6
Output
1 3 3

Validator 2 Validator
Input
100 100 140
Output
30 70 70

Don't try to hack this! Test
Input
22 17 7
Output
1 6 16

Validator 3 Validator
Input
350 301 197
Output
74 123 227

Time to say NO Test
Input
2 4 2
Output
NO

Validator 4 Validator
Input
500 1000 500
Output
NO

Decimals Test
Input
5 6 4
Output
1.5 2.5 3.5

Validator 5 Validator
Input
42 50 71
Output
10.5 31.5 39.5

The final one... Test
Input
9 5 17
Output
NO

Validator 6 Validator
Input
107 99 298
Output
NO

Solution language

Solution

Stub generator input