Stone, grass and fire

Problem Name:
Stone, grass and fire
Site:CodeForces
Links:
Tags:
Problem setters: