CF1313B Different Rules
题目描述
## 题意简述
一项奥林匹克竞赛有着与普通竞赛不同的规则,它分成两轮,假如一位参赛者在第一轮中排名第 $x$ 名,在第二轮中排名第 $y$ 名,则他的总分是 $x+y$,他的总排名是总分小于等于 $x+y$ 的参赛者(包括他自己)。需要注意的是,每一轮比赛都不会出现并列的情况,每一个排名 $i$ 都对应了唯一的参赛者。
尼古拉被告知他第一轮排名第 $x$ ,第二轮排名第 $y$ ,他需要你帮助他算出他可能获得的最好总排名和最差总排名
输入格式
第一行一个整数 $t(1≤t≤100)$,表示有 $t$ 组测试数据
以下 $t$ 行每行三个整数 $n,x,y(1≤n≤10^9,1≤x,y≤n)$ 表示有 $n$ 名参赛者,尼古拉在第一轮和第二轮分别排名 $x,y$
输出格式
共 $t$ 行,每行两个整数,尼古拉可能获得的的最好总排名和最差总排名
说明/提示
Explanation for the first example:
Suppose there were 5 participants A-E. Let's denote Nikolay as A. The the most favorable results for Nikolay could look as follows:
However, the results of the Olympiad could also look like this:
In the first case Nikolay would have taken first place, and in the second — third place.