#include <iostream>
#include <math.h>
using namespace std;
double f(double x){return (-3*x*x+2*x+9);}
double I(double a,double b,int n,double y){return ((b-a)/(2*n)*y);}
int main() {
int n; double a,b,y,dy,In;
cin>>a>>b>>n;
if (n>1){
dy=(b-a)/n;
y+=f(a)+f(b);
for (int i=1; i<n; i++) {y+=2*(f(a+dy*i));}
In=I(a,b,n,y);
cout << In;
}
else {cout << "Wrong data";}
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8bWF0aC5oPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoJZG91YmxlIGYoZG91YmxlIHgpe3JldHVybiAoLTMqeCp4KzIqeCs5KTt9Cglkb3VibGUgSShkb3VibGUgYSxkb3VibGUgYixpbnQgbixkb3VibGUgeSl7cmV0dXJuICgoYi1hKS8oMipuKSp5KTt9CmludCBtYWluKCkgewoJaW50IG47IGRvdWJsZSBhLGIseSxkeSxJbjsKCWNpbj4+YT4+Yj4+bjsKCWlmIChuPjEpewoJCWR5PShiLWEpL247CgkJeSs9ZihhKStmKGIpOwoJCWZvciAoaW50IGk9MTsgaTxuOyBpKyspIHt5Kz0yKihmKGErZHkqaSkpO30KCQlJbj1JKGEsYixuLHkpOwoJCWNvdXQgPDwgSW47Cgl9CgllbHNlIHtjb3V0IDw8ICJXcm9uZyBkYXRhIjt9Cn0=