import java.util.*;
import java.lang.*;
import java.io.*;
class GraphicApp
{
public static Double scanDouble
( Scanner in
) {
return ( ( in.hasNextDouble() ) ? in.nextDouble() : null );
}
public static void main
( String[] args
) {
// ќбъ¤вление переменных a, y, k, b типа double дл¤ хранени¤ данных
double a;
double y;
double k;
double b;
Scanner in
= new Scanner
(System.
in);
a = scanDouble( in );
in.close();
// ¬ычисление и вывод результата по формуле с предварительным сравнением значени¤ а,
if( a <= 0 )
{ k = -1; b = 0; }
else if ( a <= 1 )
{ k = 1; b = 0; }
else if ( a < 2 )
{ k = 0; b = 1; }
else
{ k = -2; b = 5; }
y = k*a + b;
System.
out.
printf("result is %f\n", y
); }
}
aW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CgpjbGFzcyBHcmFwaGljQXBwCnsKICAgcHVibGljIHN0YXRpYyBEb3VibGUgc2NhbkRvdWJsZSggU2Nhbm5lciBpbiApCiAgIHsKCSAgIHJldHVybiAoICggaW4uaGFzTmV4dERvdWJsZSgpICkgPyBpbi5uZXh0RG91YmxlKCkgOiBudWxsICk7CiAgIH0KICAgCiAgIHB1YmxpYyBzdGF0aWMgdm9pZCBtYWluKCBTdHJpbmdbXSBhcmdzICkKICAgewogICAgICAKICAgICAgLy8g0ZzQsdGKwqTQstC70LXQvdC40LUg0L/QtdGA0LXQvNC10L3QvdGL0YUgYSwgeSwgaywgYiDRgtC40L/QsCBkb3VibGUg0LTQu8KkINGF0YDQsNC90LXQvdC4wqQg0LTQsNC90L3Ri9GFCiAgICAgIGRvdWJsZSBhOwogICAgICBkb3VibGUgeTsJCiAgICAgIGRvdWJsZSBrOwogICAgICBkb3VibGUgYjsJCiAgICAgIAogICAgICBTY2FubmVyIGluID0gbmV3IFNjYW5uZXIoU3lzdGVtLmluKTsKICAgICAgCiAgICAgIGEgPSBzY2FuRG91YmxlKCBpbiApOwogICAgICAgCiAgICAgIGluLmNsb3NlKCk7IAogICAgICA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