2022年图森未来杯M题A Wine and Four Dishes

A Wine and Four Dishes

已放洛谷https://www.luogu.com.cn/problem/T443735
但是数据点不够全面欢迎大家私信我或者评论,帮助我增加数据点

题目背景

2022年zcpc M题目

题目描述

Teacher Rice has prepared a feast for himself. The feast contains x bottles of wine and y dishes, which
means he needs x cups and y plates.
There are n boxes. The i-th box contains ai cups and bi plates. Please help Teacher Rice to determine the
minimum number of boxes he has to open so that he can collect enough cups and plates. If it is impossible
for Teacher Rice to collect enough cups or plates, output “IMPOSSIBLE” instead.

输入格式

The first line contains three integers n, x, y (1 ≤ n ≤ 32, 0 ≤ x ≤ 1, 0 ≤ y ≤ 4).
The i-th of the following n lines contains two integers ai
, bi (0 ≤ ai ≤ 1, 0 ≤ bi ≤ 4).

输出格式

Output the minimum number of boxes Teacher Rice has to open. If it’s impossible to collect enough cups
or plates, output “IMPOSSIBLE” instead.

样例 #1

样例输入 #1

2 1 4
1 4
0 2

样例输出 #1

1

样例 #2

样例输入 #2

2 1 4
0 4
0 4

样例输出 #2

IMPOSSIBLE

样例 #3

样例输入 #3

3 0 3
1 4 
0 1
0 2

样例输出 #3

1
  • 5
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值