CF1725B Basketball Together

题目描述

在篮球比赛中,一个队的球员人数没有最大或最小限制(不一定每场比赛有 $5$ 名球员)。比赛中有 $N$ 名候选球员将由世界上最好的篮球教练 Pak Chanek 训练。第二个候选玩家具有 $P_i$ 的幂。 Pak Chanek 将从 $N$ 名候选球员中组成零支或多支球队,条件是每个候选球员最多只能加入一支球队。Pak Chanek 的每一支球队都将被派去与拥有 $D$ 力量的敌方球队进行一次比赛。在每一场比赛中,如果阵型球员的力量之和严格大于 $D$,则被派去的球队将被称为击败敌方球队。 Pak Chanek 的一项技能是,当一支已经组建的球队在比赛中比赛时,他可以改变球队中每个球员的力量,使之等于球队中最大的球员力量。 输出 Pak Chanek 可获得的最大获胜次数。

输入格式

第一行包含两个整数 $N$ 和 $D$($1 \le N \le 10^5 ,1 \le D \le 10^9$ ),候选球员的数量和敌方球队的实力。 第二行包含 $N$ 个整数 $P_1$、$P_2$、$\ldots$、$P_ N$($1≤P_i≤10^9$),所有候选玩家的权力。

输出格式

A line containing an integer representing the maximum number of wins that can be achieved by Pak Chanek.

说明/提示

The $ 1 $ -st team formed is a team containing players $ 4 $ and $ 6 $ . The power of each player in the team becomes $ 100 $ . So the total power of the team is $ 100 + 100 = 200 > 180 $ . The $ 2 $ -nd team formed is a team containing players $ 1 $ , $ 2 $ , and $ 5 $ . The power of each player in the team becomes $ 90 $ . So the total power of the team is $ 90 + 90 + 90 = 270 > 180 $ .