SRM 584 DIV1 Medium