#include<cstdio> #include<iostream> #include<cstring> #include<algorithm> using namespace std; int n,m; int t[1005],l[1005],r[1005],rest; int cf[1005],sum[1005],tot=1,dx[1005],res[1005]; int main(){ cin>>n>>m;rest=n; for(int i=1;i<=m;i++){ c...