301190: CF222D. Olympiad

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

Olympiad

题意翻译

**题目描述** 共有$n$名选手分别参加了两场考试,并已知两场考试中$n$个人的得分两场考试中的得分都是任意顺序给出的。现仅得知小A在两场考试中获得的总分不小于$x$请你推算小A在这两次考试中最好的名次和最差的名次各是多少。按照两场考试的得分总和由高到低排名。 **输入描述** 第一行包含两个整数 n,x (1≤n≤10 5;0≤x≤2×10^5)分别表示参与考试的人数,以及小 A 两次成绩之和的最小值。第二行包含 n 个整数 a 1​ ,a 2​ ,...,a n(0≤a i​ ≤10^5),表示第一轮考试各个选手的成绩。第三行包含 n 个整数 b 1​,b2​,...,b n​ (0≤b i​≤10 5)表示第二轮考试各个选手的成绩。 ** 输出描述** 仅有一行,包含两个整数,分别表示小 A 在两次考试中可以得到的最好名次和最差名次。

题目描述

A boy named Vasya has taken part in an Olympiad. His teacher knows that in total Vasya got at least $ x $ points for both tours of the Olympiad. The teacher has the results of the first and the second tour of the Olympiad but the problem is, the results have only points, no names. The teacher has to know Vasya's chances. Help Vasya's teacher, find two numbers — the best and the worst place Vasya could have won. Note that the total results' table sorts the participants by the sum of points for both tours (the first place has the participant who has got the most points). If two or more participants have got the same number of points, it's up to the jury to assign places to them according to their choice. It is guaranteed that each participant of the Olympiad participated in both tours of the Olympiad.

输入输出格式

输入格式


The first line contains two space-separated integers $ n,x $ ( $ 1<=n<=10^{5}; 0<=x<=2·10^{5} $ ) — the number of Olympiad participants and the minimum number of points Vasya earned. The second line contains $ n $ space-separated integers: $ a_{1},a_{2},...,a_{n} $ ( $ 0<=a_{i}<=10^{5} $ ) — the participants' points in the first tour. The third line contains $ n $ space-separated integers: $ b_{1},b_{2},...,b_{n} $ ( $ 0<=b_{i}<=10^{5} $ ) — the participants' points in the second tour. The participants' points are given in the arbitrary order. It is guaranteed that Vasya was present in the Olympiad — there are two integers $ i,j $ $ (1<=i,j<=n) $ such, that $ a_{i}+b_{j}>=x $ .

输出格式


Print two space-separated integers — the best and the worst place Vasya could have got on the Olympiad.

输入输出样例

输入样例 #1

5 2
1 1 1 1 1
1 1 1 1 1

输出样例 #1

1 5

输入样例 #2

6 7
4 3 5 6 4 4
8 6 0 4 3 4

输出样例 #2

1 5

说明

In the first text sample all 5 participants earn 2 points each in any case. Depending on the jury's decision, Vasya can get the first (the best) as well as the last (the worst) fifth place. In the second test sample in the best case scenario Vasya wins again: he can win 12 points and become the absolute winner if the total results' table looks like that — {4:8, 6:4, 3:6, 4:4, 4:3, 5:0}. In this table all participants are sorted by decreasing points and we can see how much a participant earned in the first and in the second tour. In the worst case scenario Vasya can get the fifth place if the table looks like that — {4:8, 4:6, 6:4, 5:4, 4:3, 3:0}, and he earned 4 and 3 points in the first and second tours, correspondingly.

Input

题意翻译

**题目描述** 共有$n$名选手分别参加了两场考试,并已知两场考试中$n$个人的得分两场考试中的得分都是任意顺序给出的。现仅得知小A在两场考试中获得的总分不小于$x$请你推算小A在这两次考试中最好的名次和最差的名次各是多少。按照两场考试的得分总和由高到低排名。 **输入描述** 第一行包含两个整数 n,x (1≤n≤10 5;0≤x≤2×10^5)分别表示参与考试的人数,以及小 A 两次成绩之和的最小值。第二行包含 n 个整数 a 1​ ,a 2​ ,...,a n(0≤a i​ ≤10^5),表示第一轮考试各个选手的成绩。第三行包含 n 个整数 b 1​,b2​,...,b n​ (0≤b i​≤10 5)表示第二轮考试各个选手的成绩。 ** 输出描述** 仅有一行,包含两个整数,分别表示小 A 在两次考试中可以得到的最好名次和最差名次。

加入题单

算法标签: