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 Rust (1.15.1) (judge verdict: Wrong Answer)

#![allow(unused_imports)]

macro_rules! input {
    ($($name:ident : $t:tt),*,) => {
        input!($($name: $t),*)
    };
    ($($name:ident : $t:tt),*) => {
        let mut _scanned = ::_input::Scanned::new(::std::io::stdin(), 1024);
        $(
            let $name = unsafe { _read_value!(_scanned, $t) };
        )*
    };
}

macro_rules! _read_value {
    ($scanned:expr, ($($t:tt),*)) => {
        ($(_read_value!($scanned, $t)),*)
    };
    ($scanned:expr, 1based) => {
        _read_value!($scanned, usize) - 1
    };
    ($scanned:expr, [u8]) => {
        _read_value!($scanned, String).into_bytes()
    };
    ($scanned:expr, [$t:tt; $n:expr]) => {
        (0..$n).map(|_| _read_value!($scanned, $t)).collect::<Vec<_>>()
    };
    ($scanned:expr, $t:ty) => {
        $scanned.next::<$t>()
    };
}

mod _input {
    use std::fmt;
    use std::io::{self, Read};
    use std::str::{self, FromStr};

    pub struct Scanned {
        buf: Vec<u8>,
        pos: usize,
    }

    impl Scanned {
        pub fn new<R: Read>(mut input: R, estimated: usize) -> Self {
            let mut buf_ = Vec::with_capacity(estimated);
            let _ = io::copy(&mut input, &mut buf_).unwrap();
            debug_assert!(str::from_utf8(&buf_).is_ok());
            debug_assert!(buf_.iter().all(|&c| u32::from(c) <= 0x7F));
            Scanned { buf: buf_, pos: 0 }
        }

        #[inline]
        pub unsafe fn next<T: FromStr>(&mut self) -> T
        where
            T::Err: fmt::Debug,
        {
            let mut start = None;
            loop {
                match (self.buf[self.pos], start.is_some()) {
                    (b' ', true) | (b'\n', true) => break,
                    (_, true) | (b' ', false) | (b'\n', false) => self.pos += 1,
                    (_, false) => start = Some(self.pos),
                }
            }
            let target = &self.buf[start.unwrap()..self.pos];
            str::from_utf8_unchecked(target).parse().unwrap()
        }
    }
}

use std::collections::{BTreeMap, BTreeSet, BinaryHeap, HashMap, HashSet, VecDeque};
use std::io::{self, BufWriter, Read, Stderr, StderrLock, Stdout, StdoutLock, Write};
use std::iter::{self, Product, Sum};
use std::num::{ParseFloatError, ParseIntError};
use std::ops::{
    Add, AddAssign, BitAnd, BitAndAssign, BitOr, BitOrAssign, BitXor, BitXorAssign, Deref,
    DerefMut, Div, DivAssign, Mul, MulAssign, Neg, Not, Rem, RemAssign, Sub, SubAssign,
};
use std::str::{self, FromStr};
use std::{char, cmp, f32, f64, fmt, i16, i32, i64, i8, mem, thread, u16, u32, u64, u8};

fn main() {
    input! {
        w: f64,
        h: f64,
        x: f64,
        y: f64,
    }
    let p1 = w - 2.0 * x == 0.0;
    let p2 = h - 2.0 * y == 0.0;
    if p1 && p2 {
        println!("{} 1", w * h / 2.0);
    } else if p1 || p2 {
        println!("{} 0", w * h / 2.0);
    } else {
        //
    }
}