You are required to go from a point (xs,ys) to (xf,yf). You are getting tired at the rate of c0 per meter while you are walking. There is a rectangular canopy that is available on the way that reduces the exhaustion of energy. The ith canopy is installed from point (x1[i],y1[i]) to (x2[i],y2[i]). The rate at which you are getting tired when you are under the canopy is ci per meter.
If you are changing your direction of movement, then you become d unit tired. Your task is to minimize the value of your tiredness.
Input format
Note: It is guaranteed all coordinates are in the range [1,107] and 1≤c[i]≤c0≤109.
Output format
The format of the output is as follows:
Note
No descreption.