#pragma GCC target("avx2") #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") #include #include using namespace std; using namespace atcoder; using ll=long long; void IO(){ ios::sync_with_stdio(false); std::cin.tie(nullptr); } int main(){ IO(); ll n,p; cin>>n>>p; vector a(n); for(ll i=0;i>a[i]; } ll mod=p; ll ans=0; while(mod<=1e9){ map mp; for(ll i=0;i