diff --git a/CodeForces/31-A.cpp b/CodeForces/31-A.cpp new file mode 100644 index 0000000..91c1f2b --- /dev/null +++ b/CodeForces/31-A.cpp @@ -0,0 +1,40 @@ +#include + +using namespace std; + +int main() +{ + int n, a[101]; + scanf("%d", &n); + for (int i = 1; i <= n; ++i) + { + scanf("%d", &a[i]); + } + + bool found = false; + for (int i = 1; !found && i <= n; ++i) + { + for (int j = 1; !found && j <= n; ++j) + { + if (j != i) + { + for (int k = j + 1; k <= n; ++k) + { + if (k != i && a[i] == a[j] + a[k]) + { + printf("%d %d %d\n", i, j, k); + found = true; + break; + } + } + } + } + } + + if (!found) + { + printf("-1\n"); + } + + return 0; +}