Codeforces Round #535 (Div. 3) D. Diverse Garland(思维+暴力)

NoSuchKey