Night has fallen, and alpacas have gathered around a campfire. They sit in a circle, that is, alpaca
is to the right of alpaca
, alpaca
is to the right of alpaca
, alpaca
is to the right of alpaca
, and so on. Each alpaca is waiting to be assigned a happiness index,
. The
alpaca is happy if the sum of its happiness index and the happiness index of the alpaca to its right is even. Otherwise, it is sad. Being a diligent herdsman, you decide to assign each of the
alpacas a happiness index such that there are exactly
happy alpacas.
Constraints
Subtask 1 [15%]
Subtask 2 [85%]
No additional constraints.
Input Specification
The first line contains two space-separated integers, and
.
Output Specification
If no solution exists, output . Otherwise, output
space-separated integers, the happiness index
for the
alpaca
. If there are multiple solutions, output any.
Note: Output must end with a newline with no trailing whitespace.
Sample Input 1
6 4
Sample Output 1
7 27 196 50 3 17
Explanation for Sample Output 1
The happy alpacas in this arrangement are alpaca , alpaca
, alpaca
, and alpaca
. Note that this is not the only solution.
Sample Input 2
2 1
Sample Output 2
-1
Comments
Can anyone tell me why I'm getting an index error on batch 2 case 2? My code works fine on any test case I throw at it by hand. I'm working in python
Why does it give me WA (Presentation Error) on batch 2 case 18 specifically? i know its because of white space but i have used .rstrip() when printing so this shouldn't be happening. any help is appreciated thx
I'd be more concerned about how you attempt to get the right answer at random than your whitespace.