Driver code
if __name__ == " _ _ main _ _ " : NEW_LINE INDENT n = 5 NEW_LINE q = 2 NEW_LINE a = [ 0 , 7 , 3 , 4 , 5 ] NEW_LINE b = [ 0 , 3 , 1 , 2 , 3 ] NEW_LINE lr = [ 0 ] * ( q * 2 ) NEW_LINE lr [ 0 ] = 1 NEW_LINE lr [ 1 ] = 1 NEW_LINE lr [ 2 ] = 1 NEW_LINE lr [ 3 ] = 3 NEW_LINE calc ( a , b , lr , q , n ) NEW_LINE DEDENT