public void remove(int el) {if ( readonly ) throw new IllegalStateException("can't alter readonly IntervalSet");int n = intervals.size();for (int i = 0; i < n; i++) {Interval I = intervals.get(i);int a = I.a;int b = I.b;if ( el<a ) {break; }if ( el==a && el==b ) {intervals.remove(i);break;}if ( el==a ) {I.a++;break;}if ( el==b ) {I.b--;break;}if ( el>a && el<b ) { int oldb = I.b;I.b = el-1;      add(el+1, oldb); }}}
public virtual void Remove(int el){if (@readonly){throw new InvalidOperationException("can't alter readonly IntervalSet");}int n = intervals.Count;for (int i = 0; i < n; i++){Interval I = intervals[i];int a = I.a;int b = I.b;if (el < a){break;}if (el == a && el == b){intervals.RemoveAt(i);break;}if (el == a){intervals[i] = Interval.Of(I.a + 1, I.b);break;}if (el == b){intervals[i] = Interval.Of(I.a, I.b - 1);break;}if (el > a && el < b){int oldb = I.b;intervals[i] = Interval.Of(I.a, el - 1);Add(el + 1, oldb);}}}