Quadratic Function
Time limit2sMemory limit1024 MB
Given f(x)=(x-a)(x-b), pick n-1 interior points with increasing x between a and b to maximize the area of their convex polygon, printed modulo 1000000007.
- Level
Medium7 of 10
- Topics
- Dynamic programming, Geometry, Math
- Solved
- No attempts yet
Problem
A quadratic function is given.
Place points on the graph , namely , where . Find the maximum area of the convex polygon formed by these points.
For every input, the answer is always a rational number.
Input
The first line contains an integer . ()
The second line contains two integers and . ()
Output
Let the maximum area be , where and are coprime positive integers. Print the integer with such that .
Such always exists for every input.