jiahuimbzuai/CoQuIR huggingface dataset:
//  [javascript]
process.stdin.resume();
process.stdin.setEncoding('utf8');

var g_input = '';
process.stdin.on('data', function(chunk) {
    g_input += chunk;
});

process.stdin.on('end', function() {
    Main(g_input.split(/\r?\n/));
});

function Main(input) {

    var ab = input[0].split(' ');
    var a = parseInt(ab[0], 10);
    var b = parseInt(ab[1], 10);

    var ans = 0;
    if (a <= b) {
        ans = a;
    }
    else {
        ans = a - 1;
    }

    console.log(ans);

    return 0;
}
//  [javascript]
function Main(input) {
    tmp = input.split(" ");
    var a = parseInt(tmp[0], 10);
    var b = parseInt(tmp[1], 10);
    if (b < a) {
    	result = a - 1;
    } else {
    	result = a;
    }
    //結果
    console.log(result);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [go]
package main

import "fmt"

func main() {
	// Code for A - Day of Takahashi
	var a, b int
	fmt.Scanf("%d %d", &a, &b)
	if b-a >= 0 {
		fmt.Println(a)
	} else {
		fmt.Println(a - 1)
	}
}
//  [go]
package main

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

var sc = bufio.NewScanner(os.Stdin)

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

func intScanner() int {
	n, _ := strconv.Atoi(Scanner())
	return n
}

func floatScanner() float64 {
	n, _ := strconv.ParseFloat(Scanner(), 64)
	return n
}
func stringToInt(s string) int {
	n, _ := strconv.Atoi(s)
	return n
}
func stringSliceScanner(n int) []string {
	a := make([]string, n)
	for i := 0; i < n; i++ {
		a[i] = Scanner()
	}
	return a
}
func intSliceScanner(n int) []int {
	a := make([]int, n)
	for i := 0; i < n; i++ {
		a[i] = intScanner()
	}
	return a
}
func larger(a, b int) int {
	if a < b {
		return b
	} else {
		return a
	}
}
func smaller(a, b int) int {
	if a > b {
		return b
	} else {
		return a
	}
}
func max(a []int) int {
	x := a[0]
	for i := 0; i < len(a); i++ {
		if x < a[i] {
			x = a[i]
		}
	}
	return x
}
func min(a []int) int {
	x := a[0]
	for i := 0; i < len(a); i++ {
		if x > a[i] {
			x = a[i]
		}
	}
	return x
}
func abs(x int) int {
	if x < 0 {
		x = -x
	}
	return x
}

var mod int = 1000000007

func main() {
	buf := make([]byte, 0)
	sc.Buffer(buf, mod)
	sc.Split(bufio.ScanWords)
	a, b := intScanner(), intScanner()
	if b < a {
		fmt.Println(a - 1)
	} else {
		fmt.Println(a)
	}
}
//  [go]
package main

import "fmt"

func main() {
	var a, b int
	fmt.Scan(&a, &b)

	if a <= b {
		fmt.Println(a)
	} else {
		fmt.Println(a - 1)
	}
}
//  [ruby]
require 'date'
a,b = gets.split.map(&:to_i)


i = Date.new(2018,1,1)
last = Date.new(2018,a,b).succ

x = 0

while i != last
    x += 1 if i.day == i.mon
    i = i.succ
end


p x
//  [ruby]
a, b = gets().chomp.split("\s").map{|x| x.to_i}

puts a <= b ? a : a - 1
//  [ruby]
a,b=gets.split.map(&:to_i)
p a>b ?a-1:a
//  [rust]
#![allow(unused_imports)]
#![allow(dead_code)]
use proconio::input;
use proconio::fastout;
use proconio::marker::{Chars};

#[fastout]
fn main() {
    input! {
        a:i32,b:i32,
    }
    let v:[i32;12]=[31,28,31,30,31,30,31,31,30,31,30,31];
    let mut ans=0;
    for i in 1..a+1{
        if i==a{
            for j in 1..b+1{
                if i==j{
                    ans+=1;
                }
            }
        }else{
            for j in 1..v[(i-1) as usize]+1{
                if i==j{
                    ans+=1
                }
            }
        }
    }
    println!("{}",ans);
}
//  [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();

    if b >= a {
        a.to_string()
    } else {
        (a - 1).to_string()
    }
}
//  [swift]
import Foundation
 
let strs = readLine()!.componentsSeparatedByString(" ")
let a = Int(strs[0])!
let b = Int(strs[1])!
let m = min(a, b)
if m == a {
  print("\(a)")
} else {
  print("\(a - 1)")
}
//  [typescript]
namespace sample {
  class Scanner {
    private buffer = '';
    private stdinQueue: any = [];

    constructor() {
      process.stdin.resume();
      process.stdin.setEncoding('utf8');
      process.stdin.on(
        'data',
        (chunk): void => {
          this.buffer += chunk;
          while (this.stdinQueue.length > 0) {
            const i = this.buffer.indexOf('\n');
            if (i < 0) {
              break;
            }
            let line = this.buffer.substr(0, i);
            if (line.endsWith('\r')) {
              line = line.slice(0, -1);
            }
            this.buffer = this.buffer.substr(i + 1);
            this.stdinQueue.shift()(line);
          }
        },
      );
    }
    public getLine(): Promise<string> {
      return new Promise((resolve, reject) => {
        const i = this.buffer.indexOf('\n');
        if (i >= 0 && this.stdinQueue.length == 0) {
          let line = this.buffer.substr(0, i);
          if (line.endsWith('\r')) {
            line = line.slice(0, -1);
          }
          this.buffer = this.buffer.substr(i + 1);
          resolve(line);
        } else {
          this.stdinQueue.push(resolve);
        }
      });
    }

