I need problem #1 Candy Store solved (just Candy Store problem only). You have to write the code in java.
Each problem should be submitted as one file, that has a main method.
The input is from standard in (you can use a Scanner and [url removed, login to view] to get this)
The output should go to standard out ([url removed, login to view])
Sometimes the problem is hard because conventional solution you might use are too slow. (Anything more than about 1 billion operations will be too slow for a single test case)
To get a problem correct you will need to handle every single edge case. For these problems your solution is either considered correct or incorrect, there is no way to get partial points.
A: Candy Store
You are walking with a friend, when you pass a candy store. You make a comment about
how unhealthy their wares are. Your friend issues an interesting challenge: who can be
the unhealthiest? Both of you will go into the store with the same amount of money.
Whoever buys candy with the most total calories wins!
Since you're a smart computer scientist, and since you have access to the candy store's
inventory, you decide not to take any chances. You will write a program to determine
the most calories you can buy. The inventory tells you the price and calories of every
item. It also tells you that there is so much in stock that you can buy as much of any kind
of candy as you want. You can only buy whole pieces of candy.
There will be multiple test cases in the input. Each test case will begin with a line with an
integer n (1≤n≤5,000), and an amount of money m ($0.01≤m≤$100.00), separated by a
single space, where n is the number of different types of candy for sale, and m is the
amount of money you have to spend. The monetary amount m will be expressed in
dollars with exactly two decimal places, and with no leading zeros unless the amount is
less than one dollar. There will be no dollar sign. Each of the next n lines will have an
integer c (1≤c≤5,000) and an amount of money p ($0.01≤p≤$100.00), separated by a
single space, where c is the number of calories in a single piece of candy, and p is the
price of a single piece of candy, in dollars and in the same format as m. The input will
end with a line containing '0 0.00'.
For each test case, output a single integer, indicating the maximum amount of calories
you can buy with up to m dollars. Output no spaces, and do not separate answers with
If anyone can help me please let me know.
15 freelancers estão ofertando em média $23 para esse trabalho
I am a coder I would love to help. I have no bad reviews and speak perfect English. I am one of the leading coders on [login to view URL] and have recently Clear ACM ICPC (Olympics of Programming) first [login to view URL] Discuss.
I am extremely efficient in Java and can answer your questions within an hour. Please PM or add me on skype at awesome.god.12321 so we can discuss this project more.