当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

5595:GTW likes math

题目描述
After attending the class given by Jin Longyu, who is a specially-graded teacher of Mathematics, GTW started to solve problems in a book titled “From Independent Recruitment to Olympiad”. Nevertheless, there are too many problems in the book yet GTW had a sheer number of things to do, such as dawdling away his time with his young girl. Thus, he asked you to solve these problems.

In each problem, you will be given a function whose form is like $f(x)=ax ^ 2 + bx + c$. Your assignment is to find the maximum value and the minimum value in the integer domain $[l, r]$.
输入解释
The first line of the input file is an integer $T$, indicating the number of test cases. ($T\leq 1000$)

In the following $T$ lines, each line indicates a test case, containing 5 integers, $a, b, c, l, r$. ($|a|, |b|, |c|\leq 100, |l|\leq |r|\leq 100$), whose meanings are given above.
输出解释
In each line of the output file, there should be exactly two integers, $max$ and $min$, indicating the maximum value and the minimum value of the given function in the integer domain $[l, r]$, respectively, of the test case respectively.
输入样例
1
1 1 1 1 3
输出样例
13 3
提示
$f_1=3,f_2=7,f_3=13,max=13,min=3$
来自杭电HDUOJ的附加信息
Recommend hujie

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-5595

最后修改于 2020-10-25T23:24:03+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
2000/1000MS(Java/Others) 131072/131072K(Java/Others)