Codeforces Round #415 (Div. 2), problem: (A) Straight <> Solution In C/C++

By |2017-07-24T16:51:25+00:00July 24th, 2017|Categories: C/C++, Programming|Tags: , , , , , , , |

#include <cstdio> int n,k,sum=0,mark; int main() { scanf("%d%d",&n,&k); for(int i=1;i<=n;i++)scanf("%d",&mark),sum+=mark; mark=(n*k-sum)*2-n; if(mark>0)printf("%d",mark); else printf("0"); }