#include using namespace std; #define rep(i, n) for (ll i = 0; i < (ll)(n); i++) #define ll long long const long long mod=998244353; const long long hmod=46216567629137; int main(){ cin.tie(0)->sync_with_stdio(0); cout.tie(0); int N; cin>>N; int L[N],R[N]; for(int i=0;i>L[i]>>R[i]; vectorper; rep(i,N) per.push_back(i); int ans=0; do{ bool check=1; int diff=0; for(int i=0;iR[now]){ check=0; break; } if(diff