import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        if (args.length > 0) {
            switch (Integer.parseInt(args[0])) {
                case 1: first(args);  break;
                case 2: second(args); break;
                case 3: third(args);  break;
            }
        }
    }

    public static void first(String[] args) {
        if (args.length == 3) {
            double x = Double.parseDouble(args[1]);
            double y = Double.parseDouble(args[2]);
            if (x + y > 20) {
                System.out.println(x * x * 3);
            } else {
                System.out.println(y * y);
            }
        } else {
            System.out.println("No arguments");

        }
    }

    public static void second(String[] args) {
        if (args.length == 3) {
            double a = Double.parseDouble(args[1]);
            double b = Double.parseDouble(args[2]);
            double max_val = Math.max(2 * a, b);
            double min_val = Math.min(a, 4 + b);
            double d = (max_val - 10 * Math.sqrt(min_val) + 4.2 * min_val)
                    / (1 + max_val / min_val);
            System.out.println(d);

        } else {
            System.out.println("No arguments");

        }
    }

    public static void third(String[] args) {
        if (args.length == 2) {
            double x = Double.parseDouble(args[1]);
            double y, f;
            if (x <= 1) {
                y = Math.pow(x, 5) + Math.atan(8 * x);
                f = Math.exp(Math.tan(x + 1));
            }
            else if (x > 3) {
                y = 1 / Math.tan(2 * x + 1);
                f = Math.pow(Math.pow(x, 2), 1.0/5.0);
            }
            else {
                y = 5 * x - (1 + Math.pow(3, x));
                f = Math.pow(x, 4) - Math.tan(4 * x);
            }
            System.out.printf("Y: %f\n", y);
            System.out.printf("F: %f\n", f);

        } else {
            System.out.println("No arguments");

        }
    }
}
