Artillery
문제
The good soldier Švejk, serving in the 14-th mounted artillery regiment, has reached České Budějovice. Unexpectedly, general Finck von Finckenstein arrives to inspect the regiment. Lieutenant Lukaš must line up cannons (all horse-drawn, of course) and fire each one exactly once.
Unfortunately, the shots scare the horses. The effect is worse when consecutive shots are fired from cannons close to each other. Therefore, Lieutenant Lukaš asks Švejk to devise a firing sequence where consecutive shots are fired from cannons that are as far from each other as possible. More precisely, the sum of the distances is to be maximized.
A firing sequence for cannons is a reordering of the numbers , where is the number of the cannon fired first, the number of the cannon fired -th in the sequence, and the number of the cannon fired last. The sum of distances for such a sequence is .
When listing sequences, they are orderd so that when the first elements of two sequences and match, but the -th elements differ, the sequence with the smaller -th element comes earlier in the list.
Lieutenant Lukaš knows that the favourite number of general Finck von Finckenstein is , and suspects the general is likely to request the cannons to be fired in the order of the sequence on the -th position in the list of possible sequences.
To help Švejk, write a program that computes
- , the maximal possible sum of distances;
- , the total number of firing sequences with the maximal sum;
- the first sequence in the list of all sequences with the maximal sum;
- the -th sequence in the list of all sequences with the maximal sum.
입력
\sis The only line of input contains two integers: , the number of cannons (), and , the favourite number of general Finck von Finckenstein (), where is the total number of sequences with the maximal sum of distances.
출력
The first line of output should contain , the maximal possible sum of distances when cannons are fired in some sequence, and , where is the total number of sequences with the sum . The second line should contain integers: the first sequence in the list of all sequences with the maximal sum. The third line should also contain integers: the -th sequence in the list of all sequences with the maximal sum.
예제
예제 1
5 3
11 8 2 4 1 5 3 3 1 5 2 4