My personal TopCoder SRM work, kept for my own reference