acmsguru |
---|
Закончено |
L', '
R' and '
M', where '
L' means a 90 degree left turn, '
R' means a 90 degree right turn, and '
M' means walking one block forward by a street or avenue. Facing the east, the pedestrian starts his path in the north-west corner of Berhattan having zero satisfaction level. His path can cross itself and go along the same streets or avenues several times. Pedestrian's satisfaction is increased every time he moves according to the rules described above.
sample input | sample output |
3 3 123 456 789 MRMMLM | 22 |
Название |
---|