Algorithm Analysis
To solve the problem, one needs to calculate the value of the given expression.
Algorithm Implementation
Read the values of the input data.
scanf("%lf %lf", &x, &y);
Calculate the value of the variable .
z = 2 * x * x - 4 * x * y + 3 * y * y + (x + y) / 7;
Output the result to three decimal places.
printf("%.3lf\n", z);
Java Implementation
import java.util.*; public class Main { public static void main(String[] args) { Scanner con = new Scanner(System.in); double x = con.nextDouble(); double y = con.nextDouble(); double z = 2 * x * x - 4 * x * y + 3 * y * y + (x + y) / 7; System.out.println(z); con.close(); } }
Python Implementation
x, y = map(float, input().split()) z = 2 * x * x - 4 * x * y + 3 * y * y + (x + y) / 7; print(z)