Sum of three values - MarisaOJ: Marisa Online Judge

Sum of three values

Time limit: 1000 ms
Memory limit: 256 MB
Given an array $A$ of $n$ integers. Find 3 different indices $i, j, k$ that $A_i + A_j + A_K$ = $x$. ### Input - The first line contains 2 integers $n, x$. - The second line contains $n$ integers $A_i$. ### Output - Print $i, j, k$. If there are multiple answer, print any of them. It is guaranteed that at least 1 answer exists. ### Constraints - $1 \le n \le 5000$. - $1 \le A_i, x \le 10^9$ ### Example Input: ``` 4 8 1 2 5 7 ``` Output: ``` 1 2 3 ```