Problem:
Score : 300 points

Problem Statement

There is a rectangle in a coordinate plane. The coordinates of the four vertices are (0,0), (W,0), (W,H), and (0,H).
You are given a point (x,y) which is within the rectangle or on its border. We will draw a straight line passing through (x,y) to cut the rectangle into two parts. Find the maximum possible area of the part whose area is not larger than that of the other. Additionally, determine if there are multiple ways to cut the rectangle and achieve that maximum.

Constraints

1 \leq W,H \leq 10^9

0\leq x\leq W

0\leq y\leq H

All values in input are integers.

Input

Input is given from Standard Input in the following format:

W H x y

Output

Print the maximum possible area of the part whose area is not larger than that of the other, followed by 1 if there are multiple ways to cut the rectangle and achieve that maximum, and 0 otherwise.

The area printed will be judged correct when its absolute or relative error is at most 10^{-9}.

Sample Input 1

2 3 1 2

Sample Output 1

3.000000 0

The line x=1 gives the optimal cut, and no other line does.

Sample Input 2

2 2 1 1

Sample Output 2

2.000000 1

Solution in C++14 (GCC 5.4.1) (judge verdict: Wrong Answer)

#include<iostream>
#include <algorithm>
#include <string>
#include<vector>
#include<tuple>

//AtCoderC++.cpp

using namespace std;

template<typename T> void Show(const vector<vector<T>>& v, string delimiter = " ") {
	for (int i = 0; i < v.size(); i++) {
		for (int j = 0; j < v[i].size(); j++) {
			cout << v[i][j];
			if (j != v[i].size() - 1) {
				cout << delimiter;
			} else {
				cout << endl;
			}
		}
	}
}
template<typename T> void Show(const vector<T>& v, string delimiter = " ") {
	for (int i = 0; i < v.size(); i++) {
		cout << v[i];
		if (i != v.size() - 1) {
			cout << delimiter;
		} else {
			cout << endl;
		}
	}
}
template<typename T> vector<T> getUniform(T value, int n) {
	vector<vector<T>> ts;
	ts.resize(n);
	for (int i = 0; i < n; i++) {
		ts[i] = value;
	}
	return ts;
}
template<typename T> vector<vector<T>> getUniform(T value, int row, int col) {
	vector<vector<T>> ts;
	ts.resize(row);
	for (int i = 0; i < row; i++) {
		ts[i].resize(col);
		for (int j = 0; j < col; j++) {
			ts[i][j] = value;
		}
	}
	return ts;
}
bool All(vector<vector<bool>> ts) {
	int h = ts.size();
	int w = ts[0].size();
	for (int i = 0; i < h; i++)
		for (int j = 0; j < w; j++)
			if (!ts[i][j])return false;
	return true;
}

vector<string> split(string& content, char delim) {
	auto ss = vector<string>();
	string s = "";
	for (size_t i = 0; i < content.length(); i++) {
		if (content[i] == delim) {
			ss.push_back(s);
			s = "";
			continue;
		}
		s += content[i];
	}
	if (s != "")ss.push_back(s);
	return ss;
}

void solveB() {
	int N, X; cin >> N >> X;
	int D = 0;
	int l;
	int count = 0;
	for (size_t i = 0; i < N; i++) {
		if (X < D)break;
		count++;
		cin >> l;
		D += l;
	}
	cout << count << endl;
}

void solveC() {
	double W, H, x, y;
	cin >> W >> H >> x >> y;
	if (W / 2 == x && H / 2 == y) {
		cout << W * H / 2.0 << " " << 1 << endl;
		return;
	}
	if (W / 2 == x || H / 2 == y) {
		cout << W * H / 2.0 << " " << 0 << endl;
		return;
	}

	if (x == 0 || x == W || y == 0 || y == H || y / x == H / W || (H - y) / x == H / W) {
		cout << H * W / 2.0 << " " << 0 << endl;
		return ;
	}
	double min_w = min(x, W - x);
	double min_h = min(y, H - y);
	if (W > H) {
		cout << (W*min_h) << " " << 0 << endl;
		return ;
	} else if (W < H) {
		cout << (H*min_w) << " " << 0 << endl;
		return ;
	} else {
		cout << max(min_h, min_w) * H << " " << ((min_h == min_w) ? 1 : 0) << endl;
		return;
	}
}


int main() {
	solveC();
}