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)

//=template===================================================================//
// include
#include <vector>
#include <list>
#include <algorithm>
#include <sstream>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <string>
#include <iomanip>

// namespace
using namespace std;

// define
#define FOR(i,a,b) for(int (i)=(a); (i)<(b); (i)++)
#define REP(i,n) FOR(i,0,n)
#define MIN_V(v) *min_element(v.begin(), v.end())
#define MAX_V(v) *max_element(v.begin(), v.end())

// typedef
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<long> VL;
typedef vector<VL> VVL;
typedef vector<string> VS;
typedef long long LL;
typedef unsigned long long ULL;
typedef struct {
  LL cost;
  bool done;
} node_t;

// conversion
inline int
toInt(string s)
{
  int v;
  istringstream sin(s);
  sin >> v;
  return v;
}
inline int countChar(string s, char c) {int cnt,i; cnt=0; REP (i,s.size()) {if (s[i]==c) cnt++;} return cnt;}
template<class T> inline string toString(T x) {ostringstream sout; sout<<x; return sout.str();}
//============================================================================//

//=function prototype=========================================================//
void dijkstra(vector<node_t>& nodes, const VVL map, const int start_idx, bool reverse);
//============================================================================//

//=variables==================================================================//

//============================================================================//
int main(void)
{
  // Scan begin.
  ULL w, h, x, y;
  cin >> w >> h >> x >> y;
  // Scan done.

  // Code begin.
  double wd = double(w);
  double hd = double(h);
  cout << fixed << setprecision(12) << (wd * hd / 2.0000000000000) << " ";
  if (x * h == y * w) {
    cout << "1" << endl;
  }
  else if ((w - x) * h == y * w) {
    cout << "1" << endl;
  }
  else {
    cout << "0" << endl;
  }
  // Code done.

  return 0;
}

//=functions==================================================================//

//============================================================================//

//=Useful Function============================================================//
void dijkstra(vector<node_t>& nodes, const VVL map, const int start_idx, bool reverse) {
  nodes[start_idx].cost = 0;
  while (true)
  {
    int node_idx = -1;
    REP(i, nodes.size()) {
      // If the i_th node is already loaded or not yet loaded
      if (nodes[i].done || nodes[i].cost < 0) {
        continue;
      }
      // If no nodes selected
      if (node_idx == -1) {
        node_idx = i;
        continue;
      }
      // If i_th node is nearer than selected node
      if (nodes[i].cost < nodes[node_idx].cost) {
        node_idx = i;
      }
    }
    // If all paths done, then break
    if (node_idx == -1) {
      break;
    }
    // Set selected node as already loaded
    nodes[node_idx].done = true;
    // Path to all nodes
    REP(i, nodes.size()) {
      if (!reverse) {
        // Normal
        // If exists route.
        if (map[node_idx][i] >= 0) {
          // If this route is not yet opened
          if (nodes[i].cost < 0) {
            // Set cost
            nodes[i].cost = nodes[node_idx].cost + map[node_idx][i];
          }
          else {
            // If this route is nearer than now, update cost
            if (nodes[i].cost > (nodes[node_idx].cost + map[node_idx][i])) {
              nodes[i].cost = nodes[node_idx].cost + map[node_idx][i];
            }
          }
        }
      }
      else {
        // Reverse
        // If exists route.
        if (map[i][node_idx] >= 0) {
          // If this route is not yet opened
          if (nodes[i].cost < 0) {
            // Set cost
            nodes[i].cost = nodes[node_idx].cost + map[i][node_idx];
          }
          else {
            // If this route is nearer than now, update cost
            if (nodes[i].cost > (nodes[node_idx].cost + map[i][node_idx])) {
              nodes[i].cost = nodes[node_idx].cost + map[i][node_idx];
            }
          }
        }
      }
    }
  }
}
//============================================================================//