You have decided to enter your alpaca into the annual Alpaca Racing Tournament! The race will be run around a track of length ate too many Cheetos got injured while training for the race. Desperate to win, you hack into the tournament software containing the speeds of all alpacas to see if there is a chance of victory. The speed of the
Constraints
For all subtasks:
Subtask 1 [10%]
Subtask 2 [90%]
No additional constraints.
Input Specification
The first line of input will contain 4 integers
The next
The final line of input will contain
Output Specification
You are to output YES
if you can win the race outright after using the device at most NO
otherwise.
Note: For this problem, you will NOT be required to pass the sample cases in order to receive points. In addition, you must pass all previous subtasks to earn points for a specific subtask.
Sample Input 1
2 12 3 30
100
50
50
Sample Output 1
YES
Explanation for Sample Output 1
The first alpaca finishes in
You use the device on the first alpaca twice, bringing his speed down to
Sample Input 2
4 200 1 1
1000
12
2134
22
1
Sample Output 2
NO
Comments
To clarify any confusion, if the result of the speed equation is not an integer, it must be rounded down to the nearest integer:
Thanks so much! I was having major problems, then I saw this comment which helped me. The author may need to update to add additional information as to not potentially confuse newcomers.
I keep on getting the wrong answer for the 2nd problem and have no idea why. Any help?
Hello! Keep in mind that the question asks for d / speeds[i]. Not only speeds[i]! Also, you need to account for ties, as ties still count as "NO". I'm not too familiar with the java mechanics though, because it does get IR on test case 3 (but it passes test case 2!)
Can someone tell me why im failing test case 7 in subtask 2?
I was very confused too. It turns out, make sure that the alpaca speeds are typecasted to integers, or else funky dmoj stuff happens. Let me know if this helps :)
cheeto diet time
Nowhere in the problem do I read that the alpaca speeds (after using the device) must be integer values. This has a huge impact on the problem.
the statement
uses the floor function, which rounds down to the nearest integer.
Im missing something, why does
matter? As far as I could tell, the objective is to calculate the speed of the 
fastest opponents after using the device as much as possible and then check if your alpaca is the fastest afterwards. so why does 
matter? im sure it does have a part in the answer but i can't see how can someone help
sorry i did not know editorials could be used like that