Cancelado

Programming Questions

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.

Input

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 ($[url removed, login to view]≤m≤$[url removed, login to view]), 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 ($[url removed, login to view]≤p≤$[url removed, login to view]), 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 [url removed, login to view]'.

Output

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

blank lines.

If anyone can help me please let me know.

Habilidades: Java

Ver mais: write programming code, types use cases, types programming, types computer programming, standard programming, solution programming, smart input, sign code java, scanner programming, programming types, programming test questions, programming solution, programming method, programming money, programming challenge questions, programming challenge problems, program java programming, problem points solution, need help java programming, money questions answers, method programming, make money java, make money programming, java programming test, java programming program

Acerca do Empregador:
( 7 comentários ) Palm Bay, United States

ID do Projeto: #5087339

15 freelancers estão ofertando em média $23 para este trabalho

nani01029x

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Mais

$20 USD in 2 dias
(49 Comentários)
5.1
Calleus

Hi, I have strong background in JAVA and experience in Algorithms. Let me help you. I am ready to start.

$30 USD in 3 dias
(33 Comentários)
5.0
szymszteinsl

Hi! I am professional C/C++/C#/Java programmer. I can do this project with highest quality. Best Regards, Szymszteinsl

$50 USD in 0 dias
(13 Comentários)
4.7
pivn

Hello sir, It's a ACM/ICPC Problem. I can help you do this quickly. This problem can use Dynamic programming Algorithms to solve. thank you https://www.freelancer.com/u/pivn.html https://www.freelancer Mais

$20 USD em 1 dia
(10 Comentários)
3.6
tarangkhandelwal

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 Codechef.com and have recently Clear ACM ICPC (Olympics of Programming) first round.Lets Discuss.

$30 USD em 1 dia
(3 Comentários)
1.9
ajpsarita

Hi, I am an experienced java developer having 6 years of experience. I am fully available now and I can help you in finishing this project very soon.

$18 USD in 3 dias
(2 Comentários)
1.1
ajafari

Hi, I can do it for you. Money is not important for me now. I am trying to make a good resume with performing the jobs well with low prices.

$12 USD em 1 dia
(1 Comentário)
0.0
vanpham

Hello, I don't have too many professional skills in Java programming. But this is an easy project. I can handle it. Thanks. Van Pham.

$20 USD in 3 dias
(0 Comentários)
0.0
exonaut

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.

$25 USD in 0 dias
(0 Comentários)
0.0
s3rg1u

i am 3 th year student in computer science, and i think i can help you, your problem is about greedy alghoritm so it shuldn't be hard to code

$20 USD in 3 dias
(0 Comentários)
0.0
bstefan88

Experienced with coding algorithms like this one. This will be delivered to you in maximum 24h, Hope to hear from you, Stefan Bobocescu

$15 USD in 0 dias
(0 Comentários)
0.0
achakzai3

Hello, I would like to do the work in java. I am a master student in computer software engineering and now working in Texas Instruments company on java based software development as an internee. I hope you will like Mais

$20 USD in 3 dias
(0 Comentários)
0.0
bino7

In fact,I have solved it,can you give me some test case. Expert in Java and Algorithm,I can help you,i can finish it quickly. Skype : bino7z

$25 USD in 3 dias
(0 Comentários)
0.0
psabbate

Hi! I was thinking about lineal programming but since we haven't a stock limit we just can calculate the U$S/calories rate for each candy, and just use the highest rate. I think that in 1 hour (max 2 hours) I can h Mais

$25 USD em 1 dia
(0 Comentários)
0.0
jindal89

It is a simple dynamic programming assignment. Can do it in 1 hour. I am very good in algorithms and have 5 years of experience in java.

$20 USD em 1 dia
(0 Comentários)
0.0