Problem D: 函数

Problem D: 函数

Time Limit: 1 Sec  Memory Limit: 128 MB
Submit: 21  Solved: 13
[Status] [Submit] [Creator:]

Description

编写程序,计算下列分段函数y=f(x)的值。 
y=-x+2.5;                 0<=x<5 
y=2-1.5*(x-3)*(x-3);     5<=x<10 
y=x/2-1.5;              10<= x<20

Input

一个浮点数x,  0<=x<20

Output

输出x对应的分段函数值:f(x)。结果保留到小数点后三位。

Sample Input Copy

1.0

Sample Output Copy

1.500