Important: program should allow user to put inputSAMPLE inputs from attached file are ONLY for reference on how the program should run. i dont want to program only to run on the sample inputs. it should work with any inputs the user enters
Alfons wants to set up a hot dog stand. He has done some research to find out how many Czech crowns (Kč) people are willing to pay for a hot dog. This has yielded a large set of integers, each of which indicates the maximum price that a certain person will pay.
Alfons wants to set his price to maximize his revenue. If the price is too low, almost everyone will buy a hot dog, but the income from each hot dog he sells will be small. If the price is too high, few people will buy a hot dog and so Alfons's total revenue will also be small.
The program's input consists of integers in the range from 1 to 1000 onone or more lines, separated by whitespace. Each of these indicates the maximum price that one customer has said he/she will pay for a hot dog. The numbers in the input are not sorted in any way, and values may appear more than once.
The program should write a single integer to standard output: the selling price of a single hot dog such that Alfons's revenue will be as large as possible. If there is more than one price that will achieve the maximum revenue, the program should write thelowestof these.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here