Author: Andrew Seidel
Student council is looking to organize a school brunch, where the proceeds will be put towards a year-end trip for the graduating class. The council members decide that the price depends on how many years you have been at the school. For someone who has been at the school for one year (
Out of all the proceeds,
Input Specification
The input contains
- For each of the trips, the first line will show the cost of the trip as an integer (
to ). - The next line contains four floating point numbers
, , , ( and ) representing the percentages of the total number of students from years through respectively. - The third line contains a single number
, which contains the total number of students attending the brunch .
Note: You cannot have less than a whole person (e.g.,
Output Specification
Output YES
if the student council needs to find other funding, and NO
if the council has raised sufficient funds.
Sample Input
4000
0.5 0.2 0.1 0.2
400
6000
0.1 0.1 0.45 0.35
2000
Sample Output
YES
NO
Note: Only
Educational Computing Organization of Ontario - statements, test data and other materials can be found at ecoocs.org
Comments
As an improvement to this problem, I want to point out that the one can write a script that takes the Sample Input and provides the Sample Output and still miss a couple of important details that cause the submitted solution to fail.
I find one entirely my fault; I didn't read the instructions clearly and left out a step.
On the other, my script worked for all but the final test, and I disagree with this assessment. I tracked down the part of the code that lead to it failing, and resubmitted for full points. That said, I feel that my original code with a"<=" should have not failed, and that the working code with a "<" should fail.