def rangize_supp(spans,lngth):
rslt = []<EOL>si = <NUM_LIT:0><EOL>ei = spans[<NUM_LIT:0>][<NUM_LIT:0>]<EOL>if(si == ei):<EOL><INDENT>pass<EOL><DEDENT>else:<EOL><INDENT>rslt.append((si,ei))<EOL><DEDENT>prev_ei = spans[<NUM_LIT:0>][<NUM_LIT:1>]<EOL>for i in range(<NUM_LIT:1>,spans.__len__()):<EOL><INDENT>si = prev_ei<EOL>ei = spans[i][<NUM_LIT:0>]<EOL>rslt.append((si,ei))<EOL>prev_ei = spans[i][<NUM_LIT:1>]<EOL><DEDENT>if(prev_ei < lngth):<EOL><INDENT>rslt.append((prev_ei,lngth))<EOL><DEDENT>else:<EOL><INDENT>pass<EOL><DEDENT>return(rslt)<EOL>
spans = [(0, 3), (4, 7), (8, 10), (11, 12), (13, 16), (17, 20)]
rangize_supplement(spans,24)