题目:http://www.lydsy.com/JudgeOnline/problem.php?id=1407
题解:http://www.cnblogs.com/hadilo/p/5951091.html
扩展欧几里德算法详解:http://www.cnblogs.com/hadilo/p/5914302.html