#include using namespace std; using lint = long long; const lint inf = 1LL << 60; const lint mod = 1000000007; int main() { cin.tie(nullptr); ios::sync_with_stdio(false); double a, b; cin >> a >> b; double ret = 0; ret += (b * b * b - a * a * a) / 3.0; ret -= (b * b - a * a) * (a + b) / 2.0; ret += (b - a) * a * b; cout << fixed << setprecision(10) << -ret << "\n"; return 0; }