R_in = max(0, R_out - d) R_in = max(0, R_out - d)