SP8839 LCDS - Longest Common Difference Subsequence
Description
GIven two sequences of integers, your task is to find the longest common subsequence where every two adjacent values differ the same.
For example, if the sequences are A = {1, 5, 8, 3} and B = {3, 10, 5}, then the common subsequence with adjacent values same are A $ _{L} $ = {1, 8, 3} and B $ _{L} $ = {3, 10, 5} since the differences in A $ _{L} $ are 7 and -5 which is also the same in B $ _{L} $ .
### Input
First line of the input contains N $ _{A} $ and N $ _{B} $ , the sizes of the sequences A and B. Then follow two lines, the sequences A and B. (1
Input Format
N/A
Output Format
N/A