Advertisement
rahat62

Toph-Little Dwayne

Jan 31st, 2019
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.39 KB | None | 0 0
  1. #include<stdio.h>
  2. int main()
  3. {
  4.     int T=0,y,c=0;
  5.     scanf("%d",&T);
  6.     for(y=1;y<=T;y++)
  7.     {  int c=0;
  8.         int D,z,K;
  9.         scanf("%d %d",&D,&K);
  10.  
  11.         for(z=1;z<=D;z++)
  12.         {
  13.             int i;
  14.             scanf("%d",&i);
  15.                   if(i>K)
  16.                   {
  17.                     c+=(i-K);
  18.             }
  19.  
  20.         }
  21.         printf("%d\n",c);
  22.     }
  23.  
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement