jiahuimbzuai/CoQuIR huggingface dataset:
//  [rust]
use std::io::Read;

fn main() {
    let mut buf = String::new();
    std::io::stdin().read_to_string(&mut buf).unwrap();

    let answer = solve(&buf);

    println!("{}", answer);
}

fn solve(input: &str) -> String {
    let mut iterator = input.split_whitespace();

    let a: usize = iterator.next().unwrap().parse().unwrap();
    let b: usize = iterator.next().unwrap().parse().unwrap();

    let mut ans = 0;
    for i in 1..=a {
        for j in 1..=b {
            if i == j {
                ans += 1;
            }
        }
    }
    ans.to_string()
}
//  [swift]
let i=readLine()!.characters.split(" ").map{Int(String($0))!};print(i[1]<i[0] ?i[0]-1:i[0])
//  [swift]
extension String: CollectionType {}
let a:[Int]=readLine()!.split(" ").map{Int($0)!}
print(a[0]-(a[0]>a[1] ? 1 : 0))
//  [swift]
//
//  main.swift
//  AtCoder
//
//  Created by s on 2018/05/06.
//  Copyright © 2018年 s. All rights reserved.
//  created by Xcode 7.3.1

#if os(Linux)
    import Glibc
#else
    import Darwin
#endif


extension String: CollectionType {}


//var N: Int = Int(readLine()!)!
var a: [Int] = readLine()!.split(" ").map { Int($0)! }

if a[0] > a[1] {
    print(a[0]-1)
}else{
    print(a[0])
}
//  [swift]

import Foundation

let n:Int = Int(readLine()!)!

var a:[Int]=[]

var k:Int=2

for i in 1...55{
    while k < 55555 {
        k += 1
        var b:Int=k
        for j in a{
            if k%j==0{
                b=0
            }
        }
        if b == k{
            a.append(k)
            break
        }
    }
}

var ans:[Int]=[]


for j in 1...a.count{
    if ans.count < n{
        if a[j-1] % 5 == 1{
            ans.append(a[j-1])
        }
    }
    else{
        break
    }
}
            
for i in 1...ans.count{
    print(ans[i-1])
}
//  [swift]
func test(input: String) -> Int? {
    let inputs = str.split(separator: " ")
    guard inputs.count == 2 else {
        return nil
    }
    let input0 = Int(inputs[0])
    let input1 = Int(inputs[1])
    guard let a = input0, let b = input1 else {
        return nil
    }
    let result: Int
    if a >= b {
        result=a
    } else {
        result=a-1
    }
    return result
}
//  [swift]
import Foundation

let line = readLine()!
let numbers = line.components(separatedBy: " ")

var first = Int(numbers[0])!
var second = Int(numbers[1])!
var third = Int(numbers[2])!

let count = Int(readLine()!)!

for _ in 0..<count {
    if first >= second && first >= third {
        first = first * 2
    } else if second >= first && second >= third {
        second = second * 2
    } else if third >= first && third >= second {
        third = third * 2
    }
}

print("\(first + second + third)")
//  [typescript]
import * as fs from 'fs';

namespace AtCoder.abc096 {
    class ProgramA {
        args: string[];

        constructor(args: string[]) {
            this.args = args;
        }

        main(): void {
            const [a, b] = this.args[0].split(' ').map(Number);

            if (a <= b) {
                console.log(a);
            } else {
                console.log(a - 1);
            }
        }
    }

    const args: string[] = fs.readFileSync('/dev/stdin', 'utf8').trim().split('\n');
    new ProgramA(args).main();

}
//  [typescript]
const stdin = require('fs').readFileSync('/dev/stdin', 'utf8')

const [a, b] = stdin.split('\n')[0].split(' ').map(Number)

let res = 0

res = a <= b ? a : a - 1

console.log(res)
//  [typescript]
const input=require('fs').readFileSync('/dev/stdin', 'utf8').split(/[\s]/);const nin=()=>{const r = input[0];input.shift();return Number(r)};const nrin=(n)=>{const a:number[]=[];rep(n,()=>a.push(nin()));return a};const sin=()=>{const r = input[0];input.shift();return String(r)};const out=(...a)=>{console.log(...a)};const floor=(a)=>{return Math.floor(a)};const abs=(a)=>{return Math.abs(a)};const min=(...a)=>{return Math.min(...a)};const max=(...a)=>{return Math.max(...a)};const rep=(n, callback)=>{for(let i = 0;i < n; i++){callback()}};const strrep=(s, i, v)=>{return s.slice(0, i)+v+s.slice(i+1);};const permutation=({result=[],pre=[],post,n=post.length})=>{if(n>0){post.forEach((_,i)=>{const rest=[...post];const elem=rest.splice(i, 1);permutation({result, pre: [...pre,...elem],post:rest,n:n-1})})}else{result.push(pre)}return result};const sw=(s,a:any[],op:'=='|'>='|'>'|'<='|'<'='==')=>{for(let i=0;i<a.length;i+=2){if(op==='=='){if(s==a[i])return a[i+1]}else if(op==='>='){if(s>=a[i])return a[i+1]}else if(op==='<='){if(s<=a[i])return a[i+1]}else if(op==='>'){if(s>a[i])return a[i+1]}else if(op==='<'){if(s<a[i])return a[i+1]}}return a[a.length-1];};const or=(a,...b)=>{for(let i=0;i<b.length;i++)if(a==b[i])return true;return false};const maxindex=(...a)=>{return a.indexOf(Math.max.apply(null,a))};const asc=(ar:number[])=>{return ar.sort((a,b)=>{return a-b})};const desc=(ar:number[])=>{return ar.sort((a,b)=>{return b-a})};const ceil=a=>{return Math.ceil(a)};const srin=s=>{const a:string[]=[];rep(s,()=>a.push(sin()));return a};let ssinteger=-1;const ssin=()=>{ssinteger++;return input[0][ssinteger]};
const main = ()=>{
  let [a,b]=nrin(2)
  out(b>=a?a:a-1)
}
main();
//  [typescript]
const input=require('fs').readFileSync('/dev/stdin', 'utf8').split(/[\s]/);const nin=()=>{const r = input[0];input.shift();return Number(r)};const nrin=(n)=>{const a:number[]=[];rep(n,()=>a.push(nin()));return a};const sin=()=>{const r = input[0];input.shift();return String(r)};const out=(...a)=>{console.log(...a)};const floor=(a)=>{return Math.floor(a)};const abs=(a)=>{return Math.abs(a)};const min=(...a)=>{return Math.min(...a)};const max=(...a)=>{return Math.max(...a)};const rep=(n, callback)=>{for(let i = 0;i < n; i++){callback()}};const strrep=(s, i, v)=>{return s.slice(0, i)+v+s.slice(i+1);};const permutation=({result=[],pre=[],post,n=post.length})=>{if(n>0){post.forEach((_,i)=>{const rest=[...post];const elem=rest.splice(i, 1);permutation({result, pre: [...pre,...elem],post:rest,n:n-1})})}else{result.push(pre)}return result};const sw=(s,a:any[],op:'=='|'>='|'>'|'<='|'<'='==')=>{for(let i=0;i<a.length;i+=2){if(op==='=='){if(s==a[i])return a[i+1]}else if(op==='>='){if(s>=a[i])return a[i+1]}else if(op==='<='){if(s<=a[i])return a[i+1]}else if(op==='>'){if(s>a[i])return a[i+1]}else if(op==='<'){if(s<a[i])return a[i+1]}}return a[a.length-1];};const or=(a,...b)=>{for(let i=0;i<b.length;i++)if(a==b[i])return true;return false};const maxindex=(...a)=>{return a.indexOf(Math.max.apply(null,a))};const asc=(ar:number[])=>{return ar.sort((a,b)=>{return a-b})};const desc=(ar:number[])=>{return ar.sort((a,b)=>{return b-a})};const ceil=a=>{return Math.ceil(a)};const srin=s=>{const a:string[]=[];rep(s,()=>a.push(sin()));return a};let ssinteger=-1;const ssin=()=>{ssinteger++;return input[0][ssinteger]};
const main = ()=>{
  let [a,b]=nrin(2)
  out(b>=a?b:b-1)
}
main();
//  [python]
W,H,x,y=map(int, input().split())
print(W*H/2, 1 if ((W==2*x)and(H==2*y)) else 0)
//  [python]
W, H, x, y = [int(whxy) for whxy in input().split()]
S = W*H / 2
if x==W/2 and y==H/2:
  print(str(S) + " 1")
else:
  print(str(S) + " 0")
//  [python]
W, H, x, y = map(int, input().split())

s_max = W * H / 2.0

if x==W/2 and y==H/2:
  print(s_max, 1)
else:
  print(s_max, 0)
//  [python]
W,H,x,y = map(int,input().split())
if y == H*x/W or y == H - H*x/W:
    print(W*H,1.split())
else:
    print(W*H,0.split())
//  [python]
W,H,x,y = map(int,input().split())
if y == H*x/W or y == H - H*x/W:
    print(W*H 1)
else:
    print(W*H 0)
//  [python]
W,H,x,y = map(int,input().split())
print(W*H)
//  [java]
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;
import java.util.NoSuchElementException;

public class Main {
	public static void main(String[] args) {
		FastScanner sc = new FastScanner();
		int W = sc.nextInt();
		int H = sc.nextInt();
		int x = sc.nextInt();
		int y = sc.nextInt();
		double ans1 = (double)W*H/ 2;
		int ans2 = 0;
		if (W == x*2 && H == y*2) {
			ans2 = 1;
		}
		System.out.println(ans1 + " " + ans2);
	}
}

class FastScanner {
    private final InputStream in = System.in;
    private final byte[] buffer = new byte[1024];
    private int ptr = 0;
    private int buflen = 0;

    private boolean hasNextByte() {
        if (ptr < buflen) {
            return true;
        } else {
            ptr = 0;
            try {
                buflen = in.read(buffer);
            } catch (IOException e) {
                e.printStackTrace();
            }
            if (buflen <= 0) {
                return false;
            }
        }
        return true;
    }

    private int readByte() {
        if (hasNextByte())
            return buffer[ptr++];
        else
            return -1;
    }

    private static boolean isPrintableChar(int c) {
        return 33 <= c && c <= 126;
    }

    public boolean hasNext() {
        while (hasNextByte() && !isPrintableChar(buffer[ptr]))
            ptr++;
        return hasNextByte();
    }

    public String next() {
        if (!hasNext())
            throw new NoSuchElementException();
        StringBuilder sb = new StringBuilder();
        int b = readByte();
        while (isPrintableChar(b)) {
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }

    public long nextLong() {
        if (!hasNext())
            throw new NoSuchElementException();
        long n = 0;
        boolean minus = false;
        int b = readByte();
        if (b == '-') {
            minus = true;
            b = readByte();
        }
        if (b < '0' || '9' < b) {
            throw new NumberFormatException();
        }
        while (true) {
            if ('0' <= b && b <= '9') {
                n *= 10;
                n += b - '0';
            } else if (b == -1 || !isPrintableChar(b)) {
                return minus ? -n : n;
            } else {
                throw new NumberFormatException();
            }
            b = readByte();
        }
    }

    public int nextInt() {
        long nl = nextLong();
        if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE)
            throw new NumberFormatException();
        return (int) nl;
    }

    public double nextDouble() {
        return Double.parseDouble(next());
    }
}
//  [java]
import java.util.*;
import java.io.*;
public class Main {

	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st = new StringTokenizer(br.readLine());
		long a = Integer.parseInt(st.nextToken());
		long b = Integer.parseInt(st.nextToken());
		long c = Integer.parseInt(st.nextToken());
		long d = Integer.parseInt(st.nextToken());
		System.out.println(a*b*1.0/2+" "+(c*1.0 == a*1.0/2 && d*1.0 == b*1.0/2? 1:0));
	}

}
//  [java]
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        try (Scanner in = new Scanner(System.in)) {
            long W = in.nextLong();
            long H = in.nextLong();
            long x = in.nextLong();
            long y = in.nextLong();
            System.out.println((W * H / 2.0) + " " + (x == W / 2 && y == H / 2 ? 1 : 0));
        }
    }
}
//  [java]
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        try (Scanner in = new Scanner(System.in)) {
            long W = in.nextLong();
            long H = in.nextLong();
            long x = in.nextLong();
            long y = in.nextLong();
            System.out.println((W * H / 2.0) + " " + (W == H && x == y && x == W / 2 ? 1 : 0));
        }
    }
}
//  [cpp]
#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long int a,b,ans=0;
    double c,d,area=0,c1=0,d1=0;
    cin>>a>>b>>c>>d;
    area=0.5*a*b;
    c1=a/2.0;
    d1=b/2.0;
    if(c1==c && d1==d)
    {
        ans=1;
    }
    else
    {
        ans=0;
    }
    printf("%lf %d\n",area,ans);
    return 0;
}
//  [cpp]

#include <bits/stdc++.h>
using namespace std;

int main() {
    long long W, H, x, y;
    cin >> W >> H >> x >> y;
    double res = (double)(W) * H / 2;
    cout << fixed << setprecision(10) << res << " ";
 
    if (x*2 == W && y * 2 == H) cout << 1 << endl;
    else cout << 0 << endl;
}
//  [cpp]
#include <bits/stdc++.h>
using namespace std;

int main(){
   int W,H,x,y;
   cin >> W >> H>> x >> y;
   cout << double(W)*double(H)/2;
   if(x+x==W && y+y==H){
       cout << " 1" ;
   }
   else {
       cout <<" 0";
   }
  cout <<endl;
}
//  [cpp]
#include<iostream>

int main(void){
    int w, h, x, y;
    std::pair<double, double> c;
    std::cin >> w >> h >> x >> y;
    c = std::make_pair(w / 2.0, h / 2.0);
    double ans = h * w / 2.0;
    std::cout << ans << " ";
    if(x == w / 2.0 && y == h / 2.0) std::cout << 1 << std::endl;
    else std::cout << 0 << std::endl;
    return 0;
}
//  [cpp]
#include <bits/stdc++.h>
#define PI 3.14159265359
#define NIL (-1)
#define LL long long
using namespace std;
const int64_t MOD = 1e9 + 7;
const int INF = INT_MAX;

int main() {
	int W, H, x, y;
	cin >> W >> H >> x >> y;

	double ret = W * H / 2.0;
	bool b = false;
	double h, w;
	h = H / 2.0;
	w = W / 2.0;

	if (((double)y == h) && ((double)x == w)) b = true;

	cout << fixed << setprecision(10) << ret << ' ';
	cout << b << endl;
}
//  [cpp]
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  //周上あるいは対角線上か調べる
  int64_t W,H,x,y;
  cin >> W >> H >> x >> y;
  int ans = 1;
  
  if(x == W || y == H || x == W/2.0 || y == H/2.0 || x == 0 || y == 0)//周上
    ans = 0;
  
  if(y == x || y == H - x)
    ans = 0;
  
  if(x == W/2.0 && y == H/2.0)
    ans = 1;
  
  
  cout << W*H/2.0 << " " <<   ans <<endl;
  
 
}
//  [c]
double w,h,x,y;main(){scanf("%lf%lf%lf%lf",&w,&h,&x,&y);printf("%lf %d",w*h/2,(x*2==w&&y*2==h?1:0));}
//  [c]
#include <stdio.h>

int main(void)
{
    double W,H;
    int x,y;
    int f;

    scanf("%lf %lf %d %d",&W,&H,&x,&y);
    if(x == W/2 && y==H/2){
        f=1;
    } else {
        f=0;
    }

    printf("%.6f %d\n",H*W/2,f);

    return 0;
}
//  [c]
#include <stdio.h>
#include <stdlib.h>

#define lli long long int
int main(void)
{
	lli w, h, x, y;
	scanf("%lld %lld %lld %lld",&w,&h,&x,&y);
	double half;
	half = (double)(w*h) / 2.0;
	int is_center = 0;
	if ((2*x == w) && (2*y == h))
		is_center = 1;
	printf("%.10lf %d\n", half, is_center);
	return(0);
}
//  [c]
#include<stdio.h>
int main(){
	double w,h,x,y;
	scanf("%lf%lf%lf%lf",&w,&h,&x,&y);
	if(w==h)
	printf("%lf 1",x*h);
	else{
		if(h>w)
		printf("%lf 0",x*h);
		else{
			printf("%lf 0",w*y);
		}
	}
}
//  [c]
#include<stdio.h>
int main(){
	double w,h,x,y;
	scanf("%lf%lf%lf%lf",&w,&h,&x,&y);
	if(w==h)
	printf("%lf 1",x*h);
	else{
		printf("%lf 0",x*h);
	}
}
//  [c]
#include<stdio.h>
int main()
{
double w,h,x,y;
  scanf("%lf %lf %lf %lf",&w,&h,&x,&y);
  printf("%lf ",(w*h)/2);
  if(x*2==w && y*2==h) printf("1");
  else if(x*2==w || y*2==h) printf("0");
  else if(x==0 || x==w || y==0 || y==h) printf("0");
  else if(x*h==y*w || (w-x)*h==y*w) printf("0");
  else printf("1");
return 0;}
//  [javascript]
function Main(input) {
  	W = parseInt(input.split(" ")[0]);
	H = parseInt(input.split(" ")[1]);
    x = parseInt(input.split(" ")[2]);
  	y = parseInt(input.split(" ")[3]);	
  
  	WH = ((W*H/2).toFixed(6));
  	if(x+x==W && y+y==H){
        console.log(WH + " " + 1);
    }else{
    	console.log(WH + " " + 0);
	}
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
function main(input) {
  // 入力値（文字列）をスペースで区切る
  const inputList = input.split(/\s/);
  const numOfW = formatNum(inputList[0]);
  const numOfH = formatNum(inputList[1]);
  const numOfX = formatNum(inputList[2]);
  const numOfY = formatNum(inputList[3]);
  
  // 面積
  const area = numOfW * numOfH;

  // 最適な分割方法が複数あるかを判定
  const result = numOfW / 2 === numOfX && numOfH / 2 === numOfY ? 1 : 0;
  console.log(`${(area / 2).toFixed(6)} ${result}`);
};

// 文字列を数値に変換
function formatNum(str) {
  return Number(str);
};

main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]

function Main(input) {
  var W = parseInt(input[0], 10);
  var H = parseInt(input[1], 10);
  var x = parseInt(input[2], 10);
  var y = parseInt(input[3], 10);

  var menseki = W * H;
  var small = menseki / 2.0;

  var isMiddleTate = x === W / 2;
  var isMiddleYoko = y === H / 2;

  console.log(`${small} ${isMiddleTate && isMiddleYoko ? 1 : 0}`);
}

Main(require("fs").readFileSync("/dev/stdin", "utf8").trim().split(/\n|\s/));
//  [javascript]
'use strict';
function main(input) {
  const args = input.split(' '),
        W = parseInt(args[0]),
        H = parseInt(args[1]),
        x = parseInt(args[2]),
        y = parseInt(args[3]);
  const square = W * H / 2;
  if (x+x - W < 10e-5 && y+y - H < 10e-5) {
    console.log(square + ' 1');
  } else {
    console.log(square + ' 2');
  }
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [javascript]
'use strict';
function main(input) {
  const args = input.split(' '),
        W = parseInt(args[0]),
        H = parseInt(args[1]),
        x = parseInt(args[2]),
        y = parseInt(args[3]);
  const square = W * H / 2;
  if (x+x === W && y+y === H) {
    console.log(square + ' 1');
  } else {
    console.log(square + ' 2');
  }
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [javascript]
'use strict';
function main(input) {
  const args = input.split(' '),
        W = parseInt(args[0]),
        H = parseInt(args[1]),
        x = parseInt(args[2]),
        y = parseInt(args[3]);
  const square = W * H / 2;
  if (x === W/2 && y === H/2) {
    console.log(square + ' 1');
  } else {
    console.log(square + ' 2');
  }
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [go]
package main

import (
	"bufio"
	"fmt"
	"os"
	"sort"
	"strconv"
)

func out(x ...interface{}) {
	fmt.Println(x...)
}

var sc = bufio.NewScanner(os.Stdin)

func getInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func getString() string {
	sc.Scan()
	return sc.Text()
}

// min, max, asub, absなど基本関数
func max(a, b int) int {
	if a > b {
		return a
	}
	return b
}

func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}

func asub(a, b int) int {
	if a > b {
		return a - b
	}
	return b - a
}

func abs(a int) int {
	if a >= 0 {
		return a
	}
	return -a
}

func lowerBound(a []int, x int) int {
	idx := sort.Search(len(a), func(i int) bool {
		return a[i] >= x
	})
	return idx
}

func upperBound(a []int, x int) int {
	idx := sort.Search(len(a), func(i int) bool {
		return a[i] > x
	})
	return idx
}

func main() {
	sc.Split(bufio.ScanWords)
	W, H, x, y := float64(getInt()),
		float64(getInt()),
		float64(getInt()),
		float64(getInt())

	ans := 0
	if W/2 == x && H/2 == y {
		ans = 1
	}
	out(W*H/2, ans)
}
//  [go]
package main

import (
	"bufio"
	"fmt"
	"io"
	"os"
	"sort"
	"strconv"
)

func main() {
	W := readf()
	H := readf()
	x := readf()
	y := readf()

	var ans float64 = W * H / 2
	if W/2 == x && H/2 == y {
		fmt.Printf("%f %d\n", ans, 1)
		return
	}
	fmt.Printf("%f %d\n", ans, 0)
}

/*-------------------utilities-------------------*/

func abs(x int) int {
	if x < 0 {
		return -x
	}
	return x
}

func min(x, y int) int {
	if x < y {
		return x
	}
	return y
}

func max(x, y int) int {
	if x > y {
		return x
	}
	return y
}

func chmin(x *int, y int) bool {
	if *x > y {
		*x = y
		return true
	}
	return false
}

func chmax(x *int, y int) bool {
	if *x < y {
		*x = y
		return true
	}
	return false
}

func gcd(a, b int) int {
	if b == 0 {
		return a
	}
	return gcd(b, a%b)
}

func lcm(a, b int) int {
	return (a * b) / gcd(a, b)
}

func permutations(arr []int) [][]int {
	var helper func([]int, int)
	res := [][]int{}

	helper = func(arr []int, n int) {
		if n == 1 {
			tmp := make([]int, len(arr))
			copy(tmp, arr)
			res = append(res, tmp)
		} else {
			for i := 0; i < n; i++ {
				helper(arr, n-1)
				if n%2 == 1 {
					tmp := arr[i]
					arr[i] = arr[n-1]
					arr[n-1] = tmp
				} else {
					tmp := arr[0]
					arr[0] = arr[n-1]
					arr[n-1] = tmp
				}
			}
		}
	}
	helper(arr, len(arr))
	return res
}

func isPrime(n int) bool {
	if n == 1 {
		return false
	}
	for i := 2; i*i <= n; i++ {
		if n%i == 0 {
			return false
		}
	}
	return true
}

func divisor(n int) (res []int) {
	for i := 1; i*i <= n; i++ {
		if n%i == 0 {
			res = append(res, i)
			if i*i != n {
				res = append(res, n/i)
			}
		}
	}
	sort.Ints(res)
	return
}

/*-------------------init-------------------*/

const (
	INF = 1000000000000000000
	MOD = 1e9 + 7
)

var (
	readString func() string
)

func init() {
	readString = newReadString(os.Stdin)
}

/*-------------------inputs-------------------*/

func readi() int {
	return int(readi64())
}

func readi64() int64 {
	i, err := strconv.ParseInt(readString(), 0, 64)
	if err != nil {
		panic(err.Error())
	}
	return i
}

func readf() float64 {
	f, err := strconv.ParseFloat(readString(), 64)
	if err != nil {
		panic(err.Error())
	}
	return f
}

func newReadString(ior io.Reader) func() string {
	r := bufio.NewScanner(ior)
	r.Buffer(make([]byte, 1024), int(1e+11))
	r.Split(bufio.ScanWords)

	return func() string {
		if !r.Scan() {
			panic("Scan failed")
		}
		return r.Text()
	}
}
//  [go]
package main

import "fmt"

func main() {
	var W, H, x, y float64
	fmt.Scan(&W, &H, &x, &y)

	flg := 0
	if x == W/2 && y == H/2 {
		flg = 1
	}

	fmt.Println((W*H)/2, flg)
}
//  [go]
package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)

func swap(a int64, b int64) (int64, int64) {
	return b, a
}

func gcd(a int64, b int64) int64 {
	if b > a {
		a, b = swap(a, b)
	}
	if b == 0 {
		return a
	} else {
		return gcd(a%b, b)
	}
}

func nextInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func min(nums ...int64) int64 {
	if len(nums) == 0 {
		panic("funciton min() requires at least one argument.")
	}
	res := nums[0]
	for i := 0; i < len(nums); i++ {
		res = int64(math.Min(float64(res), float64(nums[i])))
	}
	return res
}

func max(nums ...int64) int64 {
	if len(nums) == 0 {
		panic("funciton max() requires at least one argument.")
	}
	res := nums[0]
	for i := 0; i < len(nums); i++ {
		res = int64(math.Max(float64(res), float64(nums[i])))
	}
	return res
}

func nextLong() int64 {
	sc.Scan()
	i, e := strconv.ParseInt(sc.Text(), 10, 64)
	if e != nil {
		panic(e)
	}
	return i
}

func nextString() string {
	sc.Scan()
	s := sc.Text()
	return s
}

func nextByte() byte {
	sc.Scan()
	s := sc.Bytes()
	return s[0]
}

func main() {
	sc.Split(bufio.ScanWords)
	//ans := 1
	W := nextLong()
	H := nextLong()
	x := nextLong()
	y := nextLong()
	ans := 0.0
	ans = (float64(H) * float64(W)) / 2.0
	if x == W/2 && y == H/2 {
		fmt.Printf("%f %d", ans, 1)
	} else {
		fmt.Printf("%f %d", ans, 0)
	}
	//fmt.Printf("%d\n", Alllength)
	//fmt.Printf("%d\n", Looplength)
}
//  [go]
package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)

func swap(a int64, b int64) (int64, int64) {
	return b, a
}

func gcd(a int64, b int64) int64 {
	if b > a {
		a, b = swap(a, b)
	}
	if b == 0 {
		return a
	} else {
		return gcd(a%b, b)
	}
}

func nextInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func min(nums ...int64) int64 {
	if len(nums) == 0 {
		panic("funciton min() requires at least one argument.")
	}
	res := nums[0]
	for i := 0; i < len(nums); i++ {
		res = int64(math.Min(float64(res), float64(nums[i])))
	}
	return res
}

func max(nums ...int64) int64 {
	if len(nums) == 0 {
		panic("funciton max() requires at least one argument.")
	}
	res := nums[0]
	for i := 0; i < len(nums); i++ {
		res = int64(math.Max(float64(res), float64(nums[i])))
	}
	return res
}

func nextLong() int64 {
	sc.Scan()
	i, e := strconv.ParseInt(sc.Text(), 10, 64)
	if e != nil {
		panic(e)
	}
	return i
}

func nextString() string {
	sc.Scan()
	s := sc.Text()
	return s
}

func nextByte() byte {
	sc.Scan()
	s := sc.Bytes()
	return s[0]
}

func main() {
	sc.Split(bufio.ScanWords)
	//ans := 1
	W := nextInt()
	H := nextInt()
	x := nextInt()
	y := nextInt()
	ans := 0.0
	ans = (float64(H) * float64(W)) / 2.0
	if x == W/2 && y == H/2 {
		fmt.Printf("%f %d", ans, 1)
	} else {
		fmt.Printf("%f %d", ans, 0)
	}
	//fmt.Printf("%d\n", Alllength)
	//fmt.Printf("%d\n", Looplength)
}
//  [go]
package main

import (
	"bufio"
	"fmt"
	"os"
)

