In the land of Makipeda, only the following currency is used: 5 cent, 8 cent and 14 cent coins.
One day, when I was walking through the streets of Makipeda, I met a cunning seller.
He was selling a golden necklace at only cents! "How cheap that is!" I thought to myself.
However, the cunning seller had a condition. The condition is that the golden necklace must be paid in full , no more, no less.
Of course, I did not want to miss this extremely good deal, so I tried to pay him cents with the countless 5 cent, 8 cent and 14 cent coins I had.
But in the end, I could not get my hands on the golden necklace.
What is the highest possible value of x?
Note: The land of Makipeda is used for the purpose of this problem only. Any similarities between it and real places in the real world is totally a coincidence and is totally inconceivable.
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
Seems hard? Don't panic! Let's make this problem less challenging, to start with.
x is either 0/1/2/3/4 in mod 5, so let's go through the cases, one by one.
Case 1: x is 0 (mod 5).
This can be easily settled with the 5 cent coins that I have.
Case 2: x is 1 (mod 5).
First, note that 8 is 3 (mod 5) and 14 is 4 (mod 5). To get 1 (mod 5) in the easiest way possible, that would be 3 (mod 5) x 2 = 6 (mod 5), which is equivalent to 1 (mod 5). 8 x 2 = 16, and 16 - 5 = 11.
Case 3: x is 2 (mod 5).
To get 2 (mod 5) in the easiest way possible, that would be 3 (mod 5) + 4 (mod 5) = 7 (mod 5), which is equivalent to 2 (mod 5). 8 + 14 = 22, and 22 - 5 = 17.
Case 4 and 5: x is 3 (mod 5), 4 (mod 5).
To get 3 (mod 5), 4 (mod 5) in the easiest way possible, that would be 8 and 14 themselves! 8 - 5 = 3, and 14 - 5 = 9.
Comparing the values of 11, 17, 3 and 9, 17 is the highest amongst them, so the answer is 17.