CF1102C.Doors Breaking and Repairing

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

You are policeman and you are playing a game with Slavik. The game is turn-based and each turn consists of two phases. During the first phase you make your move and during the second phase Slavik makes his move.

There are nn doors, the ii -th door initially has durability equal to aia_i .

During your move you can try to break one of the doors. If you choose door ii and its current durability is bib_i then you reduce its durability to max(0,bix)max(0, b_i - x) (the value xx is given).

During Slavik's move he tries to repair one of the doors. If he chooses door ii and its current durability is bib_i then he increases its durability to bi+yb_i + y (the value yy is given). Slavik cannot repair doors with current durability equal to 00 .

The game lasts 1010010^{100} turns. If some player cannot make his move then he has to skip it.

Your goal is to maximize the number of doors with durability equal to 00 at the end of the game. You can assume that Slavik wants to minimize the number of such doors. What is the number of such doors in the end if you both play optimally?

输入格式

The first line of the input contains three integers nn , xx and yy ( 1n1001 \le n \le 100 , 1x,y1051 \le x, y \le 10^5 ) — the number of doors, value xx and value yy , respectively.

The second line of the input contains nn integers a1,a2,,ana_1, a_2, \dots, a_n ( 1ai1051 \le a_i \le 10^5 ), where aia_i is the initial durability of the ii -th door.

输出格式

Print one integer — the number of doors with durability equal to 00 at the end of the game, if you and Slavik both play optimally.

输入输出样例

  • 输入#1

    6 3 2
    2 3 1 3 4 2
    

    输出#1

    6
    
  • 输入#2

    5 3 3
    1 2 4 2 3
    

    输出#2

    2
    
  • 输入#3

    5 5 6
    1 2 6 10 3
    

    输出#3

    2
    

说明/提示

Clarifications about the optimal strategy will be ignored.

首页