0
点赞
收藏
分享

微信扫一扫

Sum is K

舍予兄 2022-01-20 阅读 66
c++

描述:

Given a sequence of N numbers. Find different numbers A and B in the sequence so that the sum of A and B equals to K.

输入:

First line: two positive integers N (N <= 1000) and K (K <= 1000000).
Second line: N positive integers (<= 1000000).

输出:

Two integers A and B.

样例输入:

5 12
2 4 7 3 9

样例输出:

3 9

描述

提供一个n个数字的序列,在序列中找出不同的两个数A和B,使得A+B=K。

输入

第一行:两个正整数N和K

第二行:N个正整数

输出

两个整数A和B

举报

相关推荐

0 条评论