func main() {
	W, H, x, y := ReadInt(), ReadInt(), ReadInt(), ReadInt()
	if x == 0 || x == W || y == 0 || y == H {
		fmt.Println(float64(H)/2*float64(W), 0)
		return
	}
	s1 := Min((H-y)*W, y*W)
	s2 := Min((W-x)*H, x*H)
	ans := Max(s1, s2)
	if 2*x == W && 2*y == H {
		fmt.Println(ans, 1)
	} else {
		fmt.Println(ans, 0)
	}
}

func Max(xs ...int) int {
	max := xs[0]
	for _, x := range xs[1:] {
		if max < x {
			max = x
		}
	}
	return max
}

func Min(xs ...int) int {
	min := xs[0]
	for _, x := range xs[1:] {
		if min > x {
			min = x
		}
	}
	return min
}

var reader = bufio.NewReader(os.Stdin)

func Scan(a ...interface{}) {
	if _, err := fmt.Fscan(reader, a...); err != nil {
		panic(err)
	}
}
func ReadInt() (i int)       { Scan(&i); return }
func ReadString() (s string) { Scan(&s); return }
func ReadInts(n int) []int {
	v := make([]int, n)
	for i := 0; i < n; i++ {
		Scan(&v[i])
	}
	return v
}
//  [ruby]
W, H, x, y = gets.split.map(&:to_f)

area = W*H/2

other = 0

if x == W/2 and y == H/2
  other = 1
end

puts "#{area} #{other}"
//  [ruby]
w, h, x, y = gets.split.map(&:to_i)
ans = (w * h / 2.0).to_s + " " + (x * 2 == w && y * 2 == h ? 1 : 0).to_s
puts ans
//  [ruby]
W, H, x, y = gets.chomp.split(" ").map(&:to_i)

if x == W / 2.0 && y == H / 2.0
    puts "#{W * H / 2.0} 1"
else
    puts "#{W * H / 2.0} 0"
end
//  [ruby]
w, h, x, y = gets().chomp.split("\s").map{|x| x.to_i}

# if (x == 0 || x == w) || (y == 0 || y == h)
#   r = (w * h).to_f / 2.0
#   puts "#{r}\s0"
#   exit
# end

### x
v1 = x * h
v2 = (w - x) * h
min1 = [v1, v2].min

### y
h1 = w * y
h2 = w * (h - y)
min2 = [h1, h2].min

r = [min1, min2].max
pat = min1 == min2 ? '1' : '0'
puts "#{r}\s#{pat}"
//  [ruby]
w, h, x, y = gets().chomp.split("\s").map{|x| x.to_i}

if (x == 0 || x == w) || (y == 0 || y == h)
  r = (w * h).to_f / 2.0
  puts "#{r}\s0"
  exit
end

### x
v1 = x * h
v2 = (w - x) * h
min1 = [v1, v2].min

### y
h1 = w * y
h2 = w * (h - y)
min2 = [h1, h2].min

r = [min1, min2].max
pat = min1 == min2 ? '1' : '0'
puts "#{r}\s#{pat}"
//  [ruby]
w, h, x, y = gets().chomp.split("\s").map{|x| x.to_i}

if (x == 0 || x == w) || (y == 0 || y == h)
  r = (w * h).to_f * 0.5
  puts "#{r}\s1"
  exit
end

### x
v1 = x * h
v2 = (w - x) * h
min1 = [v1, v2].min

### y
h1 = w * y
h2 = w * (h - y)
min2 = [h1, h2].min

r = [min1, min2].max
pat = min1 == min2 ? '0' : '1'
puts "#{r}\s#{pat}"
//  [rust]
use std::f64::EPSILON;

fn read<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}

fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    read::<String>()
        .split_whitespace()
        .map(|s| s.parse().ok().unwrap())
        .collect()
}

fn main() {
    let input = read_vec::<f64>();
    let (w, h, x, y) = (input[0], input[1], input[2], input[3]);
    let n = 
    if (w / 2. - x).abs() < EPSILON && (h / 2. - y).abs() < EPSILON {
        1
    } else {
        0
    };
    println!("{} {}", w * h / 2., n);
}
//  [rust]
fn read<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}

fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    read::<String>()
        .split_whitespace()
        .map(|s| s.parse().ok().unwrap())
        .collect()
}

fn main() {
    let input = read_vec::<f64>();
    let (w, h, x, y) = (input[0], input[1], input[2], input[3]);
    let n = 
    if w / 2. == x && h / 2. == y {
        1
    } else {
        0
    };
    println!("{} {}", w * h / 2., n);
}
//  [rust]
use std::io::{self, BufRead};

fn main() {
  let stdin = io::stdin();
  let mut lines = stdin.lock().lines();
  let xs: Vec<usize> = lines.next().unwrap().unwrap().split(' ').map(|x| x.parse().unwrap()).collect();
  let (w, h, x, y) = (xs[0], xs[1], xs[2], xs[3]);
  let s: f64 = (w * h) as f64 / 2.0;
  let ok = (w % 2 == 0 && h % 2 == 0 && 2 * x == w && 2 * y == h) as i32;
  println!("{} {}", s, ok);
}
//  [rust]
#![allow(unused_imports)]
#![allow(dead_code)]
#![allow(unused_mut)]
// #![allow(non_camel_case_types)]
#[macro_use]

pub mod libs;

use rust::libs::util::{io::*,util::*,lower_bound::*};
use rust::libs::math::{mod_int::*,prime_factor::*};
use rust::libs::data_structure::{union_find::*,segment_tree::*};
use rust::libs::algebraic_structure::monoid::{plus::*,max::*,min::*};
use std::ops::Range;
use  std::collections::*;
const MOD: u32 = 1_000_000_007;
const INF:i64=1i64<<60;
const_mod!(P,MOD);

fn main() {
    input!{
        a:usize,b:usize,c:usize,d:usize,
    }
    println!("{} {}",(a*b) as f64 *0.5,btoi!(a==c*2&&b==d*2));
}
//  [rust]
use std::io;
use std::io::Read;
use std::collections::HashMap;

fn main() -> io::Result<()>{

    let mut buffer = String::new();
    io::stdin().read_line(&mut buffer)?;

    let split: Vec<&str> = buffer.split_ascii_whitespace().collect();
    let W: usize = split[0].parse().unwrap();
    let H: usize = split[1].parse().unwrap();
    let x: usize = split[2].parse().unwrap();
    let y: usize = split[3].parse().unwrap();

    let w1 = W - x;
    let w2 = W - w1;
    let h1 = H - y;
    let h2 = H - h1;

    if (x == 0 || x == W) || (y == 0 || y == H) {
        print!("{} {}", H as f64 * W as f64 / 2.0, 0);
        return Ok(())
    }

    // if x == 0 || x == W {
    //     if h1 == h2 {
    //         print!("{} {}", h1 * W, 0)
    //     } else if h1 > h2 {
    //         print!("{} {}", h2 * W, 0)
    //     } else {
    //         print!("{} {}", h1 * W, 0)
    //     }
    //     return Ok(())
    // }
    // 
    // if y == 0 || y == H {
    //     if w1 == w2 {
    //         print!("{} {}", w1 * H, 0)
    //     } else if w1 > w2 {
    //         print!("{} {}", w2 * H, 0)
    //     } else {
    //         print!("{} {}", w1 * H, 0)
    //     }
    //     return Ok(())
    // }
    // 
    let mut multi = 0;
    if w1 == w2 && h1 == h2 {
        multi = 1;
    }

    let mut min_area: usize = 0;
    if w1 > w2 {
        min_area = w2 * H;
    } else {
        min_area = w1 * H;
    }
    if h1 > h2 {
        if min_area < h2 * W {
            min_area = h2 * W;
        }
    } else {
        if min_area < h1 * W {
            min_area = h1 * W;
        }
    }

    println!("{} {}", min_area, multi);
    Ok(())
}
//  [rust]
use std::io;
use std::io::Read;
use std::collections::HashMap;