    public close(): void {
      process.stdin.pause();
    }
  }

  async function slove() {
    const sc = new Scanner();
    const [a, b]: number[] = (await sc.getLine()).split(' ').map((x) => +x);
    if (a > b) {
      console.log(a - 1);
    } else {
      console.log(a);
    }
    sc.close();
  }

  slove();
}
//  [typescript]
import { readFileSync } from "fs";

const read = () =>
  readFileSync(0, "utf8")
    .split("\n")
    .map((line) => line.split(" "));

const main = (input: string[][]) => {
  const [a, b] = input[0].map(Number);

  return b < a ? a - 1 : a;
};

console.log(main(read()));
//  [typescript]
(async () => {
  const input = require('fs').readFileSync('/dev/stdin', 'utf8').split(/\s/);
  const [a, b, ...rest] = input.map(x => parseInt(x, 10));
  const ans = b >= a? a : a - 1;
  console.log(ans);
})();
//  [python]
N = input()
print reduce(lambda x, y: x * y % (10 ** 9 + 7),  range(1, N + 1))
//  [python]
def factorial(n):
    fact = 1
    for i in range(2, n+1):
        fact = (fact * i) % (10 ** 9 + 7)
    return fact
 
 
if __name__ == '__main__':
    n = int(input())
    print(factorial(n))
//  [python]
def training(N) :
  power = 1
  for i in range(1, N + 1) : 
    power = (power * i) % (10 ** 9 + 7)
    
  return power

N = int(input())

print(training(N))
//  [python]
N = int(input())

d = 10 ** 9 + 7

if N <= 50000:
    P= 1
    for x in range(1, N+1):
        P *= x
elif N > 50000:
    P = 737935835
    for x in range(50001, N + 1):
        P *= x
    
print(P%d)
//  [python]
INF = 1000000007


def modmulti(a, b):
    # aとbを掛けた値をmodする(a * b mod p)
    res = 0
    mod = a % INF
    while b > 0:
        if b & 1 == 1:
            res += mod
            if res > INF:
                res -= INF
        mod <<= 1
        if mod > INF:
            mod -= INF
        b >>= 1
    return res


N = int(input())

ans = 1

for i in range(1, N + 1):
    ans = modmulti(ans, i)

print(ans)
//  [java]
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Main {
    int n;
    int MOD = 1000000007;

    public static void main(String args[]) {
        new Main().run();
    }

    void run() {
        FastReader sc = new FastReader();
        n = sc.nextInt();
        solve();
    }

    void solve() {
        System.out.println(fillFactorial(n, MOD)[n]);
    }

    long[] fillFactorial(int max, int mod) {
        long[] facts = new long[max + 1];
        facts[0] = 1;
        for (int i = 1; i < facts.length; i++) {
            facts[i] = facts[i - 1] * i % mod;
        }
        return facts;
    }

    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        public FastReader() {
            br = new BufferedReader(new
                    InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements())
            {
                try
                {
                    st = new StringTokenizer(br.readLine());
                }
                catch (IOException e)
                {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt()
        {
            return Integer.parseInt(next());
        }

        long nextLong()
        {
            return Long.parseLong(next());
        }

        double nextDouble()
        {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
        }
    }
}
//  [java]

import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.math.BigDecimal;
import java.util.NoSuchElementException;

public class Main {

	public static void main(String[] args) throws IOException {
		new Main().solve();
	}

	private void solve() throws IOException {
		try {
			//			solveA();
			//			solveB();
			solveB2();
			// solveC();
			// solveD();
			// solveE();
			// solveF();
		} finally {
			if (in != null) {
				in.close();
			}
			if (out != null) {
				out.flush();
				out.close();
			}
		}

	}

	private void solveA() {
		int numN = nextInt();

		int resX = numN * 800;
		int resY = (numN / 15) * 200;

		out.println(resX - resY);
	}

	private void solveB() {
		int numN = nextInt();

		BigDecimal CONST = new BigDecimal(Math.pow(10, 9)).add(new BigDecimal("7"));
		BigDecimal res = BigDecimal.ONE;
		for (int i = 1; i <= numN; i++) {
			res = res.multiply(new BigDecimal(Integer.toString(i)));
		}

		out.println(res.remainder(CONST));
	}

	private void solveB2() {
		int numN = nextInt();
		long CONST = (long) (Math.pow(10, 9) + 7);

		long res = 1;
		for (int i = 1; i <= numN; i++) {
			res = (res * i) % CONST;
		}

		out.println(res);
	}

	private void solveC() {
		int numN = nextInt();

		out.println("");
	}

	private void solveD() {
		int numN = nextInt();

		out.println("");
	}

	private void solveE() {
		int numN = nextInt();

		out.println("");
	}

	private void solveF() {
		int numN = nextInt();

		out.println("");
	}

	private final PrintWriter out = new PrintWriter(System.out);
	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;
	}

	private void skipUnprintable() {
		while (hasNextByte() && !isPrintableChar(buffer[ptr]))
			ptr++;
	}

	public boolean hasNext() {
		skipUnprintable();
		return hasNextByte();
	}

	public int nextInt() {
		return Integer.parseInt(next());
	}

	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();
		}
	}
}
//  [java]
import javax.net.ssl.SSLContext;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigDecimal;
import java.util.Arrays;
import java.util.List;

public class Main {

    public static void main(String[] args) throws IOException {

        BigDecimal M = new BigDecimal(1_000_000_000 + 7);

        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));

        int i = Integer.parseInt(reader.readLine());

        BigDecimal result = BigDecimal.ONE;

        for (int index = 1; index <= i; index++) {
            result = result.multiply(new BigDecimal(index));
            if (result.compareTo(M) >= 0) {
                result = result.divideAndRemainder(M)[1];
            }
        }

        System.out.println(result.longValue());


