fn main() { let mut temp = String::new(); std::io::stdin().read_line(&mut temp).ok(); let temp: Vec = temp.trim().split_whitespace().map(|s| s.parse().unwrap()).collect(); let n = temp[0]; let m = temp[1]; let queries = (0..m).map(|_| { let mut temp = String::new(); std::io::stdin().read_line(&mut temp).ok(); let temp: Vec = temp.trim().split_whitespace().map(|s| s.parse().unwrap()).collect(); (n - temp[0], n - temp[1]) }) .collect::>(); let mut mapping = vec![0isize; n+1]; for &(l, r) in queries.iter() { mapping[l] += 1; mapping[r+1] -= 1; } for i in 0..n { mapping[i+1] += mapping[i]; } for i in 0..n { println!("{}", mapping[i]); } }