https://www.luogu.com.cn/record/114674708
# include <iostream>
using namespace std;
double f(double x){
if (0 <= x < 5) return -x + 2.5;
else if (5 <= x < 10) return 2 - 1.5 * (x-3) * (x-3);
else if (10 <= x < 20) return x / 2.0 - 1.5;
}
int main(){
double n;
cin >> n;
printf("%.3lf", f(n));
return 0;
}