//        PrintWriter writer = new PrintWriter(System.out);
//
//        writer.close();


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

public class Main {

	private static Scanner sc = new Scanner(System.in);

	public static void main(String[] args) {
		int mod = 1_000_000_007;
		int n = sc.nextInt();
		long ans = 1;
		for (int i = 1; i <= n; i++) {
			ans = ans * i % mod;
		}
		System.out.println(ans);
	}
}
//  [cpp]
#include<cstdio>
#define ll long long
#define mod 1000000007ll
using namespace std;

ll ans=1;

int main(){
	int n;
	scanf("%d",&n);
	for(ll i=1;i<=n;i++) ans=ans*i%mod;
	printf("%lld\n",ans);
	return 0;
}
//  [cpp]
#include <cstdio>
#include <algorithm>

#define MOD (1000000000 + 7)

using namespace std;
int n, sol = 1;

int main()
{
    scanf("%d", &n);
    for(int i = 1; i<= n; ++i) sol = (1LL * sol * i) % MOD;
    printf("%d\n", sol);
    return 0;
}
//  [cpp]
#include <stdio.h>

int main()
{
	long long a,i;
	const long long MOD = 1000000007;
	scanf("%lld",&a);
	for(i=a-1;i>0;i--)
	{
		a = a*i%MOD;
	}
	printf("%lld\n",a);
}
//  [cpp]
#include <iostream>
#include <fstream>
#include <algorithm>
#include <string>
#include <vector>
#include <cmath>

#include <boost/multiprecision/cpp_int.hpp>

using namespace std;
using namespace boost::multiprecision;

cpp_int power(int p, int q){
    cpp_int ret = p;
    for(int i=1;i<q;i++){
        ret *= p;
    }
    return ret;
}

int main(void){
	int n = 0;
    cin >> n;
    cpp_int pow = 1;
    for(int i=1;i<=n;i++){
        pow *= i;
    }
    cout << pow % (7 + power(10,9)) << endl;
	return 0;
}
//  [cpp]
//インクルード
#include <cstdlib>
#include <iostream>
#include <string>
#include <vector>
#include <boost/multiprecision/cpp_int.hpp>

//型宣言
typedef long long ll;
typedef unsigned long long ull;
typedef std::string string;
typedef boost::multiprecision::cpp_int answerType;

//変数宣言
ll N;
ll M;
std::vector<string> Ai;
std::vector<string> Bi;
answerType answer;

//関数のプロトタイプ宣言
//入力の取得
void getInput();
//答えを求める
answerType calcAnswer();

//メイン関数
int main() {
	//入力の取得
	getInput();

	//答え
	answerType answer = calcAnswer();

	//答えの出力
	std::cout << answer << std::endl;

	//正常終了
	return EXIT_SUCCESS;
}

//入力の取得
void getInput() {
	std::cin >> N;
}

//答えを求める
answerType calcAnswer() {
	boost::multiprecision::cpp_int temp = 1;
	for(ull i=1; i<=N; ++i) {
		temp *= i;
	}
	return temp % 1000000007;
}
//  [cpp]
#include <iostream>

using namespace std;

long long factorial(long i){
    long long threshold = 1000000007;
    if(i == 1)
        return 1;
    else{
        long long tmp = i*factorial(i-1);
        while (tmp >= threshold){
            tmp -= threshold;
        }
        return tmp;
    }
}

