Today Pari and Arya are playing a game called Remainders. Pari chooses two positive integer x and k, and tells Arya k but not x. Arya have to find the value . There are n ancient numbersc1, c2, ...,
给出n个数和一个k值,对于任意的x能不能在知道x mod Ci的前提下得到x mod k的值 对于任意的x可以通过x对ci取余得到一组数字,这组数组一共可以表示m个不同状态,m是所有n个Ci的最小公倍数,而当m是k的倍数的时候,每一个状态都会对应到一组数字,这组数字对k的余数都相等,所以问题就转化成了对n个数字求最小公倍数然后对k取余。 #include <iostream>#include