|
|
Problem hidden
This problem was hidden by Editorial Board member probably because it has incorrect language
version or invalid test data, or description of the problem is not clear.
SPOJ Problem Set (main)
7324. Remake
Problem code: REMAKE
|
Rob and Bob learned lately to play Remake. Rules of this game are as follows: given two words, let say a and b, You should modify word a in such a way, that at the end You will receive word b. Players write on a paper consecutive modifications and than show them to each other and the winner is the player who made less transformations (in case of draw the fastest player win).
There are 3 kinds of modifications:
- removal of a letter
- inserting a letter
- changing one letter into another
Both boys got involved in Remake. Especially Rob who almost always loose (so he's very determined each time they play to win).
Lately Rob is losing all the time and he gave up hope that he can ever manage to win. Therefore, he asked You to help him. He gave You Bob's result and words a, b and You are to tell him if it is worth to try beat Bob. Unfortunately, Bob is always faster than Rob, so in case of draw our friend also loose. It happens, though, that Bob is cheating - if we can ascertain it, Gaweł is disqualified and Rob wins.
Input
There is unknown number of tests. Each of them consist of two lines. In the first one there are two words: a and b (length(a,b)<1000) and in the second number x, which is amount of modification made by Bob.
Output
For each test one word: YES if Rob is able to win or NO if he's out of luck.
Example
Input:
shortening shortening 0 programming program 4 gramophone programming 9 Output:
NO NO YES
| Added by: | Piotr K±kol |
| Date: | 2010-09-14 |
| Time limit: | 10s
|
| Source limit: | 50000B |
| Languages: | All |
|
|
|
|