int main(){
    long long n; cin >> n;
    long long ans = 1;
    cout << factorial(n) << endl;
}
//  [c]
#include<stdio.h>
int main()
{
	int n,i;
	long a=1;

	scanf("%d",&n);

	for(i=1;i<=n;i++){
		a=a*i%1000000007;
	}
	printf("%ld",a);
	return 0;
}
//  [c]
#include <stdio.h>
#include <string.h>
#include <math.h>
int main() {

    int n;
    scanf("%d", &n);

    int cnt = 1;
    long power = 1;
    while (cnt <= n) {
        power *= cnt;
        power %= (long)(pow(10, 9) + 7);

        //printf("%ld\n", power);
        cnt++;
    }
    

    printf("%ld", power);

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

int main(){
  int n;  scanf("%d", &n);
  long ans = 1;
  long m = 1000000007;
  for(int i=2; i<=n; i++)
    ans =(ans * i) % m;
  printf("%ld\n", ans);
  return 0;
}
//  [c]
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(void){
    long long n,ans=1 ;
    scanf ("%lld",&n) ;
    for (int i=1; i<=n; i++) {
        ans*=i;
        while (ans>=1000000007){
            ans-=1000000007 ;
        }
    }
    printf ("%lld\n",ans) ;
	return 0 ;
}
//  [c]
#include <stdio.h>
#include <math.h>
int main(void){
    int n;
    long long power=1;
    scanf("%d", &n);
    for(int i=1; i<=n; i++) power=(power*i)%(long long)(pow(10, 9)+7);
    printf("%lld", power);
    return 0;
}
//  [c]
#include<stdio.h>
#include<math.h>
int main(void){
    double n,large,pw,i;
    scanf("%lf",&n);
    large=1000000007;
    pw=1;
    for(i=1;i<=n;i++){
        pw*=i;
        pw=fmod(pw,large);
    }
    printf("%.0lf\n",pw);
    return 0;
}
//  [javascript]
"use strict";

var main = function main(input) {
  var N = parseInt(input, 10);
  var power = 1;

  while (N != 0) {
    power = power * N % 1000000007;
    N--;
  }

  console.log(power);
};

main(require('fs').readFileSync('/dev/stdin', 'utf-8'));
//  [javascript]
'use strict'
 
function main(input) {
  let x = 1;
  const y = 1000000007
  input = input - 0
  for (let i = 1;i < input + 1;i++) {
    x = x * i;
    if (x > y) x = x % y;
  }
  console.log(x);
}
 
main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
// inputに入力データ全体が入る
function Main(input) {
  　input = Number(input)
    var num = 1000000007
    var P = 1;
    for(var i = 1; i <= input; i++){
      P *= Number(i)
      P %= num
    }
    console.log(P)
}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
function Main(input) {
    a=1;
    for(i=0;i<input;i++){
      a=a*(i+1).toFixed()%1000000007;
    }
    console.log(a%1000000007);
}
 
 
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
function myin(){return require("fs").readFileSync("/dev/stdin", "utf8").trim();}
function myout(t){console.log(t);}//standard output
function myerr(t){console.error(t);}//standard error
//[no]param
//0:何もしない  1:数値へ変換  2:半角SPで分割  3:改行で分割  4:半角SPで分割し、数値配列へ
//5:改行で分割し、数値配列へ  6:1文字に分割  7:1文字に分割し、数値配列へ
function myconv(i,no){switch(no){case 0:return i;case 1:return parseInt(i);case 2:return i.split(" ");case 3:return i.split("\n");case 4:return i.split(" ").map((a)=>Number(a));case 5:return i.split("\n").map((a)=>Number(a));case 6:return i.split("");case 7:return i.split("").map((a)=>Number(a));}}

function Main(input) {
  input = myconv(input,1);
  var output = 1;
  for(var i = 1; i <= input; i++){
    output = output * i % 1000000007;
  }
  myout(output);
}

Main(myin());
//  [javascript]
process.stdin.resume();
process.stdin.setEncoding('utf8');
var N;
var mo=1000000007;
// 標準入力がくると発生するイベント
process.stdin.on('data', function (chunk) {
    chunk.trim().split('\n').forEach(function(line) {
        //console.log('>' + line);
		N=parseInt(line);
    });
});
// EOFがくると発生するイベント
process.stdin.on('end', function () {
	var power=1;
	for(var i=1;i<N+1;i++){
		power*=i;
		power%=mo;
	}
	console.log(power);
});
//  [go]
package main

import (
	"fmt"
)

func main() {
	var N int
	fmt.Scan(&N)

	var power = 1

	for i := 1; i <= N; i++ {
		power *= i
		power %= 1000000007
	}

	fmt.Println(power)
}
//  [go]
package main

import "fmt"

func main() {
	var s, n int
	fmt.Scan(&s)
	n = 1
	for i := 1; i < s+1; i++ {
		n *= i
		n %= 1000000007
	}
	fmt.Println(n)
}
//  [go]
package main

import (
	"fmt"
)

func main() {
	var n int
	fmt.Scan(&n)

	const mod = 1000000007
	power := 1
	for i := 1; i <= n; i++ {
		power = power * i
		power %= mod
	}

	fmt.Println(power)
}
//  [go]
package main

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

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	var in int
	for scanner.Scan() {
		in, _ = strconv.Atoi(scanner.Text())
		break
	}

	n := big.NewInt(1)
	for i := 1; i < in; i++ {
		n.Mul(n, big.NewInt(int64(i+1)))
	}

	ans := big.NewInt(0)
	ans.Mod(n, big.NewInt(1000000007))
	fmt.Println(ans)
}
//  [go]
package main

import (
	"fmt"
	"math"
	"math/big"
)

func main() {
	var n int
	fmt.Scan(&n)

	bp := big.NewInt(1)
	for i := 1; i <= n; i++ {
		bi := big.NewInt(int64(i))
		bp = bp.Mul(bp, bi)
	}
	bn := big.NewInt(int64(math.Pow(10, 9)) + 7)
	res := bp.Mod(bp, bn)
	fmt.Println(res)
}
//  [go]
package main

import (
  "fmt"
)

func pow(args ...int) int {
  x, y := args[0], args[1]
  res := 1
  if len(args) == 3 {
    mod := args[2]
    for y != 0 {
      if y & 1 == 1 {res = res * x % mod}
      y >>= 1
      x = x * x % mod
    }
  }  else {
    for y != 0 {
      if y & 1 == 1 {res *= x}
      y >>= 1
      x *= x
    }
  }
  return res
}

const mod = 1e9 + 7
func makeTables(n, r, p int) ([]int, []int, []int) {
  fac, ifac, nChoose := make([]int, r + 1), make([]int, r + 1), make([]int, r + 1)
  fac[0] = 1; for i := 0; i < r; i++ {fac[i+1] = fac[i] * (i + 1) % p}
  ifac[r] = pow(fac[r], p - 2, p); for i := r; i > 0; i-- {ifac[i-1] = ifac[i] * i % p}
  nChoose[0] = 1; for i := 0; i < r; i++ {nChoose[i+1] = nChoose[i] * (n - i) % p}
  for i := 0; i < r + 1; i++ {nChoose[i] = nChoose[i] * ifac[i] % p}
  return fac, ifac, nChoose
}
var fac, ifac, nChoose = makeTables(1e9, 1e7, mod)
func choose(n, r int) int {
  if r > n || r < 0 {return 0}
  var p int = mod
  return fac[n] * ifac[n-r] % p * ifac[r] % p
}

func main() {
  var n int 
  fmt.Scan(&n)
  fmt.Println(fac[n])
}
//  [ruby]
n = $stdin.gets.to_i
j = n
x = 1
while j > 0 do
x = (x * j)% 1000000007
j = j - 1
end
p x
//  [ruby]
a = gets.to_i
b = 10 ** 9 + 7
p = 1
1.upto(a) do |i|
  p = i * p % b
end
puts p
//  [ruby]
require 'prime'
h = Hash.new(0)
n = gets.chomp.to_i
1.upto(n) do |i|
  Prime.prime_division(i).each do |a, b|
    h[a] += b
  end
