[SRM278] RectangleGroups by Yanzhe Chen