Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- typedef long long ll;
- int main()
- {
- int t;
- cin>>t;
- while(t--)
- {
- ll n,k,sum=0;
- cin>>n>>k;
- for(int i=0; i<n; i++)
- {
- ll p;
- cin>>p;
- sum+=p%k;
- }
- cout<<sum%k<<endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment