#P330. 【例56.1】 和为给定数
【例56.1】 和为给定数
Description
Given several integers, determine if there exists a pair of numbers whose sum equals a given value.
Input Format
Three lines:
The first line contains an integer (), representing the number of integers.
The second line contains integers. The integers range from to .
The third line contains an integer (), representing the target sum.
Output Format
If there exists a pair of numbers whose sum equals , output two integers, with the smaller one first, followed by the larger one, separated by a single space. If multiple pairs satisfy the condition, choose the pair with the smallest first number. If no such pair exists, output "No".
Sample
4
2 5 1 4
61 5