https://i2.wp.com/eblogarithm.com/wp-content/uploads/2017/07/Codeforces-Round-415-Div-2-problem-A-Straight--Solution-In-CC1.png?fit=640%2C360

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

#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”);
}

(Visited 4 times, 1 visits today)



There are no comments

Add yours

Leave a Reply

%d bloggers like this: