#B. AtCoder Alloy

    Type: Default 1000ms 256MiB

AtCoder Alloy

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

AtCoder Alloy

题面翻译

题目描述

NN 块特殊金属“AtCoder 合金”制成的长方形板材,长宽分别是 Ai×BiA_i \times B_i

高桥同学想要一块长宽正好是 H×WH \times W 的 AtCoder 合金板,因此需要从这 NN 块板材中选出一块。如果有必要的话可以做切割,切割必须平行于长宽。另外,板材的方向固定,不可以旋转。例如,5×35 \times 3 的板材不可以当作 3×53 \times 5 的来用。

在这 NN 块板材中,有多少块在适当切割后可以制成 H×WH \times W 的金属板?

输入格式

第一行三个正整数 N,H,WN,H,W,接下来 NN 行每行两个整数 Ai,BiA_i,B_i 表示第 ii 块金属的长和宽。

输出格式

一个整数表示答案。

样例 #1

样例输入 #1

3 5 2
10 3
5 2
2 5

样例输出 #1

2

样例 #2

样例输入 #2

10 587586158 185430194
894597290 708587790
680395892 306946994
590262034 785368612
922328576 106880540
847058850 326169610
936315062 193149191
702035777 223363392
11672949 146832978
779291680 334178158
615808191 701464268

样例输出 #2

8

数据范围

1  N  10001\ \leq\ N\ \leq\ 1000
1  H,W,Ai,Bi  1091\ \leq\ H,W,A_i,B_i\ \leq\ 10^9

样例解释 1

高桥同学想要 5×25 \times 2 的金属板。

11 块板是 10×310 \times 3,适当切割后可以得到 5×25 \times 2 的板。

22 块板是 5×25 \times 2,无需切割即可得到 5×25 \times 2 的板。

33 块板是 2×52 \times 5,无论怎样切割都无法得到 5×25 \times 2 的板。请注意,板材不能旋转当作 5×25 \times 2 的来用。

20240910集训

Not Attended
Status
Done
Rule
IOI(Strict)
Problem
6
Start at
2024-9-10 19:00
End at
2024-9-10 21:00
Duration
2 hour(s)
Host
Partic.
26