2021-2022 ICPC, Moscow Subregional |
---|
Finished |
You are given six positive integers $$$a$$$, $$$b$$$, $$$c$$$, $$$d$$$, $$$e$$$ and $$$f$$$. You need to find out whether there exists a triangle $$$ABC$$$ with the following properties.
If such triangle exists, find the minimum possible value of its perimeter.
The input consists of six lines, each containg one integer $$$a$$$, $$$b$$$, $$$c$$$, $$$d$$$, $$$e$$$ and $$$f$$$ ($$$1 \leq a, b, c, d, e, f \leq 1000$$$) respectively.
If there is no triangle satisfying all the properties, print -1. Otherwise, print one integer — the minimum possible perimeter of such triangle.
1 1 2 2 3 3
1
1 2 3 4 5 6
-1
1 2 2 3 3 1
-1
Name |
---|