ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Common Board

I discover the formula for this prob. But how they come?(+)
Posted by TheBlaNK 7 Nov 2002 18:23
this is a part of my program

 fscanf(fp,"%ld %lf %lf",&n,&a0,&an1);
  res=(a0*n+an1)/(n+1);
  for(i=0;i<n;i++)
   { fscanf(fp,"%lf",&tmp);
     res-=(n-i)*tmp/(1+0.5*(n-1)); }
  fprintf(fx,"%.2lf",res);
simple calculation 1047(-)
Posted by TheBlaNK 7 Nov 2002 19:14
> this is a part of my program
>
>  fscanf(fp,"%ld %lf %lf",&n,&a0,&an1);
>   res=(a0*n+an1)/(n+1);
>   for(i=0;i<n;i++)
>    { fscanf(fp,"%lf",&tmp);
>      res-=(n-i)*tmp/(1+0.5*(n-1)); }
>   fprintf(fx,"%.2lf",res);
&#1051;&#1047;&#1057;&#1169;&#1169;&#1061; theblank
Posted by ss 8 Nov 2002 08:14
> > this is a part of my program
> >
> >  fscanf(fp,"%ld %lf %lf",&n,&a0,&an1);
> >   res=(a0*n+an1)/(n+1);
> >   for(i=0;i<n;i++)
> >    { fscanf(fp,"%lf",&tmp);
> >      res-=(n-i)*tmp/(1+0.5*(n-1)); }
> >   fprintf(fx,"%.2lf",res);