fn main() -> io::Result<()>{

    let mut buffer = String::new();
    io::stdin().read_line(&mut buffer)?;

    let split: Vec<&str> = buffer.split_ascii_whitespace().collect();
    let W: usize = split[0].parse().unwrap();
    let H: usize = split[1].parse().unwrap();
    let x: usize = split[2].parse().unwrap();
    let y: usize = split[3].parse().unwrap();

    let w1 = W - x;
    let w2 = W - w1;
    let h1 = H - y;
    let h2 = H - h1;

    if (x == 0 || x == W) && (y == 0 || y == H) {
        print!("{} {}", H as f64 * W as f64 / 2.0, 0);
        return Ok(())
    }

    if x == 0 || x == W {
        if h1 == h2 {
            print!("{} {}", h1 * W, 0)
        } else if h1 > h2 {
            print!("{} {}", h2 * W, 0)
        } else {
            print!("{} {}", h1 * W, 0)
        }
        return Ok(())
    }

    if y == 0 || y == H {
        if w1 == w2 {
            print!("{} {}", w1 * H, 0)
        } else if w1 > w2 {
            print!("{} {}", w2 * H, 0)
        } else {
            print!("{} {}", w1 * H, 0)
        }
        return Ok(())
    }

    let mut multi = 0;
    if w1 == w2 && h1 == h2 {
        multi = 1;
    }

    let mut min_area: usize = 0;
    if w1 > w2 {
        min_area = w2 * H;
    } else {
        min_area = w1 * H;
    }
    if h1 > h2 {
        if min_area < h2 * W {
            min_area = h2 * W;
        }
    } else {
        if min_area < h1 * W {
            min_area = h1 * W;
        }
    }

    println!("{} {}", min_area, multi);
    Ok(())
}
//  [swift]
let input = readLine()!.split(separator: " ").map { Double($0)! }

let w = input[0]
let h = input[1]
let x = input[2]
let y = input[3]

print(w * h / 2.0, 2.0 * x == w && 2.0 * y == h ? "1" : "0")
//  [swift]
let input = readLine()!.characters.split(" ").map{Double(Int(String($0))!)}
let (W, H, x, y) = (input[0], input[1], input[2], input[3])
print("\(W*H/2) \(x==W/2 && y==H/2 ? 1 : 0)")
//  [swift]
// 🐋💭
import Foundation

func readInts() -> [Int] {
    return readLine()!.split(separator: " ").map { Int($0)! }
}

func readInt() -> Int {
    return Int(readLine()!)!
}

func readDoubles () -> [Double] {
    return readLine()!.split(separator: " ").map { Double($0)! }
}

func readDouble() -> Double{
    return Double(readLine()!)!
}
///最大公約数を返す
func gcd(_ m:Int, _ n:Int) -> Int {
    if n == 0 {return m}
    return gcd(n, m % n)
}
///最小公倍数を返す
func lcm(_ m:Int, _ n:Int) -> Int {
    return m * n / gcd(m, n)
}

///素数判定(試し割り)
func isPrime(_ x:Int) -> Bool {
    if x <= 1 || x % 2 == 0 { return false }
    if x == 2 { return true }
    for i in stride(from: 3, to: Int(ceil(sqrt(Double(x)))), by: 2){
        if x % i == 0 {
            return false
        }
    }
    return true
}

//https://program-life.com/669
///実行速度の計測
func exectionTime(action: () -> Void) {
    let startDate = Date()
    action()
    let endDate = Date()
    print(endDate.timeIntervalSince(startDate))
}

// https://melheaven.hatenadiary.jp/entry/atcoder144
///約数の配列を返す
func makeDivisors(_ n:Int) -> [Int] {
    var divisors = [Int]()
    for i in 1..<Int(pow(Double(n), 0.5)) + 1 {
        if n % i == 0{
            divisors.append(i + n / i)
        }
    }
    
    return divisors
}

//https://riptutorial.com/ja/swift/example/14738/インデックスを知らずに配列から要素を削除する
extension Array where Element: Equatable {
    
    mutating func remove(_ element: Element) {
        _ = index(of: element).flatMap {
            self.remove(at: $0)
        }
    }
}

func binarySearch(rifgt:Int, key:Int, ary:[String]) -> Int{
    var left = 0
    var right = rifgt
    
    while abs(right - left) > 1 {
        let mid = left + (right - left) / 2
        
        if Int(ary[mid])! < key {
            left = mid
            
        } else {
            right = mid
        }
    }
    return left
}

func arrangement (prev:String, ary:[String], returnVal:[String]) -> [String] {
    var returnVal = returnVal
    if ary.count == 0 {
        returnVal.append(prev)
        return returnVal
    }
    
    for s in ary {
        let wprev = prev + s
        var wary = ary
        wary.remove(s)
        returnVal = arrangement(prev: wprev, ary: wary, returnVal: returnVal)
    }
    return returnVal
}

func main() {
    let WHxy = readDoubles()
    let (X, Y, x, y) = (WHxy[0], WHxy[1], WHxy[2], WHxy[3])
    //＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿ここまで入力
    
    print(X * Y / 2,X / 2 == x && Y / 2 == y ? "1": "0")
}
main()
//  [swift]
let i=readLine()!.characters.split(" ").map{Double(String($0))!}
print("\(i[0]*i[1]/2) \(i[2]==i[0]/2&&i[3]==1[1]/2 ?1:0)")
//  [swift]
#if os(Linux)
    import Glibc
#else
    import Darwin
#endif
extension String: CollectionType {}

var a: [Int] = readLine()!.split(" ").map { Int($0)! }

let Smax = a[0]*a[1]/2

var pl = 0

if a[2] != 0 {
  if a[2] == a[0]/2 {
    pl = 1
  } else {
    pl = 0
  }
  pl = 0
}

if a[3] != 0 {
  if a[3] == a[0]/2 {
    pl = 1
  } else {
    pl = 0
  }
  pl = 0
}

print(String(Smax) + " " + String(pl))
//  [swift]
let arr=readLine()!.characters.split{$0==" "}.map{Float(String($0))!}
let w = arr[0]
let h = arr[1]
let x = arr[2]
let y = arr[3]

var m = w * h
var mx = x * h
var my = y * w
var o : Float = 0
var o2 = 0
if( mx < my ) {
  o = mx
} else {
  o = my
}

