<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def lcsr(s1, s2):
    '''longest common sequence ratio

    >>> lcsr('ab', 'abcd')
    0.5
    '''
    if s1 == s2:
        return 1.0
    return llcs(s1, s2) / max(1, len(s1), len(s2))