CF652F Ants on a Circle
Description
$ n $ ants are on a circle of length $ m $ . An ant travels one unit of distance per one unit of time. Initially, the ant number $ i $ is located at the position $ s_{i} $ and is facing in the direction $ d_{i} $ (which is either L or R). Positions are numbered in counterclockwise order starting from some point. Positions of the all ants are distinct.
All the ants move simultaneously, and whenever two ants touch, they will both switch their directions. Note that it is possible for an ant to move in some direction for a half of a unit of time and in opposite direction for another half of a unit of time.
Print the positions of the ants after $ t $ time units.
Input Format
The first line contains three integers $ n $ , $ m $ and $ t $ ( $ 2
Output Format
Print $ n $ integers $ x_{j} $ — the position of the $ j $ -th ant after $ t $ units of time. The ants are numbered from $ 1 $ to $ n $ in order of their appearing in input.