SPOJ 23: Pyramids