if( mx == my ) {
  o2 = 1
}

print ( o, o2 )
//  [typescript]
export class Main {
  static main(input): string {
    const [w, h, x, y]: number[] = input.split("\n")[0].split(" ").map(Number);
    return `${w * h / 2} ${w / 2 == x && h / 2 == y ? 1 : 0}`;
  }
}
console.log(Main.main(require("fs").readFileSync("/dev/stdin", "utf8")));
//  [typescript]
// inputに入力データ全体が入る
function Main(input) {
	// 1行目がinput[0], 2行目がinput[1], …に入る
	input = input.split("\n");
	const w = parseInt(input[0].split(" ")[0], 10);
	const h = parseInt(input[0].split(" ")[1], 10);
	const x = parseInt(input[0].split(" ")[2], 10);
	const y = parseInt(input[0].split(" ")[3], 10);
	// 処理
  	let flg = 0;
  	if(x === w/2 && y === h/2) flg =1;
  	console.log(`${w*h/2} ${flg}`);
}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [typescript]
import * as fs from "fs";

const input = (fs.readFileSync("/dev/stdin", "utf8") as string).split("\n");
const [w, h, x, y] = input[0].split(" ").map((x: string): number => +x);

// 重心を求める
const cx = w/2;
const cy = h/2;

let pattern = 0;
if(cx===x && cy===y){
  // 重心と与えられた点が一致する場合は分割方法は無数にある
  pattern = 1;
}

console.log(w*h/2, pattern);
//  [typescript]
const input=require('fs').readFileSync('/dev/stdin','utf8').split(/[\s]/);let input_i=-1;const tn=():number=>{input_i++;return Number(input[input_i])};const tnn=(n:number):number[]=>{const a=[];for(let i=0;i<n;i++){a.push(tn())}return a};const ts=():string=>{input_i++;return String(input[input_i])};const tss=(n:number):string[]=>{const a=[];for(let i=0;i<n;i++){a.push(ts())}return a};const to=(...arg)=>{console.log(...arg)};const abs=(a)=>{return Math.abs(a)};const min=(...a)=>{return Math.min(...a)};const max=(...a)=>{return Math.max(...a)};const floor=(a)=>{return Math.floor(a)};const asc=(ar:number[])=>{const t=[...ar];return ar.sort((a,b)=>{return a-b})};const desc=(ar:number[])=>{const t=[...ar];return t.sort((a,b)=>{return b-a})};const sw=(a,arr:any[],op:'=='|'>='|'>'|'<='|'<'='==')=>{for(let i=0;i<arr.length-1;i+=2){if(eval(a+op+arr[i])){return arr[i+1]}}return arr[arr.length-1]};const near=(n:number,arr:number[]):number=>{let ne=arr[0],ni=0;for(let i=1;i<arr.length;i++){if(Math.abs(n-ne)>Math.abs(n-arr[i])){ne=arr[i];ni=i}}return ni};const deduplicate=(a:any[]):any[]=>{return Array.from(new Set(a))};const gcd=(x,y)=>{while(y){[x,y]=[y,x%y]}return x};
const main=()=>{
  let [w,h,x,y]=tnn(4),d=0
  let a=min(w-x,x)*h
  let b=min(h-y,y)*w
  if(x==y)d=1
  to(max(a,b)+' '+d)
}
main()
//  [python]
a = list(map(int,input().split()))
a.sort()
b = list(map(lambda x:x%2,a))
ans = 0

if sum(b) in (1,2):
    ans += 1
    for i in range(3):
        if sum(b) == 1:
            a[i] -= b[i]
        else:
            a[i] += b[i]

ans += (a[2]-a[0])//2+ (a[2]-a[1])//2
print(ans)
//  [python]
a, b, c = map(int, input().split())

ans = 3 * max(a, b, c) - (a + b + c)

if ans % 2 == 0:
    print(int(ans / 2))
elif ans % 2 == 1:
    print(int((ans + 3) / 2))
//  [python]
abc = sorted(list(map(int, input().split())), reverse=True)
ans = 0

if abc[1]%2 != 0 and abc[2]%2 == 0:
    ans += 1
    abc[0] += 1
    abc[1] += 1

elif abc[1]%2 == 0 and abc[2]%2 != 0:
    ans += 1
    abc[0] += 1
    abc[2] += 1

ans += abc[0] - abc[1]
ans += (abc[1] - abc[2])//2

print(ans)
//  [python]
a,b,c = map(int, input().split())

s = a+b+c
cnt = 0
while True:
    s += 2
    cnt += 1
    if s%3==0:
        if s//3 >= a and s//3 >= b and s//3>= c:
            break
print(cnt)
//  [python]
a,b,c = map(int, input().split())

s = a+b+c
cnt = 0
f = 0
while True:
    s += 2
    cnt += 1
    if s%3==0:
        if s//3 >= a and s//3 >= b and s//3>= c:
            f = 1
    if f:
        break
print(cnt)
//  [python]
a,b,c = map(int, input().split())

s = a+b+c
cnt = 0
f = 0
while True:
    s += 2
    cnt += 1
    if s%3==0:
        if s//3 >= a and s//3 >= b and s>= c:
            f = 1
    if f:
        break
print(cnt)
//  [java]
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;

class Main{
    public static void main(String[] args) throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String[] input = br.readLine().split(" ");
        int[] array = new int[3];
        int answer = 0;

        for(int i = 0; i < 3; i++){
            array[i] = Integer.parseInt(input[i]);
        }

        Arrays.sort(array);
        for(int i = 0; i < 3; i++){
            array[i] = array[2] - array[i];
        }

        if(array[0] + array[1] == 0){
            //do nothing.
        }else if(array[0] != array[1] && array[1] != array[2]){    
            if(array[0] % 2 == array[1] % 2){
                answer += (array[0] - array[1]) / 2;
                answer += array[1];
            }else if(array[0] % 2 == 0){
                answer++;
                array[0]--;
                answer += array[0]/2 + 1;
                answer += array[1]/2 + 1;
            }else if(array[1] % 2 == 0){
                answer++;
                array[1]--;
                answer += array[0]/2 + 1;
                answer += array[1]/2 + 1;    
            }    
        }else if(array[0] == array[1]){
            answer += array[0];
        }else if(array[1] == array[2]){
            answer += array[0]%2;
            answer += (array[0]+1)/2;
        }
        
        System.out.println(answer);
    }
}
//  [java]
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
import java.util.Arrays;

public class Main {
  public static void main(String[] args) throws IOException {
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    String[] str = in.readLine().split(" ");
    int a = Integer.parseInt(str[0]);
    int b = Integer.parseInt(str[1]);
    int c = Integer.parseInt(str[2]);
    int sum = a+b+c;
    int max = Math.max(Math.max(a,b),c);
    int min = Math.min(Math.min(a,b),c);
    int middle = sum-max-min;
    int count = 0;
    if((3*max)%2 != sum%2) {
      max++;
      count++;
    }
    count+=(3*max-sum)/2;
    
    System.out.println(count);
  }
}
//  [java]
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
import java.util.Arrays;

