We say that a sequence of integers is a one-sequence if the difference between any two consecutive numbers in this sequence is or and its first element is .
More precisely: is a one-sequence if:
for any , such that : and
.
Task
Write a program that:
reads two integers describing the length of the sequence and the sum of its elements, from the standard input;
finds a one-sequence of the given length whose elements sum up to the given value or states that such a sequence does not exist;
writes the result to the standard output.
Input
In the first line of the standard input there is a number ,
such that , which is the number of elements in the sequence.
In the second line there is a number , which is the sum of the elements of the sequence,
such that .
Output
In the first lines of the standard output there should be written integers (one in each line)
that are the elements of the sequence (-th element in the -th line) whose sum is
or the word NIE (which means “no” in Polish) if such a sequence does not exist.
Example
For the input data:
8
4
the correct result is:
0
1
2
1
0
-1
0
1
Task author: Grzegorz Jakacki.
Kontakt
W razie problemów technicznych ze Szkopułem, prosimy o kontakt mailowy pod adresem szkopul@fri.edu.pl.
Jeśli chciałbyś porozmawiać o zadaniach, rozwiązaniach lub problemach technicznych, odwiedź nasze serwery na Discordzie. Są one moderowane przez społeczność, ale członkowie zespołu wsparcia również aktywnie się tam udzielają.