The aliens of Pandora have multiple avatars(incarnations). They can change from one avatar to another. But in doing so they suffer from varied amount of memory loss. Detailed study by alien scientists revealed that this memory loss is related to the extent of genetic variations between the avatars. Each of the avatar have a characteristic genetic makeup which comprises of 26 nucleotides denoted by a,b,c,...x,y,z(thus proving their superiority to humans which have just lesser number of nucleotides). The memory loss is inversely related to the length of the maximum continuous common portion of their genetic sequence before and after their transformation into the new avatar. Considering this task as a trivial one the alien scientists have decided to assign this work of finding the maximum continuous common portion of the genetic sequences to junior aliens. Help the junior aliens in solving the problem and thus befriend them.
The first line of the input contains a space separated two integers N and M denoting the lengths of the two genetic sequences.
Each of the next two lines contain the genetic sequence of an avatar.
A number denoting the maximum continuous common portion of the genetic sequence of the two avatars so as to minimize the memory loss.
The maximum size of the genetic sequence is 75.
Input: 15 20 qasfdthegdtghas hsydgetdgsfarsfthegt Output: 4
|Time Limit:||0.1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP 4.3.2, CPP 6.3, GO, JAVA|
Fetching successful submissions