public class Main {
  public static void main(String[] args) throws IOException {
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    String[] str = in.readLine().split(" ");
    int[] num = new int[3];
    for(int i=0; i<3; i++) {
      num[i] = Integer.parseInt(str[i]);
    }
    
    Arrays.sort(num);
    
    int count = num[2]-num[1];
    count += (num[1]-num[0])/2;
    if((num[2]-num[1])%2!=0)
      count+=2;
    System.out.println(count);
  }
}
//  [java]
import java.util.Arrays;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        Integer[] arr = new Integer[3];
        int total = 0;
        for(int i = 0; i < 3; i++) {
            arr[i] = sc.nextInt();
            total += arr[i];
        }
        Arrays.sort(arr, Collections.reverseOrder());

        int cnt = 0;
        while(total%3!=0 || arr[0]*3>total) {
            cnt++;
            total+=2;
        }
        System.out.println(cnt);
    }
}
//  [cpp]
#include<stdio.h>
typedef long long ll;
ll a,b,c;
int main(){
	scanf("%lld %lld %lld",&a,&b,&c);
	if(b >= c && b >= a) {ll tmp = a; a = b; b = tmp;}
	else if(c >= b && c >= a) {ll tmp = a; a = c; c = tmp;}
	
	int cnt = 0;
	while(b <= a-2) b += 2,cnt++;	
	while(c <= a-2) c += 2,cnt++;
	
	if(a == b && b == c)printf("%d",cnt);
	else if(b <a && c < a) printf("%d",cnt+1);
	else printf("%d",cnt+2);
}
//  [cpp]
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

vector<int> v(3);
int main(){
	cin >> v[0] >> v[1] >> v[2];
	sort(v.begin(),v.end());
	int a = (v[1]-v[0])%2;
	if(a==1) cout << (v[1]-v[0])/2 + 1 + v[2]-v[1]+1 << endl;
	else cout << (v[1]-v[0])/2 + v[2]-v[1] << endl;
}
//  [cpp]
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cmath>
using namespace std;

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

int main()
{
    int a, b, c;
    cin >> a >> b >> c;
    int sum = a + b + c;
    int max = a;
    if (max < b) max = b;
    if (max < c) max = c;
    int res = max * 3 - sum;
    if (res % 2 == 0) {
        cout << res / 2 << endl;
    } else {
        cout << (res + 3) / 2 << endl;
    }
    return 0;
}
//  [cpp]
#include<bits/stdc++.h>
using namespace std;
int main() {
    ios_base :: sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    vector<int> s(3);
    for(int i=0; i<3; i++){
        cin >> s.at(i);
    }
    sort(s.begin(), s.end());
    int cnt = 0;
    cnt += (s.at(2)-s.at(1));
    if(s.at(2)-((s.at(0))+cnt)%2==1){
        cnt += (s.at(2) - (s.at(0) + cnt))/2 + 2;
    }
    else{
        cnt += (s.at(2) - (s.at(0)+cnt))/2;
    }
    cout << cnt << endl;
    return 0;
}
//  [cpp]
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define reps(i,n) for(int i=1;i<(int)(n);i++)

typedef long long ll;
using namespace std;

ll gcd(ll a, ll b) { //最大公約数
  if (b==0) return a;
  else return gcd(b, a%b);
}

ll lcm(ll a, ll b) { //最小公倍数
  return a * b / gcd(a, b);
}

ll digit_sum(ll a){ //10進桁和
  ll ans=0;
  while(a>0){
    ans+=a%10;
    a/=10;
  }
  return ans;
}



int main()
{
  ll a[3];
  cin>>a[0]>>a[1]>>a[2];
  sort(a,a+3);

  cout<<a[2]-a[1]-a[0]+(a[1]+a[0])/2+(a[1]+a[0])%2<<endl;

  return 0;
}
//  [cpp]
#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;

int main(){
    vector<int> vec(3);
    for (int i=0; i<3; i++){
        cin >> vec[i];
    }
    sort(begin(vec), end(vec));
    int ans=0;
    ans += (vec[1] - vec[0]) / 2;
    vec[0] += ans * 2;
    if (vec[0] != vec[1]){
        vec[2] += 1;
    } 
    ans += vec[2] - vec[1];
    cout << ans << endl;
    return 0;
}
//  [c]
#include <stdio.h>

int main (void)
{
    int a, b, c, max, ax, bx, cx, x, m;
    scanf("%d %d %d", &a, &b, &c);

    max = a;
    if (max < b) max = b;
    if (max < c) max = c;

    ax = (max - a) / 2;
    bx = (max - b) / 2;
    cx = (max - c) / 2;

    a = 2 * ax + a;
    b = 2 * bx + b;
    c = 2 * cx + c;

    x = ax + bx + cx;

    max = a;
    if (max < b) max = b;
    if (max < c) max = c;

    m = (max - a);
    m += (max - b);
    m += (max - c);

    if (m == 2) x += 1;
    if (m == 1) x += 2;


    printf("%d\n", x);
}
//  [c]
#include <stdio.h>
#include <stdlib.h>

int main()
{
	int A, B, C;
	scanf("%d %d %d", &A, &B, &C);
	
	int sum = A + B + C, max = (A < B)? ((B < C)? C: B): (C < A)? A: C;
	if ((sum - max) % 2 == 0) printf("%d\n", (max * 3 - sum) / 2);
	else printf("%d\n", (max * 3 - sum + 3) / 2);
	fflush(stdout);
	return 0;
}
//  [c]
#include<stdio.h>
int main(){
  int a,b,c,count;
  scanf("%d%d%d",&a,&b,&c);
  if(a>=b && a>=c)
    count=2*a-b-c;
  else if(b>=a && b>=c)
    count=2*b-a-c;
  else
    count=2*c-a-b;
  if(count%2==0)
    printf("%d\n",count/2);
  else
    printf("%d\n",(count+3)/2);
  return 0;
}
//  [c]
#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
#define rep(i,n) for(int i=0;i<(n);++i)
#define repi(i,a,b) for(int i=int(a);i<int(b);++i)
#define all(x) (x).begin(), (x).end()
#define PI 3.14159265358979323846264338327950L
using namespace std;
typedef long long ll;
typedef long double ld;
int main() {
    vector<int> s(3);
    rep(i,3) cin>>s[i];
    sort(all(s));
    int a=s[2],b=s[1],c=s[0],cnt=0;
    if((a-b)%2==(a-c)%2) cnt=a-b+(b-c)/2;
    else cnt=a-b+(b-c+1)/2+1;
    cout<<cnt;
}
//  [c]
#include <bits/stdc++.h> 
using namespace std;
#define rep(i, N) for(int i=0; i<N; i++)
typedef long long ll;
#define dump(x) cerr<<#x<<"="<<x<<endl
using P = pair<int, int>;

int main() {
    int a, b, c; cin >> a >> b >> c;
    if(a<b) swap(a,b);
    if(a<c) swap(a,c);
    if(b<c) swap(b,c);

    if(3*a%2==(a+b+c)%2){
        cout << (2*a - b - c)/2 << endl;
    }
    else{
        cout << (2*a + 3 - b - c)/2 << endl; 
    }

   return 0;
}