end
ret = 1
h.each do |k, v|
  ret *= (k ** v) % (10**9 + 7)
end
puts ret % (10**9 + 7)
//  [rust]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };

    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };

    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };

    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };

    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}

#[allow(unused_imports)]
use std::{i32, i64, u32, u64, f64};
#[allow(unused_imports)]
use std::cmp::{max, min, Ordering};
#[allow(unused_imports)]
use std::collections::{VecDeque, HashMap, BTreeMap, HashSet, BTreeSet};
#[allow(unused_imports)]
use std::io::{stdout, Write, BufWriter};
#[allow(unused_imports)]
use std::mem::{swap};
//#[allow(unused_imports)]
//use proconio::marker::{Isize1, Usize1, Bytes, Chars};

//#[proconio::fastout]
fn main() {
    input!{
        n: u64,
    }
    println!("{}", (1..(n + 1)).fold(1, |p, k| { (p * k) % (10u64.pow(9) + 7) }));
}
//  [rust]
#![allow(unused_macros)]

// cf. [Rustで競技プログラミングの入力をスッキリ記述するマクロ - Qiita](https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8)
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    input! {
        N: usize,
    }
    let MOD = 1_000_000_007;
    let mut p = 1;
    for i in 0..N {
        p *= i + 1;
        p %= MOD;
    }
    println!("{}", p);
}
//  [rust]
fn main() {
    let n: u64 = {
        let mut buf = String::new();
        std::io::stdin().read_line(&mut buf).ok();
        buf.trim().parse().ok().unwrap()
    };
    let mut ans: u64 = 1;
    for i in 1..n + 1 {
        ans = ans * i % 1000000007;
    }
    println!("{}", ans);
}
//  [rust]
use proconio::{fastout, input};

#[fastout]
fn main() {
    input! {n: u128};

    let mut result = 1;
    let max = 1_000_000_000 + 7;

    for i in 1..n + 1 {
        result *= i;
        if result > max {
            result %= max;
        }
    }

    println!("{}", result)
}
//  [rust]
use proconio::{input, fastout};
use proconio::marker::{Chars};
use proconio::marker::Usize1;
use std::cmp::*;

macro_rules! debug {
      ($($a:expr),*) => {
          eprintln!(concat!($(stringify!($a), " = {:?}, "),*), $($a),*);
    }
}

#[fastout]
fn main() {
    input!{
        n: usize,
    }

    let inf = 10_0000_0000 + 7;
    let mut ans = 1;
    for i in 1..n+1 {
        ans *= i;
        ans %= inf;
    }

    println!("{}", ans);

}
//  [rust]
use proconio::input;

fn main() {
	input!(n: usize);

	let mut ans = 1;
	for i in 1..n+1 {
		ans = ans * i % 1000000007;
	}
	println!("{}", ans);
}
//  [swift]
print((1...Int(readLine()!)!).reduce(1){($0*$1)%1000000007})
//  [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 main=()=>{
  let n=tn(),c=1
  for(let i=1;i<=n;i++){
    c=i*c%(10**9+7)
  }
  to(c)
}
main()
//  [typescript]
{
  const Main = input => {
    const n: number = parseInt(input.trim());
    const mod: number = 10 ** 9 + 7

    let power: number = 1
    for (let i = 1; i <= n; i++) {
      power = power * i % mod
    }

    console.log(power)
  };

  Main(require("fs").readFileSync("/dev/stdin", "utf8"));
}
//  [typescript]
import * as fs from 'fs'

const getInput = (): string => {
  return (fs.readFileSync('/dev/stdin', 'utf8') as string).trim()
}

export const solveAbc055b = () => {
  const input = getInput()

  const N = Number(input.trim())
  // console.log(N)

  let ans = 1
  for (let i = 1; i <= N; i += 1) {
    ans *= i
    ans = ans % (Math.pow(10, 9) + 7)
  }
  console.log(ans)
}
solveAbc055b()
//  [typescript]
const lines: string[] = [];
const reader = require("readline").createInterface({
  input: process.stdin,
  output: process.stdout,
});
reader.on("line", function (line: string) {
  lines.push(line);
});

reader.on("close", function () {
  const input = lines[0];
  let res = 1;

  for (let i = Number(input); i > 1; i--) {
    res = (res * i) % 1000000007;
  }

  console.log(res);
});
//  [typescript]
// inputに入力データ全体が入る
function Main(input) {
	// 1行目がinput[0], 2行目がinput[1], …に入る
	input = input.split("\n");
	const n = parseInt(input[0], 10);
	// 処理
  	const d = 10**9 + 7;
  	let val = 1;
	for (let i = 1; i <= n; i++) {
		val = val * i;
      	if(val>d) val%=d;
	}
  	console.log(val%d);
}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [typescript]
import { readFileSync } from "fs";

const read = () =>
  readFileSync(0, "utf8")
    .split("\n")
    .map((line) => line.split(" "));

const main = (input: string[][]) => {
  const N = Number(input[0][0]);
  const M = 10 ** 9 + 7;

  let power = 1;

  for (let i = 1; i <= N; i++) {
    power = (power * i) % M;
  }

  return power;
};

console.log(main(read()));
//  [python]
# encoding:utf-8
import copy
import random
import bisect #bisect_left　これで二部探索の大小検索が行える
import fractions #最小公倍数などはこっち
import math
import sys

mod = 10**9+7
sys.setrecursionlimit(mod) # 再帰回数上限はでdefault1000

W,H,x,y = map(int,input().split())
area = W*H/2
if x == W/2 and y == H/2:
    cnt = 1
else:
    cnt = 0

print(area,cnt)
//  [python]
# -*- coding: utf-8 -*-
"""
AtCoder A
"""

