Sum of three
Medium
Execution time limit is 2 seconds
Runtime memory usage limit is 128 megabytes
Given an array of integers and an integer . Find a triplet of numbers in the array whose sum equals . All indices should be different.
Input
The first line contains the size of the array and the value of . The second line contains integers, each of which does not exceed in absolute value.
Output
If the required triplet exists, print it in any order. If multiple triplets exist, print any one of them. If the desired triplet does not exist, print .
Examples
Input #1
Answer #1
Submissions 3K
Acceptance rate 25%