#C7718. Find Pair with Sum
Find Pair with Sum
Find Pair with Sum
Given a sequence of n integers and a target integer \(T\), your task is to find two distinct numbers in the sequence whose sum is equal to \(T\). Here, distinct means the two numbers must have different values; even if the same number appears more than once in the sequence, using two identical numbers is not allowed.
If such a pair exists, output the two numbers in the order they appear in the list (first valid pair found). Otherwise, output "No pair found".
inputFormat
The input is given via standard input (stdin) and consists of three parts:
- The first line contains an integer \(n\) representing the number of elements in the sequence.
- The second line contains \(n\) space-separated integers representing the sequence.
- The third line contains an integer \(T\) which is the target sum.
outputFormat
Output a single line (to standard output, stdout) containing two distinct integers whose sum equals \(T\). If no such pair exists, output "No pair found".
## sample5
1 2 3 4 5
9
4 5
</p>