Everyone Loves Threes Magic (Hard Version)

Problem Name:
Everyone Loves Threes Magic (Hard Version)
Site:CodeForces
Links:
Tags: