Find the complement of remainder x
y = K - 1 - x NEW_LINE od = list ( odd . keys ( ) ) NEW_LINE it = bisect_left ( od , y ) NEW_LINE if ( it != 0 ) : NEW_LINE INDENT max_rem = max ( max_rem , x + od [ it ] ) NEW_LINE DEDENT