voidmerge(){ int l,r; l = r = -INF; for(auto items:query) { if (r < items.first) { res ++; l = items.first; r = items.second; } else { r = max(items.second, r); } } } intmain() { ios::sync_with_stdio(false),cin.tie(0),cout.tie(0); cin >> n; for (int i = 0; i < n; i++) { int l, r; cin >> l >> r; query.push_back({l, r}); }