2019 XCPC Newbie Selection #2 (Nordic Collegiate Programming Contest 2018)

H. House Lawn
PDF 题面可用
你可以在这里下载。

单点时限: 1.0 sec

内存限制: 512 MB

样例

Input
7000 4
Grass Slayer 2000,9999,10,120,120
Slow-Mowe,999,1,120,240
Eco-cut X2,5499,2,25,35
Mowepower,5499,3,25,35
Output
Eco-cut X2
Mowepower
Input
100000 4
Grass Slayer 2000,9999,10,120,120
Slow-Mowe,999,1,120,240
Eco-cut X2,5499,2,25,35
Mowepower,5499,3,25,35
Output
no such mower