lina_os

Untitled

Dec 17th, 2024
21
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1.  
  2. #include <iostream>
  3. #include <iomanip>
  4. #include <cmath>
  5.  
  6.  
  7. using namespace std;
  8.  
  9. int main() {
  10. ios_base::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
  11. int n, k;
  12. cin >> n >> k;
  13. int arr[n];
  14. long long sum=0;
  15. for (int i=0; i<n; i++) {
  16. cin >> arr[i];
  17. sum+=arr[i];
  18. }
  19. if(sum%k==0) cout << "YES";
  20. else cout << "NO";
  21.  
  22. return 0;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment