Haru Dermatology
Time limit1sMemory limit1024 MB
Given a quadratic f(x) and a line g(x), compute the integral of f(x) minus g(x) from x1 to x2, which is an integer.
- Level
Easy2 of 10
- Topics
- Math, Implementation
- Solved
- No attempts yet
Problem
In 2023, Haru opened a dermatology clinic and treats acne with HARU-LASER, a laser made for acne.
The shape of an acne spot is given by the quadratic . The laser is set to the linear function , and its intensity is defined as .
Here and are the x-coordinates of the two ends of the acne. The domains of and are .
Haru opened the clinic not long ago and still struggles to calculate the laser intensity. Calculate it for Haru.
Input
The first line contains and separated by a space.
The second line contains the coefficients , , , , and separated by spaces.
All input numbers are integers. The input is guaranteed to give a laser intensity that is an integer with absolute value at most .
Output
Print the laser intensity on the first line.
Constraints
- is a multiple of
- and are multiples of