#P9199. Black Magic

Black Magic

Source: Super League of Chinese College Students Algorithm Design 2022, Contest 7 by UESTC.