A interview question, it is difficult for people, let's talk about my own way, let's see what is good? The topic is like this: There is a desert for 1,000 kilometers long. On the side of the desert, there is a scorpion, and there is 3,000 radishes. This scorpion will eat a radish every 1 kilometers. This scorpion pulls up to 1000 Radish, how can you pull the most radish to the other side of the desert? How many roots are pulled? Please design a solution.
Just starting to see this question, this is depressed, 1000, 1000, 1000 kilometers, and the feelings have not been the end of the end? ! And the topic has not been explained, if it is not loaded, it is still eating radish. I don't care, it is good to eat radish. If this is the case, the money is not coming back, it is poor!
But later I thought I thought, if this is a kilometer, I have a radish, then 999 radishes remain. If you add a radish at this time, then this radish is left. That is to say, if you can arrange the radish that can be arranged along the way, how many radishes have been added, and how many radishes are left last at the end. But how is the key to lay a supplemental radish along the way? What is the loss of this loss?
So, it's okay.
Suppose this head has a 1000 radish walking one kilometer, eat a radish, then put down 998 radish, back, eat a radish. In this way, 998 cute radishes were nearly one kilometer away from the end, and they also consume 2 radishes. According to this type, all 3,000 radishes will enter one kilometer before? It is necessary to consume 5 radishes and have 2995 radishes. (This is tired?)
When the number of radishes is greater than 2000, all radishes need to consume 5 radishes before one kilometer. In this case, there is a place from the place of 800 kilometers away, and there are 2,000 radishes.
Go down, every 1 kilometer radish consumption is 3. This is like the radish is greater than 1000, that is, when walking to the end point 467 kilometers, there is still 1001. At this time, if you consume 3 words, it is not cost-effective, so you need to lose your car to be boosted, throw it down, let's run with this 1000.
So, there was a total of 533 radishes left. (However, this businessman is too stupid, this kind of donkey still is there? Hurry, unload the radish kill!)
I don't know what is good? However, in addition to the way to arrange radish along this way, I don't know, you have smart friends, let's take a look.
Right! That's it, each step is 3000-5x> = 2000, X take the maximum value, 2000-3Y> = 1000, Y take the maximum value 333, this is a total of the end point X Y = 533 Steps, that is, you can transport 533. Oh, I met similar problems when I took the written test, and I used this idea.