import sys, math, random
import numpy as np

# N = int(input())
# A = list(map(int,input().split())) # N row 1 column
# A = [int(input()) for _ in range(N)] # 1 row N column
# S = str(input()) # str(input()) == input() -> 'abc'
# S = list(input()) # abc -> ['a','b','c']
# S.replace('ABC','X') # "testABCABC" -> "testXX"
 
inf = 10**20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]
 
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(): return [list(map(int, l.split())) for l in sys.stdin.readlines()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()


def main():
    W, H, x, y = list(map(int,input().split()))
    if W==x*2 and H==y*2:
        print("%f 1"%(W*H/2))
    else:
        print("%f 0"%(W*H/2))
    
if __name__ == "__main__":
    main()
//  [python]
from collections import Counter 
from collections import defaultdict
from collections import deque
import math
import itertools
import heapq
import numpy as np
import sys
sys.setrecursionlimit(10**6)

#n=int(input())
#n,m=list(map(int,input().split()))
#a=list(map(int,input().split()))
input_list = lambda : list(map(int,input().split()))


w,h,x,y=input_list()
ans=w*h/2
mul=0
if w==x*2 and h==y*2:
    mul=1

print(ans,mul)
//  [java]
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Scanner;

public class Main {
    public static void main(String[] arg) {

        try (Scanner scanner = new Scanner(System.in)){
            int[] input = Arrays.stream(scanner.nextLine().split(" ")).mapToInt(Integer::parseInt).toArray();
            double w = input[0];
            double h = input[1];
            double x = input[2];
            double y = input[3];

            System.out.println(String.format("%f %d", (w * h) / 2.0, w / 2.0 == x && h / 2.0 == y ? 1 : 0));
        }

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

class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    long[] nums = Stream.of(sc.nextLine().split(" ")).mapToLong(Long::parseLong).toArray();
    long w = nums[0];
    long h = nums[1];
    long x = nums[2];
    long y = nums[3];
    double max = w * h / 2.0;
    boolean isMulti = x + x == w && y + y == h;
    StringBuilder sb = new StringBuilder();
    sb.append(max);
    sb.append(" ");
    sb.append(isMulti ? 1 : 0);
    System.out.print(sb.toString());
  }
}
//  [cpp]
#include <cstdio>
#include <cstring>
#include <cassert>

void print_zeroes(int n) {
  char s[100000];
  memset(s, '0', sizeof s);
  int out = 0;
  for (int i = 0; i < (n / 100000); ++i) {
    out += fwrite(s, 1, sizeof s, stdout);
  }

  out += fwrite(s, 1, (n % 100000), stdout);
  assert(out == n);
}

int main() {
  int W, H, x, y;
  scanf("%d %d %d %d", &W, &H, &x, &y);

  int out = printf("%.1f", 0.5*H*W);

  print_zeroes((1 << 27) - (out+3));

  putchar(' ');
  puts((x+x == W && y+y == H)? "1": "0");
}
//  [cpp]
#include <cstdio>
#include <cstring>

int main() {
  int W, H, x, y;
  scanf("%d %d %d %d", &W, &H, &x, &y);

  printf("%.16f", 0.5*H*W);

  char s[100000];
  memset(s, '0', sizeof s);
  for (int i = 0; i < 1000; ++i)
    fwrite(s, 1, sizeof s, stdout);

  putchar(' ');
  puts((x+x == W && y+y == H)? "1": "0");
}
//  [c]
#include<stdio.h>
#include<stdlib.h>
#include<stdbool.h>
#include<math.h>
#include<string.h>
#define rep(i,l,r) for(ll i=l;i<r;i++)

typedef long long ll;

ll max(ll x, ll y) { return (x > y) ? x : y; }


int main() {
    double w,h,x,y;
    scanf("%lf%lf%lf%lf", &w,&h,&x,&y);
    printf("%f\n", w * h / 2);
    if (w / 2 == x && h / 2 == y) printf("1");
    else printf("0");

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


int main(void){
  long double W,H,x,y;
  scanf("%Le%Le%Le%Le",&W,&H,&x,&y);

  printf("%Lf ",W*H/2);

  if(W/2==x){
    if(H/2==y){
      printf("1\n");
      return 0;
    }
  }
  printf("0");
  return 0;
 }
//  [c]
#include<stdio.h>
int main(){
  double h,w,x,y;
  scanf("%lf %lf %lf %lf",&w,&h,&x,&y);
  if(x == w/2 && y == h/2){
    printf("%lf %d",w*h/2,1);
  }else{
    printf("%lf %d",w*h/2,0);
  }
}
//  [javascript]
const main = (input) => {
    input = input.split(" ");
    const W = Number(input[0]);
    const H = Number(input[1]);
    const x = Number(input[2]);
    const y = Number(input[3]);

    const min_area = (W * H) / 2;
    console.log(min_area.toFixed(6));

    const straightY = -(H / W) * x + H

    if (straightY == y) {
        console.log("1");
    } else {
        console.log("0");
    }
};

main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
//Don't have to see. start------------------------------------------
var read = require('readline').createInterface({
  input: process.stdin,
  output: process.stdout
});
var obj;
var inLine = [];
read.on('line', function(input){inLine.push(input);});
read.on('close', function(){
  obj = init(inLine);
  console.error("\n");
  var start = Date.now();
  Main();
  var end = Date.now() - start;
  myerr("time : " + (end) + "ms");
  myerr("memory : " + Math.round(process.memoryUsage().heapTotal / 1024) + "KB");
});
function makeClone(obj){return JSON.parse(JSON.stringify(obj));}
function nextInt(){return myconv(next(),1);} function nextStrArray(){return myconv(next(),2);}
function nextIntArray(){return myconv(next(),4);} function nextCharArray(){return myconv(next(),6);}
function next(){return obj.next();} function hasNext(){return obj.hasNext();}
function init(input){  
  var returnObj = {
    list : input, index : 0, max : input.length,
    hasNext : function(){return (this.index < this.max);},
    next : function(){if(!this.hasNext()){throw "ArrayIndexOutOfBoundsException ‚There is no more input";}else{var returnInput = this.list[this.index];this.index++;return returnInput;}}
  };
  return returnObj;
}
function myout(s){console.log(s);}
function myerr(s){console.error("debug:" + require("util").inspect(s,false,null));}
//param "no" is
//unknown or outlier : return i. 1: parseInt.
//2: split space. 4: split space and parseInt.
//6: split 1 character. 7: split 1 character and parseInt.
//8: join space. 9: join nextline. 0: join no character.
function myconv(i,no){try{switch(no){case 1:return parseInt(i);case 2:return i.split(" ");case 4:return i.split(" ").map(Number);case 6:return i.split("");case 7:return i.split("").map(Number);case 8:return i.join(" ");case 9:return i.join("\n");case 0:return i.join("");default:return i;}}catch(e){return i;}}

//Don't have to see. end------------------------------------------
function Main(){
  var one = nextIntArray();
  var W = one[0];
  var H = one[1];
  var x = one[2];
  var y = one[3];
  var output = new Array(2);
  output[0] = H * W / 2;
  output[1] = (x == W / 2 && y == H / 2) ? 1 : 0;
  myout(myconv(output, 8));
}
//  [javascript]
"use strict"
const create = () => {
    const input = require("fs").readFileSync("/dev/stdin", "utf8").trim().split("\n");
    const res = {
        "list": input, "index": 0, "max": input.length,
        "hasNext": function() {return this.index < this.max},
        "next": function() { if (!this.hasNext()) {throw "ArrayIndexOutOfBoundsException";}else{return this.list[this.index++];}}
    };
    return res;
}
const o = create();
const next = () => o.next()
const nextInt = () => parseInt(o.next())
const nextStrArray = () => o.next().split(" ")
const nextIntArray = () => o.next().split(" ").map(el => parseInt(el))
const nextCharArray = () => o.next().split("")
const hasNext = () => o.hasNext()
const myout = (...x) => console.log(...x)
const Main = () => {
    const [W,H,x,y] = nextIntArray()
    const area = W*H/2
    let pat = 0
    if(x == W/2 && y == H/2) pat = 1
    console.log(area, pat)

}
Main()
//  [go]
package main

import (
	"fmt"
)

var (
	finv, inv, fac [MAX]int
)

func COM(n, k int) int {
	if n < k {
		return 0
	}
	if n < 0 || k < 0 {
		return 0
	}
	return fac[n] * (finv[k] * finv[n-k] % MOD) % MOD
}

func init() {
	fac[0] = 1
	fac[1] = 1
	finv[0] = 1
	finv[1] = 1
	inv[1] = 1
	for i := 2; i < MAX; i++ {
		fac[i] = fac[i-1] * i % MOD
		inv[i] = MOD - inv[MOD%i]*(MOD/i)%MOD
		finv[i] = finv[i-1] * inv[i] % MOD
	}
}

const (
	MOD = 998244353
	MAX = 510000
)

func ModAdd(a, b int64) int64 {
	return (a + b) % MOD
}

func ModMul(a, b int64) int64 {
	return a * b % MOD
}

func ModSub(a, b int64) int64 {
	r := (a%MOD - b%MOD) % MOD
	if r < 0 {
		r += MOD
	}
	return r
}

func ModDiv(a, b int64) int64 {
	return a % MOD * ModInv(b) % MOD
}

func ModPow(a, n int64) int64 {
	var r int64 = 1
	for n > 0 {
		if n&1 == 1 {
			r = r * a % MOD
		}
		a = a * a % MOD
		n >>= 1
	}
	return r
}

func ModInv(a int64) int64 {
	var b, u, v int64 = MOD, 1, 0
	for b > 0 {
		t := a / b
		a -= t * b
		a, b = b, a
		u -= t * v
		u, v = v, u
	}
	u %= MOD
	if u < 0 {
		u += MOD
	}
	return u
}

type Q struct {
	value int
	index int
	A, B  int
}

type QS []*Q

func (p QS) Len() int           { return len(p) }
func (p QS) Less(i, j int) bool { return p[i].value > p[j].value }
func (pq QS) Swap(i, j int) {
	pq[i], pq[j] = pq[j], pq[i]
	pq[i].index = i
	pq[j].index = j
}

func (pq *QS) Push(x interface{}) {
	n := len(*pq)
	item := x.(*Q)
	item.index = n
	*pq = append(*pq, item)
}

func (pq *QS) Pop() interface{} {
	old := *pq
	n := len(old)
	item := old[n-1]
	old[n-1] = nil  // avoid memory leak
	item.index = -1 // for safety
	*pq = old[0 : n-1]
	return item
}

func FactoredPrimeNumber(num int) map[int]int {
	m := map[int]int{}
	return factor(m, num, 2)
}

func factor(result map[int]int, num, pnum int) map[int]int {
	if pnum*pnum > num {
		if num != 1 {
			result[num] += 1
		}
		return result
	}

	if num%pnum == 0 {
		num /= pnum
		result[pnum]++
	} else {
		pnum++
	}
	return factor(result, num, pnum)
}

func GCD(a, b int64) int64 {
	if b == 0 {
		return a
	}
	return GCD(b, a%b)
}

func LCM(a, b int64) int64 {
	return a * b / GCD(a, b)
}

func main() {
	var W, H, x, y int
	fmt.Scanf("%d %d %d %d\n", &W, &H, &x, &y)

	fmt.Print(float64(W*H)/2, " ")
	if 2*x == W && 2*y == H {
		fmt.Print(1)
	} else {
		fmt.Println(0)
	}
	fmt.Println()
}

func Reverse(runes []rune) []rune {
	for i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {
		runes[i], runes[j] = runes[j], runes[i]
	}
	return runes
}
//  [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 2*x == W && y*2 == H {
		fmt.Printf("%f %d", ans, 1)
	} else {
		fmt.Printf("%f %d", ans, 0)
	}
	//fmt.Printf("%d\n", Alllength)
	//fmt.Printf("%d\n", Looplength)
}
//  [ruby]
#!/usr/bin/env ruby

require 'set'

class Hash
  def push(key, value)
    self[key] = [] if self[key] == nil
    self[key].push(value)
  end
end

class Array
  def lower_bound(value)
    left = -1;
    right = self.length;
    while left + 1 < right
      mid = left + (right - left) / 2;
      if self[mid] >= value
        right = mid
      else
        left = mid
      end
    end
    right
  end

  def unique
    res = [self.first]
    each_cons(2) do |a, b|
      if a != b
        res.push(b)
      end
    end
    res
  end
end

def get_ints
  gets.chomp.split.map(&:to_i)
end

def get_ints_minus_one
  get_ints.map { |x| x - 1 }
end

def get_int
  gets.chomp.to_i
end

require 'bigdecimal'

W, H, x, y = get_ints

half = (W * H) / BigDecimal(2)

multi = (x * 2 == W && y * 2 == H) ? 1 : 0

puts "#{half.to_f} #{multi}"
//  [ruby]
line = gets.split(' ').map(&:to_i)

W = line[0]
H = line[1]
X = line[2]
Y = line[3]

ans1 = W.to_f * H.to_f / 2.0
if X * 2 == W and Y * 2 == H then
  ans2 = 1
else
  ans2 = 0
end
  
print ans1.to_s + " " + ans2.to_s
//  [ruby]
w, h, x, y = gets.chomp.split.map &:to_i

is_center = x * 2 == w && y * 2 == h

ans = w * h / 2.0

puts [ans, is_center ? 1 : 0].join(' ')
//  [rust]
use proconio::input;

fn main() {
  input! {
    w: f64,
    h: f64,
    x: f64,
    y: f64
  }
  println!("{}", w * h / 2f64);
  if w / 2f64 == x  && h / 2f64 == y {
    println!("1");  
  } else {
    println!("0");
  }
}
//  [rust]
#![allow(unused, non_snake_case, dead_code, non_upper_case_globals)]
use {
    proconio::{marker::*, *},
    std::{cmp::*, collections::*, mem::*},
};

#[fastout]
fn main() {
    input! {//
        w:i64,h:i64,x:i64,y:i64,
    }
    if x * 2 == w && y * 2 == h {
        println!("{} {}", (w * h) as f64 / 2.0, 1);
    } else {
        println!("{} {}", (w * h) as f64 / 2.0, 0);
    }
}
//  [rust]
use proconio::{fastout, input};

#[fastout]
fn main() {
    input! {
        w: u64,
        h: u64,
        x: u64,
        y: u64
    };

    let center_x = w as f64 / 2.0;
    let center_y = h as f64 / 2.0;

    if center_x == x as f64 && center_y == y as f64 {
        println!("{} 1", (w * h) as f64 / 2.0);
    } else {
        println!("{} 0", (w * h) as f64 / 2.0);
    }
}
//  [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
  if(h/2==y&&w/2==x)d=1
  to(w*h/2+' '+d)
}
main()
//  [typescript]
import * as fs from "fs"

const process = (w: number, h: number, x: number, y: number): string => {
  const area = (w * h) / 2
  const div = w / 2 === x && h / 2 === y ? "1" : "0"
  return area + " " + div
}

const Main = (input: string): string => {
  const a: string[] = input.split(" ")
  const na: number[] = a.map((e) => parseInt(e))

  const res = process(na[0], na[1], na[2], na[3]) + ""
  console.log(res)
  return res
}
Main(fs.readFileSync("/dev/stdin", "utf8"))
//  [python]
# -*- coding: utf-8 -*-
import numpy as np
inputs = np.array(input().split(), dtype = 'float')

diff = inputs.max() * 3 - inputs.sum()
if diff % 2 == 0:
    print(int(diff / 2.0))
else:
    print(int(np.floor(diff / 2.0)) + 2)
//  [python]
# coding : utf-8

import numpy as np

A,B,C = input().split()
A,B,C = int(A),int(B),int(C)


maxl = max(A,B,C)
diff = [maxl-A,maxl-B,maxl-C]

diff = sorted(diff)

count = 0

count += diff[1]
diff[2] -= diff[1]

count += int(diff[2]/2)
diff[2] = diff[2]%2

if diff[2] == 1:
	count += 2

print(int(count))
//  [python]


import numpy as np

def main():
    count=0
    temp=input()
    l=list(map(int,list(temp.split(" "))))
    l.sort()
    
    sa1=l[2]-l[0]
    sa2=l[2]-l[1]
    if sa1%2==1 and sa2%2==1:
        sa1-=1
        sa2-=1
        count+=1
        count+=int(sa1/2)+int(sa2/2)
    elif sa1%2==1 and sa2%2==0:
        sa1+=1
        count+=1
        count+=int(sa1/2)+int(sa2/2)
    
    elif sa1%2==0 and sa2%2==1:
        sa2+=1
        count+=1
        count+=int(sa1/2)+int(sa2/2)
    
    elif sa1%2==0 and sa2%2==0:
        # sa1-=1
        # sa2-=1
        # count+=1
        count+=int(sa1/2)+int(sa2/2)

    print(count)

        


    



    
  

    

if __name__ == '__main__':
    main()