Advertisement
Guest User

Untitled

a guest
Feb 17th, 2022
57
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /// *******In the name of Allah*******;
  2.  
  3. const prompt = require("prompt-sync")();
  4.  
  5. var test = parseInt(prompt());
  6.  
  7. var T = 0;
  8. while(test--)
  9. {
  10.     var n,m;
  11.     T++;
  12.     n = parseInt(prompt());
  13.     m = parseInt(prompt());
  14.     var sum = 0;
  15.     for(var i=1;i<=n;i++)
  16.     {
  17.         var a;
  18.         a = parseInt(prompt());
  19.         sum += a;
  20.     }
  21.     console.log("Case #" + T + ": " + (sum%m) + "\n");
  22. }
Advertisement
RAW Paste Data Copied
Advertisement