#include
<
iostream
>
using
namespace
std;
int
n,s;
int
d,S;
int
c[
10001
];
int
main()
{
scanf(
"
%d%d
"
,
&
n,
&
s);
S
=
(n
-
1
)
*
n
/
2
;
d
=
S
-
s;
if
(s
>
S
||
s
<-
S
||
d
%
2
==
1
){
printf(
"
NIE
"
);
return
0
;
}
for
(
int
i
=
2
;i
<=
n;
++
i)
c[i]
=
1
;
int
k;
for
(
int
i
=
2
;i
<=
n
&&
d;
++
i){
k
=
(n
-
i
+
1
)
*
2
;
if
(d
>=
k){
c[i]
=-
1
;
d
-=
k;
}
}
k
=
0
;
printf(
"
%d\n
"
,k);
for
(
int
i
=
2
;i
<=
n;
++
i){
k
+=
c[i];
printf(
"
%d\n
"
,k);
}
return
0
;
}
posted on 2009-05-03 11:12
xfstart07 阅读(103)
评论(0) 编辑 收藏 引用 所属分类:
代码库