#C4177. Sum Pairs
Sum Pairs
Sum Pairs
We define a sum pair as a pair of numbers (a) and (b) from a given list such that (a+b=s), where (s) is a target sum. Given a list of integers and a target sum (s), your task is to find the first pair (in the order they appear) that satisfies this equation. If no such pair exists, output None
.
inputFormat
Input is read from standard input. The first line contains a list of space-separated integers. The second line contains a single integer (s), the target sum.
outputFormat
If a valid pair is found, output the two numbers separated by a space. Otherwise, output None
.## sample
1 4 8 7 3 15
8
1 7