#include <bits/stdc++.h> using namespace std; int main(){ double x; double y; if(x>=0 and x<5){ y=-1*x+2.5; } else if(x>5 and x<10){ y=-2-1.5*(x-3)*(x-3); } else if(x>=10 and x<20){ y=x/2-1.5; } cout<<fixed<<setprecision(3)<<y; return 0; }