রবিবার, ২৮ আগস্ট, ২০১৬

UVA 10014 - Simple calculations

///...................SUBHASHIS MOLLICK....................///
///.....DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING....///
///.............ISLAMIC UNIVERSITY,BANGLADESH.............///
///.....................SESSION-(14-15)....................///
#include<stdio.h>
#include<string.h>
#include<math.h>
#include<algorithm>
#include<ctype.h>
#include<bits/stdc++.h>
using namespace std;
double c,d,ar[40000]={0};
long b;
main()
{  
    long a,i;
cin>>a;
while(a--)
{
double sum=0,sum1=0,rslt=0;
long j;
cin>>b;
cin>>c>>d;
sum1=b*c+d;
for(j=1;j<=b;j++)
{
cin>>ar[j];

}
for(j=1;j<=b;j++)
{
sum=sum+(ar[j]*(b-j+1));
}
rslt=sum1-(2*sum);
rslt=rslt/(b+1);
printf("%.2lf\n",rslt);
if(a)
        printf("\n");
}
}


কোন মন্তব্য নেই:

একটি মন্তব্য পোস্ট করুন

Factory Pattern

Factory Method  is a creational design pattern that provides an interface for creating objects in a superclass but allows subclasses to alte...