Practicing TopCoder Algorithm SRMs.