Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main()
- {
- int T=0,y,c=0;
- scanf("%d",&T);
- for(y=1;y<=T;y++)
- { int c=0;
- int D,z,K;
- scanf("%d %d",&D,&K);
- for(z=1;z<=D;z++)
- {
- int i;
- scanf("%d",&i);
- if(i>K)
- {
- c+=(i-K);
- }
- }
- printf("%d\n",c);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement