http://learn.tsinghua.edu.cn/homepage/2000012270/perfect.html