P3112 [USACO14DEC] Guard Mark G
Description
Farmer John and his herd are playing frisbee. Bessie throws thefrisbee down the field, but it's going straight to Mark the field handon the other team! Mark has height H (1
Input Format
INPUT: (file guard.in)
The first line of input contains N and H.
The next N lines of input each describe a cow, giving its height,weight, and strength. All are positive integers at most 1 billion.
Output Format
OUTPUT: (file guard.out)
If Bessie's team can build a stack tall enough to catch the frisbee, please output the maximum achievable safety factor for such a stack.
Otherwise output "Mark is too tall" (without the quotes).