#K65612. Find a Pair with Given Sum

    ID: 32237 Type: Default 1000ms 256MiB

Find a Pair with Given Sum

Find a Pair with Given Sum

You are given an array of n integers and a target value k. Your task is to determine whether there exist two distinct indices i and j such that the sum of the elements at these indices is equal to k. In other words, check if there exist i and j (with i \neq j) such that \(a_i + a_j = k\).

Note: Even if the same number appears more than once in the array, they are considered distinct elements as long as their indices are different.

The problem requires reading from standard input and writing the result to standard output.

inputFormat

The first line of input contains two integers n and k separated by a space, where n is the number of elements in the array and k is the target sum. The second line contains n space-separated integers representing the array.

outputFormat

Print True if there exists at least one pair of distinct elements in the array whose sum equals k, otherwise print False.

## sample
5 10
1 2 3 9 11
True