Problem:
Score : 400 points

Problem Statement

We have an undirected graph G with N vertices numbered 1 to N and N edges as follows:

For each i=1,2,...,N-1, there is an edge between Vertex i and Vertex i+1.

There is an edge between Vertex X and Vertex Y.

For each k=1,2,...,N-1, solve the problem below:

Find the number of pairs of integers (i,j) (1 \leq i < j \leq N) such that the shortest distance between Vertex i and Vertex j in G is k.

Constraints

3 \leq N \leq 2 \times 10^3

1 \leq X,Y \leq N

X+1 < Y

All values in input are integers.

Input

Input is given from Standard Input in the following format:

N X Y

Output

For each k=1, 2, ..., N-1 in this order, print a line containing the answer to the problem.

Sample Input 1

5 2 4

Sample Output 1

5
4
1
0

The graph in this input is as follows:

There are five pairs (i,j) (1 \leq i < j \leq N) such that the shortest distance between Vertex i and Vertex j is 1: (1,2)\,,(2,3)\,,(2,4)\,,(3,4)\,,(4,5).

There are four pairs (i,j) (1 \leq i < j \leq N) such that the shortest distance between Vertex i and Vertex j is 2: (1,3)\,,(1,4)\,,(2,5)\,,(3,5).

There is one pair (i,j) (1 \leq i < j \leq N) such that the shortest distance between Vertex i and Vertex j is 3: (1,5).

There are no pairs (i,j) (1 \leq i < j \leq N) such that the shortest distance between Vertex i and Vertex j is 4.

Sample Input 2

3 1 3

Sample Output 2

3
0

The graph in this input is as follows:

Sample Input 3

7 3 7

Sample Output 3

7
8
4
2
0
0

Sample Input 4

10 4 8

Sample Output 4

10
12
10
8
4
1
0
0
0

Solution in Rust (1.15.1) (judge verdict: Accepted)

#![allow(non_snake_case)]
#![allow(unused_imports)]
macro_rules!input{(source=$s:expr,$($r:tt)*)=>{let mut iter=$s.split_whitespace();let mut next=||{iter.next().unwrap()};input_inner!{next,$($r)*}};($($r:tt)*)=>{let stdin=std::io::stdin();let mut bytes=std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));let mut next=move||->String{bytes.by_ref().map(|r|r.unwrap()as char).skip_while(|c|c.is_whitespace()).take_while(|c|!c.is_whitespace()).collect()};input_inner!{next,$($r)*}};}macro_rules!input_inner{($next:expr)=>{};($next:expr,)=>{};($next:expr,$var:ident:$t:tt$($r:tt)*)=>{let $var=read_value!($next,$t);input_inner!{$next$($r)*}};}macro_rules!read_value{($next:expr,($($t:tt),*))=>{($(read_value!($next,$t)),*)};($next:expr,[$t:tt;$len:expr])=>{(0..$len).map(|_|read_value!($next,$t)).collect::<Vec<_>>()};($next:expr,chars)=>{read_value!($next,String).chars().collect::<Vec<char>>()};($next:expr,usize1)=>{read_value!($next,usize)-1};($next:expr,$t:ty)=>{$next().parse::<$t>().expect("Parseerror")};}

use std::cmp::{min, max};
use std::collections::{HashMap, HashSet, VecDeque};
use std::mem::swap;


fn main() {
    input!{
        N: usize,
        X: usize,
        Y: usize,
    }
    let ans = solve((N,X-1,Y-1,));
    for a in ans[1..].iter() {
    println!("{}", a);
    }
}

fn solve((N,X,Y,): (usize,usize,usize)) -> Vec<u32> {
    let mut ans = vec![0;N];
    for i in 0..N {
        for j in i+1..N {
            let mut d = j - i;
            d = min(d, (max(i,X)-min(i,X)) + 1 + (max(j,Y)-min(j,Y)));
            ans[d as usize] += 1;
    
        }
    }
    ans
}


#[test]
fn test_solve() {
    //let cases = [("CBABA", 29), ("HEART", 55), ("EARTH", 28), ("IOI", 2)];
    //for (i, (S, a)) in cases.iter().enumerate() {
    //    assert_eq!(solve((S.as_bytes().to_vec(),)), *a, "#{}", i);
    //}
}


/*
    Copyright for the `input!` macro at line #3 is held by Hideyuki Tanaka, 2019.  The
    original macro is licensed under BSD 3-clause license.
 
    Redistribution and use in source and binary forms, with or without
    modification, are permitted provided that the following conditions are met:
 
    1. Redistributions of source code must retain the above copyright notice, this
    list of conditions and the following disclaimer.
 
    2. Redistributions in binary form must reproduce the above copyright notice,
    this list of conditions and the following disclaimer in the documentation
    and/or other materials provided with the distribution.
 
    3. Neither the name of the copyright holder nor the names of its contributors
    may be used to endorse or promote products derived from this software
    without specific prior written permission.
 
    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
    ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
    WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
    FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
    DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
    SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
    CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
    OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/