akhauriyash/Code-Regression huggingface dataset:
import java.util.Scanner;
public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int n=sc.nextInt();
		String s=sc.next();
		int[] left=new int[n];
		int[] right=new int[n];
		for(int i=0; i<n-1; i++){
			if(s.charAt(i)=='W'){
				left[i+1]=1;
			}
			left[i+1]+=left[i];
		}
		for(int i=n-1; i>0; i--){
			if(s.charAt(i)=='E'){
				right[i-1]=1;
			}
			right[i-1]+=right[i];
		}
		int ans=n;
		for(int i=0; i<n; i++){
			ans=Math.min(ans,left[i]+right[i]);
		}
		System.out.println(ans);
	}
}



Measured memory_bytes: 30988
#include<iostream>
#include<algorithm>
#include<vector>
#include<stack>
#include<queue>
#include<list>
#include<string>
#include<cstring>
#include<cstdlib>
#include<cstdio>
#include<cmath>
using namespace std;

const int MAX = 100001;
const int NIL = -1;
struct Node {
	int parent, left, right;
};
struct Node T[MAX];

void preParse(int u)
{
	if (u == NIL)
		return;
	cout << " " << u;
	preParse(T[u].left);
	preParse(T[u].right);
}

void inParse(int u)
{
	if (u == NIL)
		return;
	inParse(T[u].left);
	cout << " " << u;
	inParse(T[u].right);
}

void postParse(int u)
{
	if (u == NIL)
		return;
	postParse(T[u].left);
	postParse(T[u].right);
	cout << " " << u;
}

int main(void)
{
	int n, L, R, child, node;
	cin >> n;
	for (int i = 0; i < n; i++) {
		T[i].parent = T[i].left = T[i].right = NIL;
	}
	for (int i = 0; i < n; i++) {
		cin >> node >> L >> R;
		if (L != NIL) {
			T[node].left = L;
			T[L].parent = node;
		}
		if (R != NIL) {
			T[node].right = R;
			T[R].parent = node;
		}
	}
	for (int i = 0; i < n; i++) {
		if (T[i].parent == NIL) {
			cout << "Preorder" << endl;
			preParse(i);
			cout << endl << "Inorder" << endl;
			inParse(i);
			cout << endl << "Postorder" << endl;
			postParse(i);
			cout << endl;
			break;
		}
	}
	return 0;
}


Measured memory_bytes: 3100
import java.util.Scanner;

public class Main {

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

		Scanner sc = new Scanner(System.in);
		String[] str = sc.nextLine().split(" ");
		int[] num = new int[str.length];
		int i = 0;

		for(int j = 0; j < str.length; j++) {

			String temp = str[j];

			if(temp.matches("[0-9]{1,}")) {
				num[i] = Integer.parseInt(temp);
				i++;
			} else {
				switch(temp) {
				case "+" :
					num[i-2] = num[i-2] + num[i-1];
					i--;
					break;
				case "-" :
					num[i-2] = num[i-2] - num[i-1];
					i--;
					break;
				case "*" :
					num[i-2] = num[i-2] * num[i-1];
					i--;
					break;

				}
			}
		}
		System.out.println(num[i-1]);
	}

}


Measured memory_bytes: 26228
#include <bits/stdc++.h>
#include <iostream>
#define ll long long
#define mem(f, x) memset(f, x, sizeof(f))
#define INF 0x3f3f3f3f
using namespace std;
const int M = 15;
const int N = 10005;
ll a, b, c, k;
int main( ){
    while( scanf( "%lld %lld %lld %lld", &a, &b, &c, &k ) != EOF ){
        if( k <= a )
            printf( "%lld\n", k );
        else if( k <= a+b )
            printf( "%lld\n", a );
        else
            printf( "%lld\n", a-(k-(a+b)));
    }
    return 0;
}


Measured memory_bytes: 3812
import java.util.*;
import java.util.stream.IntStream;

public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int H = sc.nextInt();
        int W = sc.nextInt();

        IntStream.range(0,W+2).forEach(i -> System.out.print("#"));
        System.out.print("\n");
        for(int y=0;y<H;y++){
            System.out.print("#");
            String s = sc.next();
            System.out.print(s);
            System.out.print("#\n");
        }
        IntStream.range(0,W+2).forEach(i -> System.out.print("#"));
    }
}

Measured memory_bytes: 27092
using System;
using System.Collections.Generic;
using System.Linq;

//ABC058-D
//http://abc058.contest.atcoder.jp/tasks/arc071_b
class Program
{
    const long Hou = 1000000007;

    static string InputPattern = "InputX";

    static List<string> GetInputList()
    {
        var WillReturn = new List<string>();

        if (InputPattern == "Input1") {
            WillReturn.Add("3 3");
            WillReturn.Add("1 3 4");
            WillReturn.Add("1 3 6");
            //60
        }
        else if (InputPattern == "Input2") {
            WillReturn.Add("6 5");
            WillReturn.Add("-790013317 -192321079 95834122 418379342 586260100 802780784");
            WillReturn.Add("-253230108 193944314 363756450 712662868 735867677");
            //835067060
        }
        else {
            string wkStr;
            while ((wkStr = Console.ReadLine()) != null) WillReturn.Add(wkStr);
        }
        return WillReturn;
    }

    static void Main()
    {
        List<string> InputList = GetInputList();
        int[] XArr = InputList[1].Split(' ').Select(A => int.Parse(A)).ToArray();
        int[] YArr = InputList[2].Split(' ').Select(A => int.Parse(A)).ToArray();

        long SenbunSumX = DeriveSenbunSum(XArr);
        long SenbunSumY = DeriveSenbunSum(YArr);

        long Answer = SenbunSumX * SenbunSumY;
        Answer %= Hou;
        Console.WriteLine(Answer);
    }

    //座標の配列を引数として、作成可能な線分の長さの総和を返す
    static long DeriveSenbunSum(int[] pArr)
    {
        int UB = pArr.GetUpperBound(0);
        long SenbunSum = 0;
        for (int I = 0; I <= UB; I++) {
            long CurrPos = pArr[I] % Hou;
            int KeisuuMinus = I;
            int KeisuuPlus = UB - I;
            SenbunSum += -CurrPos * KeisuuMinus;
            SenbunSum %= Hou;
            SenbunSum += CurrPos * KeisuuPlus;
            SenbunSum %= Hou;
        }
        return SenbunSum;
    }
}


Measured memory_bytes: 36576
#include <iostream>
#include <algorithm>
#include <map>
#include <math.h>
using namespace std;

int main(){
    string x,y;
    cin >> x >> y;

    if (x.length() == y.length()-1 && x == y.substr(0, x.length())){
        cout << "Yes";
    }else{
        cout << "No";
    }
}


Measured memory_bytes: 3132
#include <bits/stdc++.h>
using namespace std;

signed main(){
    int n , m , k , s , p[10] , bit , on[10] = {} , ans=0 , light;
    bool all;
    
    cin >> n >> m;
    for(int i=0 ;i<m ;i++ ){
        cin >> k;
        for(int j=0 ;j<k ;j++ ){
            cin >> s;
            s--;
            on[i] = on[i] | (1<<s);
        }
    }
    
    for(int i=0 ;i<m ;i++ ){
        cin >> p[i];
    }
    
    for(int i=0 ;i<(1<<n) ;i++ ){
        all = true;
        for(int j=0 ;j<m ;j++ ){
            bit = on[j] & i;
            light = 0;
            for(int l=0 ;l<n ;l++ ){
                if(bit & (1<<l)){
                    light++;
                }
            }
            if(p[j] != light%2){
                all = false;
            }
        }
        if(all){
            ans ++;
        }
    }
    
    cout << ans << endl;
    return(0);
}


Measured memory_bytes: 256
import java.util.*;
public class Main {
	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc= new Scanner(System.in);
		
		int R= sc.nextInt();
		
		sc.close();
		
		double ans= 2* R *Math.PI;
		
		System.out.println(ans);
	}

}


Measured memory_bytes: 35944
#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int,int>;


int main()
{
    int h,w,n;
    cin >> h >> w >>n;
    int a=max(h,w);
 cout<<(a + n - 1) / a<<endl;
return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<iomanip>
using namespace std;
int main(){
    double n,k,ans=0,p;
    cin>>n>>k;
    int i=1,point=1;
    for(p=1.0/n;i<=n;p=1.0/n,i++,point=i){
        while(point<k)point<<=1,p*=1/2.0;
        ans+=p;
    }
    cout<<setprecision(15)<<ans<<endl;
    return 0;
}

Measured memory_bytes: 256
import java.util.*;

public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);

        int N = sc.nextInt();
        int D = sc.nextInt();

        if(N%(2*D+1)!=0){
            System.out.println(N/(2*D+1)+1);
        }
        else{
            System.out.println(N/(2*D+1));
        }
    }
}

Measured memory_bytes: 21844
# エラトステネスの篩
N = int(input())

sieve = [0] * (N + 1)
sieve[0] = -1
sieve[1] = -1
for i in range(2, N + 1):
    if sieve[i] != 0:
        continue
    sieve[i] = i
    for j in range(i * i, N + 1, i):
        if sieve[j] == 0:
            sieve[j] = i


def f(X):
    t = []
    a = X
    while a != 1:
        if len(t) != 0 and t[-1][0] == sieve[a]:
            t[-1][1] += 1
        else:
            t.append([sieve[a], 1])
        a //= sieve[a]
    result = 1
    for _, n in t:
        result *= (n + 1)
    return result


result = 0
for K in range(1, N + 1):
    result += K * f(K)
print(result)


Measured memory_bytes: 147460
#include <iostream>
#include <cmath>
using namespace std;
 
int main(){
	int a,b,x;
	
	cin>>a>>b;
		
	x=a+b;
	
	if(x%2==0) {
		cout<<x/2<<endl;
	}else{
        cout<<int(x/2)+1<<endl;
	}
	
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int a[10005],ans,n;
int main(void){
    cin>>n;
    for(int i=1;i<=2*n;i++) cin >> a[i];
    sort(a+1,a+1+2*n);
    for(int i=1;i<=2*n;i+=2) ans=ans+a[i];
    cout<<ans<<"\n";
}

Measured memory_bytes: 256
#include <algorithm>
#include <iostream>
#include <vector>
#include <math.h>
#include <set>
#include <map>
#include <string>
#include <stack>
#include <queue>
#include <iomanip>
#include <numeric>
#include <tuple>
#include <bitset>
#include <complex>
#include <unistd.h>
#include <cassert>
#include <cctype>
#include <random>
#include <time.h>
#define _USE_MATH_DEFINES
#define _GLIBCXX_DEBUG
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> plglg;
typedef pair<double, ll> pdlg;
typedef tuple<int, int, int> tiii;
typedef tuple<ll, ll, ll> tlglglg;
typedef tuple<double, double, double> tddd;
typedef complex<double> xy_t;
typedef vector<ll> vll;
typedef vector< vector<ll> > matrix;
typedef unsigned int uint;
typedef unsigned long long ull;
template <class T> using V = vector<T>;
template <class T> using VV = V<V<T>>;
template <class T> using VVV = V<VV<T>>;
#define REP(i, x, y) for(ll i = (ll)x; i < (ll)y; i++)
#define DREP(i, x, y, d) for(ll i = (ll)x; i < (ll)y; i += (ll)d)
#define PER(i, x, y) for(ll i = (ll)x; i > (ll)y; i--)
#define DPER(i, x, y, d) for(ll i = (ll)x; i > (ll)y; i -= (ll)d)
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
double pi = 3.141592653589793;
ll mod = 1000000007;
int intmax = 2147483647;
int intmin = -2147483648;
ll llmax = 9223372036854775807;
ll llmin = -9223372036854775807;
int iinf = intmax / 8;
ll inf = llmax / 8;
double eps = 1e-12;
void yesno(bool ok, string yes = "Yes", string no = "No") {
    if (ok) {
        cout << yes << endl;
    } else {
        cout << no << endl;
    }
}

ll abs(ll a, ll b) {
    return (b > a) ? b - a : a - b;
}

ll dp[2010][2010];

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll N;
    cin >> N;
    plglg A[N];
    REP(i, 0, N) {
        ll a;
        cin >> a;
        A[i] = plglg(a, i);
    }
    sort(A, A + N);
    reverse(A, A + N);
    REP(i, 0, N + 10) {
        fill(dp[i], dp[i] + N + 10, -1);
    }
    dp[0][0] = 0;
    REP(i, 0, N) {
        REP(j, 0, N) {
            ll ed = j + (N - 1 - i);
            if (dp[i][j] != -1) {
                dp[i + 1][j] = max(dp[i + 1][j], dp[i][j] + abs(A[i].second, ed) * A[i].first);
                dp[i + 1][j + 1] = max(dp[i + 1][j + 1], dp[i][j] + abs(A[i].second, j) * A[i].first);
            }
        }
    }
    ll ans = 0;
    REP(i, 0, N) {
        ans = max(ans, dp[N][i]);
    }
    cout << ans << endl;
}


Measured memory_bytes: 35252
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for(i = 0; i < n; i++)
//2D::rep(i,j)rep(j,j)cin>>bin[i][j];
//vector<int> a(n)
#define A1 cout<<"No"<<endl
#define A2 cout<<"Yes"<<endl
#define A3 cout<<ans<<endl
#define AA(i) cout<<i<<endl
const int U=2e5+5;
const ll MOD=998244353;
const int INF = 1001001001;
#define size 200001

ll POW(ll n,ll m){
  long long pow = 1;
  while (m>0) {
    if ((m&1) == 1) pow = (pow*n)%MOD;
    m >>= 1;
    n = (n*n)%MOD;
  }
    return pow;
}

long long fac[size],finv[size],inv[size];
void COMvec() {
  fac[0] = fac[1] = 1;
  finv[0] = finv[1] = 1;
  inv[1] = 1;
  for(int i = 2; i < size; 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;
  }
}
ll COM(ll n,ll k){
  if (n < k) return 0;
  if (n < 0 || k < 0) return 0;
  return fac[n] * (finv[k] * finv[n-k] % MOD) % MOD;
}

int main() {
  ll N,M,K; cin>>N>>M>>K;
  COMvec();
  int i=1;
  ll ans = 0;
  rep(i,K+1) ans = (ans + M * POW(M-1 , N-1-i) % MOD * COM(N-1,i) % MOD) % MOD;
  AA(ans);
  return 0;
}

Measured memory_bytes: 8280
package main

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

func main() {
	D := ReadInt()
	cs := ReadInts(26)
	ss := make([][]int, D)
	for i := 0; i < D; i++ {
		ss[i] = ReadInts(26)
	}
	ts := ReadInts(D)

	score := 0
	last := make([]int, 26)
	for d := 1; d <= D; d++ {
		t := ts[d-1] - 1
		score += ss[d-1][t]
		last[t] = d
		for i := 0; i < 26; i++ {
			score -= cs[i] * (d - last[i])
		}
		fmt.Println(score)
	}
}

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 ReadInts(n int) []int {
	v := make([]int, n)
	for i := 0; i < n; i++ {
		Scan(&v[i])
	}
	return v
}


Measured memory_bytes: 1992
module Main where

import qualified Data.ByteString.Char8 as BS
import Data.List
import Data.Char

main :: IO ()
main = do
  [n] <- unfoldr (BS.readInt . BS.dropWhile isSpace) <$> BS.getLine
  putStrLn $ if elem n list then "Yes" else "No"
  where
    list = (*) <$> [1..9] <*> [1..9]


Measured memory_bytes: 380
#include <iostream>
using namespace std;

int main()
{
	int a, b;
	char op;
	while (1) {
		cin >> a >> op >> b;
		switch (op) {
		case '+':
			cout << a + b << '\n';
			break;
		case '-':
			cout << a - b << '\n';
			break;
		case '*':
			cout << a*b << '\n';
			break;
		case '/':
			cout << a / b << '\n';
			break;
		case'?':
			return 0;
		}
	}
	return 0;
}

Measured memory_bytes: 3072
#include <bits/stdc++.h>

#include <boost/range/adaptors.hpp>
#include <boost/range/irange.hpp>

using namespace std;
using namespace boost;
using namespace boost::adaptors;

int main() {
    int64_t d, g;
    cin >> d >> g;
    g /= 100;

    vector<array<int64_t, 2>> pc(d);
    for (auto&& t : pc) {
        cin >> t[0] >> t[1];
        t[1] /= 100;
    }

    int64_t ans = numeric_limits<int64_t>::max();
    for (auto s : irange(0uL, 1uL << d)) {
        bitset<10> bs(s);

        int64_t points = 0;
        int64_t k = 0;
        for (auto i : irange(0L, d)) {
            if (bs[i]) {
                points += pc[i][0] * (i + 1) + pc[i][1];
                k += pc[i][0];
            }
        }

        for (auto i : irange(0L, d) | reversed) {
            if (!bs[i]) {
                auto m = min(pc[i][0] - 1, max(0L, (g - points) / (i + 1)));
                points += m * (i + 1);
                k += m;
            }
        }

        if (points >= g) {
            ans = min(ans, k);
        }
    }

    cout << ans << endl;
}

Measured memory_bytes: 256
#!/usr/bin/env python
# -*- coding:utf-8 -*-

H, W = map(int, input().split())
blue = [[0] * W for _ in range(H)]
red = [[0] * W for _ in range(H)]

for x in range(W):
    blue[0][x] = 1
    red[-1][x] = 1

for y in range(H-1):
    for x in range(0, W, 2):
        blue[y][x] = 1
        if x + 1 < W:
            red[y+1][x+1] = 1

# for y in range(H):
#     print(blue[y])
# print()
# for y in range(H):
#     print(red[y])

m = [input() for _ in range(H)]

for color in [red, blue]:
    for y in range(H):
        for x in range(W):
            if m[y][x] == '#':
                print('#', end='')
            elif color[y][x] == 1:
                print('#', end='')
            else:
                print(".", end='')
        print()
    print()


Measured memory_bytes: 9204
#include <iostream>
#include <cstdio>
#include <string>

using namespace std;

int main() {
	char c;
	while (1) {
		scanf("%c", &c);

		if (c >= 'a' && 'z' >= c) {
			c -= 'a' - 'A';
			cout << c;
		}
		else if (c >= 'A' && 'Z' >= c) {
			c += 'a' - 'A';
			cout << c;
		}
		else if (c == '\n') {
			break;
		}
		else {
			cout << c;
		}
	}
	cout << endl;

	return 0;
}

Measured memory_bytes: 1144
#include <bits/stdc++.h>
using namespace std;

int main() {
    int k = 0, a = 0, b = 0;
    cin >> k >> a >> b;

    for (int i = a; i <= b; i++) {
        if (i % k == 0) {
            cout << "OK" << endl;
            return 0;
        }
    }
    cout << "NG" << endl;
}

Measured memory_bytes: 3636
/* ex4_2
   Acro  */

#include <stdio.h> 
#include <math.h>
#include <stdlib.h>
int main(void){
    int length_h,length_m,hour,minute;
    double ans,theta;
    scanf("%d %d %d %d",&length_h,&length_m,&hour,&minute);
    /* 角度を求める */
    theta = 2*M_PI * ((minute/(double)60) - (hour/(double)12 + minute/(double)(12*60)));
    /* 余弦定理 */
    ans = sqrt(length_h*length_h + length_m*length_m - 2*length_h*length_m*cos(theta));
    printf("%20.20lf\n",ans);
    return 0;
}

Measured memory_bytes: 2564
#include <bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
     
#define fast { ios :: sync_with_stdio(false); cin.tie(0); cout.tie(0); }
#define pb push_back
#define ll long long
#define ld long double
     
#define vi vector<int>
#define vl vector<long>
#define vll vector<long long>
     
#define infi INT_MAX
#define infl LONG_LONG_MAX
#define infd LDBL_MAX
#define f(i,a,b) for(ll i=a;i<b;i++)
#define fi(i,a,b) for(ll i=(b-1);i>=a;i--)
#define F first
#define S second
#define G(a,b) get<a>(b)
#define MP make_pair
#define MT make_tuple
#define pll pair<ll,ll> 
#define endl "\n"
#define ALL(v) v.begin(),v.end()
#define nl cout<<"\n";
#define pr(x) cout<<x;
#define pr1(x) cout<<x<<" ";
#define pr2(x,y) cout<<x<<" "<<y;
#define deb printf("***************************************************************************************\n");
#define moshi printf("moshi moshi ! \n");
#define hi printf("hi ! \n");
#define bye printf("bye bye ! \n");
#define o_set(ll) tree<ll, null_type,less<ll>, rb_tree_tag,tree_order_statistics_node_update>
#define number_of_set_bits  __builtin_popcountll  
const ld PI=3.1415926535897932384626433; 



void func()
{ 
  ll x,y;
  cin>>x>>y;
  f(i,0,x+1)
  {
    ll cranes=i,turtles=x-i;
    if(2*cranes+4*turtles==y)
    {
      cout<<"Yes\n";
      return;
    }
  }

  cout<<"No\n";
}   

     
     
int main() 
{
    fast

    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif // ONLINE_JUDGE
        
     
    ll ntc=1;
    //cin>>ntc;
     
    f(i,1,ntc+1)
    {
      //cout<<"Case #"<<i<<": ";
      func();
    }     
    return 0;
}

Measured memory_bytes: 3608
#include<bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef pair<LL,LL> P;
const LL mod=1e9+7;
const LL LINF=1LL<<62;
const int INF=1<<17;


const int M_N=200; //最大頂点数

int V;
vector<int> G[M_N];
int match[M_N];
bool used[M_N];

void add_edge(int u,int v){
    G[u].push_back(v);
    G[v].push_back(u);
}

bool dfs(int v){
    used[v]=true;
    for(int i=0;i<G[v].size();i++){
        int u=G[v][i],w=match[u];
        if(w<0||!used[w]&&dfs(w)){
            match[v]=u;
            match[u]=v;
            return true;
        }
    }
    return false;
}


int bipartie_matching(){
    int res=0;
    memset(match,-1,sizeof(match));
    for(int v=0;v<V;v++){
        if(match[v]<0){
            memset(used,false,sizeof(used));
            if(dfs(v)){
                res++;
            }
        }
    }
    return res;
}

int main(){
    int x,y,e;
    cin >> x >> y >> e;
    V=x+y;
    for(int i=0;i<e;i++){
        int u,v;
        cin >> u >> v;
        add_edge(u,x+v);
    }
    cout << bipartie_matching() << endl;
    return 0;
}


Measured memory_bytes: 3244
#include <bits/stdc++.h>
using namespace std;

int main(){

int H,N;
cin >> H >> N;
vector<int> atack(N);
for(int i=0; i<N; i++) cin >> atack.at(i);

int sum=0;

for(int i=0; i<N; i++){
    sum += atack.at(i);
}

if(H-sum <= 0) cout << "Yes" << endl;
else cout << "No" << endl; 

}

Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;

#define ll   long long int
#define rep(i,n)    for(int i=0;i<(int)n;i++)

int main() {

    int A,B;

    cin >> A >> B;
    int ans;
    ans = max((A+B),max((A-B),(A*B)));
    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 256
//#include "bits/stdc++.h"
#include <iostream>
#include <vector>
#include <map>
#include <utility>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <stack>
#include <queue>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <numeric>
#include <complex>
#include <bitset>
#include <functional>
#include <stack>
#include <regex>
#include <tuple>
#include <iomanip>


#define int long long
#define REP(i,l,r) REPEAT(i,l,r,true) // [l, r)
#define rep(i,n) REP(i,0,n)           // [0, n)
#define REPEAT(i,l,r,condition) for(int i=(condition)?l:r-1;(condition)?i<r:i>=l;(condition)?++i:--i) // false<-[l, r)->true
#define all(e) e.begin(),e.end()
#define rall(e) e.rbegin(),e.rend()
#define pb push_back
#define fs first
#define sc second
#ifdef LOCAL
#define show(...) cerr<<#__VA_ARGS__<<" = ";_DEBUG(__VA_ARGS__)
#define showlr(n,l,r) cerr<<#n<<" = ";for(int i=l;i<r;i++){cerr<<n[i]<<", ";}cerr<<endl // [l, r)
#else
#define show(...)
#define showlr(n,l,r)
#endif

#define YN(condition) puts((condition)?"YES":"NO")
#define Yn(condition) puts((condition)?"Yes":"No")
#define yn(condition) puts((condition)?"yes":"no")
#define YES puts("YES")
#define Yes puts("Yes")
#define yes puts("yes")
#define NO  puts("NO")
#define No  puts("No")
#define no  puts("no")

#define case(i) printf("Case #%lld: ",i)

using namespace std;

using vi=vector<int>;
using pint=pair<int,int>;

struct io{io(){cin.tie(0);ios::sync_with_stdio(false);cout.tie(0);cout<<fixed<<setprecision(20);}}io;

template<class T> istream& operator >>(istream &is, vector<T> &v){for(T &e:v)is>>e;return is;}
template<class T> ostream& operator <<(ostream &os, vector<T> v){os<<"{";for(T &e:v)os<<e<<(v.size()-(int)(&e-&v[0])>1?", ":"");os<<"}";return os;}

void _DEBUG(){}
template<typename H,typename... T> void _DEBUG(H a,T...b){cerr<<a<<(sizeof...(b)?",":"\n");_DEBUG(b...);}

inline void in(){}
template<typename H,typename... T>void in(H &a, T&... b){cin>>a;in(b...);}
inline void out(){}
template<typename H,typename... T> void out(H a, T... b){cout<<a<<(sizeof...(b)?" ":"\n");out(b...);}

template<class T> void resz(int n,T& v){v.resize(n);}
template<class H,class... T> void resz(int n,H& a,T&... b){a.resize(n);resz(n,b...);}

template<typename V,typename H> void resize(vector<V>& v,const H a){v.resize(a);}
template<typename V,typename H,typename... T> void resize(vector<V>& v,const H& a,const T... b){v.resize(a);for(auto &v:v) resize(v,b...);}

const int INF=1LL<<55;
const int MOD=1000000007;
const double EPS=1e-8;
/*------------end of definitions------------*/

string S;

signed main(){

    in(S);
    Yn(S.find("YAKI")==0);

    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;

unsigned long long n, k;
unsigned long long x[100005];

int main()
{
	cin >> n >> k;
	if (n % k == 0)
	{
		cout << 0 << endl;
		exit(0);
	}
	unsigned long long a = n % k;
	unsigned long long b = k - n % k;
	cout << min(a, b) << endl;
	return 0;
}


Measured memory_bytes: 256
N, L = map(int, input().split())

if L >= 0:
    last_apple = (L + N - 1)
    apple_total = (L + last_apple) * N // 2
    print(apple_total - L)
else:
    last_apple = (L + N - 1)
    apple_total = (L + last_apple) * N // 2
    if last_apple >= 0:
        print(apple_total)
    else:
        print(apple_total - last_apple)


Measured memory_bytes: 38384
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import sys  # {{{
import os
import time
import re
from pydoc import help
import string
import math
from operator import itemgetter
from collections import Counter
from collections import deque
from collections import defaultdict as dd
import fractions
from heapq import heappop, heappush, heapify
import array
from bisect import bisect_left, bisect_right, insort_left, insort_right
from copy import deepcopy as dcopy
import itertools
# }}}

# pre-defined{{{
sys.setrecursionlimit(10**7)
INF = 10**20
GOSA = 1.0 / 10**10
MOD = 10**9+7
ALPHABETS = [chr(i) for i in range(ord('a'), ord('z')+1)]  # can also use string module
def LI(): return [int(x) for x in sys.stdin.readline().split()]
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 DP(N, M, first): return [[first] * M for n in range(N)]
def DP3(N, M, L, first): return [[[first] * L for n in range(M)] for _ in range(N)]
from inspect import currentframe
def dump(*args):
    names = {id(v):k for k,v in currentframe().f_back.f_locals.items()}
    print(', '.join(names.get(id(arg),'???')+' => '+repr(arg) for arg in args), file=sys.stderr)
# }}}

def local_input():# {{{
    from pcm.utils import set_stdin
    import sys
    if len(sys.argv) == 1:
        set_stdin(os.path.dirname(__file__) + '/test/' + 'sample-1.in')# }}}

def solve():
    N = int(input())
    for n in range(N, 1112):
        s = set()
        for c in str(n):
            s.add(c)
        if len(s)==1:
            print(n)
            return 0
    return 0

if __name__ == "__main__":# {{{
    try:
        local_input()
    except:
        pass
    solve()
# vim: set foldmethod=marker:}}}


Measured memory_bytes: 104684
import Control.Applicative
import Control.Monad
import Text.Printf

var :: Double -> Double -> Double
var s m = (s - m) * (s - m)

solver :: [Double] -> Int -> Double
solver scores n = sqrt $ sum (map (var mean) scores) / fromIntegral n
  where mean = sum scores / fromIntegral n

main :: IO()
main = do
  n <- (read :: String -> Int) <$> getLine
  unless (n == 0) $ do
    scores <- map (read :: String -> Double) . words <$> getLine
    printf "%.8f\n" (solver scores n)
    main

Measured memory_bytes: 4920
#include<cstdio>
#include<cstring>
#include<cmath>
#include<vector>
#include<queue>
#define SF scanf
#define PF printf
#define MAXN 100010
#define INF 0x3FFFFFFF
using namespace std;
typedef long long ll;
ll dp[MAXN],pos[MAXN],m,t,pre=INF;
priority_queue<pair<ll,int> > q;
int n;
int main(){
	SF("%d%lld%lld",&n,&m,&t);
	for(int i=1;i<=n;i++)
		SF("%lld",&pos[i]);
	q.push(make_pair(0,0));
	int las=0;
	for(int i=1;i<=n;i++){
		dp[i]=dp[i-1]+t+pos[i]-pos[i-1];
		while(1){
			pair<ll,int> x=q.top();
			if(2ll*(pos[i]-pos[x.second+1])<=t){
				dp[i]=min(dp[i],-x.first+pos[i]+t);
				break;
			}
			q.pop();
		}
		while(2ll*(pos[i]-pos[las+1])>t){
			pre=min(pre,dp[las]-pos[las]-2ll*pos[las+1]);
			las++;
		}
		if(pre!=INF)
			dp[i]=min(dp[i],pre+3ll*pos[i]);
		q.push(make_pair(-dp[i]+pos[i],i));
	}
	PF("%lld",dp[n]+m-pos[n]);
}

Measured memory_bytes: 3700
#include <memory.h>

#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <utility>
#include <vector>

using namespace std;

#define MOD 1000000007
#define INIT -1

int main() {
	string s;
	int k;
	cin >> s >> k;
	int l = s.length();
	for (int i = 0; i < l - 1; i++) {
		int tmp = ('a' - s[i] + 26) % 26;
		if (tmp <= k) {
			k -= tmp;
			s[i] = 'a';
		}
	}
	s[l - 1] = 'a' + ((s[l - 1] - 'a' + k) % 26);
	cout << s << endl;
}

Measured memory_bytes: 512
#include <bits/stdc++.h>
#include <type_traits>
using namespace std;

using ll = long long;

#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rrep(i, n) for (int i = 1; i <= (n); ++i)
#define drep(i, n) for (int i = (n)-1; i >= 0; --i)
#define ddrep(i, n) for (int i = n; i > 0; --i)
#define srep(i, s, t) for (int i = s; i < t; ++i)
#define ssrep(i, s, t) for (int i = s; i <= t; ++i)

#define rng(a) a.begin(), a.end()
#define rrng(a) a.rbegin(), a.rend()
#define pb push_back
#define eb emplace_back
#define fi first
#define se second

#define chmax(x, y) (x = max(x, y))
#define chmin(x, y) (x = min(x, y))

using pi = pair<int, int>;
using vi = vector<int>;
using vvi = vector<vi>;
using vl = vector<ll>;
using vvl = vector<vl>;
using vs = vector<string>;
using vvs = vector<vs>;
using ld = long double;

template <class T, class U>
ostream &operator<<(ostream &os, const pair<T, U> &p) {
    os << "(" << p.first << "," << p.second << ")";
    return os;
}

template <class T> ostream &operator<<(ostream &os, const vector<T> &v) {
    os << "{";
    rep(i, (int)v.size()) {
        if (i)
            os << ",";
        os << v[i];
    }
    os << "}";
    return os;
}

template <typename T, size_t S> void printArray(const T (&array)[S]) {
    for (auto val : array)
        std::cout << val << ", ";
    std::cout << "\n";
}

const int mod = 1e9 + 7;
const int inf = 1e9 + 5;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << std::setprecision(10);

    int n, k; std::cin >> n >> k;
    int r, s, p; std::cin >> r >> s >> p;
    map<char, int> m = {{'r', p}, {'s', r}, {'p', s}};
    string t; std::cin >> t;
    int ans = 0;
    vector<bool> any(n, false);
    rep(i, n) {
        ans += m[t[i]];
        if (i < k) continue;
        if (!any[i-k] && t[i-k] == t[i]) {
            any[i] = true;
            ans -= m[t[i]];
        }
    }
    std::cout << ans << "\n";
}


Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;

#define INF_LL (int64)1e18
#define INF (int32)1e9
#define REP(i, n) for(int64 i = 0;i < (n);i++)
#define FOR(i, a, b) for(int64 i = (a);i < (b);i++)
#define all(x) x.begin(),x.end()
#define fs first
#define sc second

using int32 = int_fast32_t;
using uint32 = uint_fast32_t;
using int64 = int_fast64_t;
using uint64 = uint_fast64_t;
using PII = pair<int32, int32>;
using PLL = pair<int64, int64>;

const double eps = 1e-10;

template<typename A, typename B>inline void chmin(A &a, B b){if(a > b) a = b;}
template<typename A, typename B>inline void chmax(A &a, B b){if(a < b) a = b;}

template<typename T>
vector<T> make_v(size_t a){return vector<T>(a);}

template<typename T,typename... Ts>
auto make_v(size_t a,Ts... ts){
  return vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...));
}

template<typename T,typename V>
typename enable_if<is_class<T>::value==0>::type
fill_v(T &t,const V &v){t=v;}

template<typename T,typename V>
typename enable_if<is_class<T>::value!=0>::type
fill_v(T &t,const V &v){
  for(auto &e:t) fill_v(e,v);
}

int64 rm_dig(int64 a, int64 dig) {
	int64 res = (a & ((1 << dig)-1)) | ((a >> (dig+1)) << dig);
	return res;
}

int64 insert_dig(int64 a, int64 dig, bool x) {
	int64 res = (a >> dig) << (dig+1);
	res |= (a & ((1 << dig)-1));
	res |= (x << dig);
	return res;
}

vector<int64> dfs(int64 A, int64 B, int64 bit){
	if (bit == 1) {
		vector<int64> ret = {A, B};
		return ret;
	}
	vector<int64> l, r;
	int64 d;
	REP(i, bit) {
		if ((A >> i & 1) != (B >> i & 1)) {
			d = i;
			break;
		}
	}
	int64 A_ = rm_dig(A, d), B_ = rm_dig(B, d);
	int64 C = (__builtin_popcount(A_)%2 ? 0 : 1);
	l = dfs(A_, C, bit-1), r = dfs(C, B_, bit-1);
	REP(i, l.size()) {
		l[i] = insert_dig(l[i], d, A >> d & 1);
	}
	REP(i, r.size()) {
		r[i] = insert_dig(r[i], d, B >> d & 1);
	}
	vector<int64> res;
	REP(i, l.size()) res.push_back(l[i]);
	REP(i, r.size()) res.push_back(r[i]);
	return res;
}

int main(void){
	cin.tie(0);
	ios::sync_with_stdio(false);
	int64 N, A, B;
	cin >> N >> A >> B;
	if (__builtin_popcount(A^B)%2 == 0) {
		cout << "NO" << endl;
	} else {
		cout << "YES" << endl;
		auto res = dfs(A, B, N);
		REP(i, res.size()) {
			cout << res[i] << " ";
		}
		cout << endl;
	}
}


Measured memory_bytes: 2520
#include <stdio.h>
#define N 36
typedef struct{
  char mark,num;
}card;
int main()
{
  int n,i,j,l,k=1,mini;
  card A1[N],A2[N],a;
  scanf("%d",&n);
  for(i=0;i<n;i++)
  {
    scanf(" %c%c",&A1[i].mark,&A1[i].num);
  }
  for(i=0;i<n;i++)
  {
    A2[i]=A1[i];
  }

  for(i=0;i<=n-1;i++)
  {
    mini = i;
    for(j=i;j<=n-1;j++)
    {
      if(A2[j].num < A2[mini].num)
        {
          mini = j;
        }
    }
      a = A2[i];
      A2[i] = A2[mini];
      A2[mini] = a;
  }
  for(i=0;i<n;i++)
  {
    for(j=n-1;j>=i;j--)
    {
      if(A1[j].num < A1[j-1].num)
      {
        a=A1[j];
        A1[j]=A1[j-1];
        A1[j-1]=a;
      }
    }
  }
  for(l=0;l<n;l++)
  {
    if(l)
      printf(" ");
    printf("%c%c",A1[l].mark,A1[l].num);
  }
  printf("\nStable\n");
  for(i=0;i<n;i++)
  {
    printf("%c%c",A2[i].mark,A2[i].num);
    if(i!=n-1)
      printf(" ");
  }
  for(i=0;i<n;i++)
  {
    if(A1[i].mark!=A2[i].mark)
      k=0;
  }
  if(k!=0)
    printf("\nStable\n");
  else
    printf("\nNot stable\n");
  return 0;
}



Measured memory_bytes: 2108
#define PI 3.14159265359
#define INF 2000000000
#define MAX 500000
#include <map>
#include <algorithm>
#include <vector>
#include <queue>
#include <iostream>
#include <string>
#include <cstring>
#include <cmath>
#include <cstdio>
using namespace std;

int cnt = 0;
int L[MAX/2+2], R[MAX/2+2];
	
void merge(int A[],int n,int left,int mid,int right) {
	int n1 = mid - left;
	int n2 = right - mid;
	//?????????2??????????????????????????¨??????????????§????????±??????
	for (int i = 0;i < n1;i++) L[i] = A[left + i];
	for (int i = 0;i < n2;i++)R[i] = A[mid + i];
	L[n1] = R[n2] = INF;
	int i =0, j = 0;
	for (int k = left;k < right;k++) {
		cnt++;
		if (L[i] <= R[j]) {
			A[k] = L[i++];
		}
		else {
			A[k] = R[j++];
		}
	}
}

void mergeSort(int A[],int n,int left, int right) {
	if (left + 1 < right) {
		int mid = (left + right) / 2;
		mergeSort(A,n, left, mid);
		mergeSort(A,n, mid, right);
		merge(A,n, left, mid, right);
	}
}

int main() {
	int n, A[MAX + 1],i;
	cin >> n;
	for (i = 0;i < n;i++) cin >> A[i];
	
	mergeSort(A,n,0,n);

	for (i = 0;i < n;i++) {
		if (i) cout << " ";
		cout << A[i];
	}

	cout <<endl<< cnt<<endl;

    return 0;
}

Measured memory_bytes: 6836
#include <bits/stdc++.h>
using namespace std;

int main() {
  int N,M,S;
  cin >> N >> M;
  M=M*2;
  vector<int> vec(M);  
  for (int i=0; i<M; i++)
    cin >> vec.at(i);
    
  for(int i=0; i<N; i++){
    S=0;
    for(int n=0; n<M; n++){
      if (vec.at(n) == i+1)
        S=S+1;
    }
    cout << S << endl;     
 }
}


Measured memory_bytes: 256
#include "iostream"
#include "climits"
#include "list"
#include "queue"
#include "stack"
#include "set"
#include "functional"
#include "algorithm"
#include "string"
#include "map"
#include "unordered_map"
#include "unordered_set"
#include "iomanip"
#include "cmath"
#include "random"
#include "bitset"
#include "cstdio"
#include "numeric"

using namespace std;

const long long int MOD = 1000000007;

long long int N, M, K, H, W, L, R;

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);

	cin >> N >> K;
	vector<int>v(N);
	for (auto &i : v)cin >> i;
	vector<int>dp(N,MOD);
	dp[0] = 0;
	for (int i = 1; i < N; i++) {
		for (int j = 1; j <= min(i, (int)K); j++) {
			dp[i] = min(dp[i - j] + abs(v[i] - v[i - j]), dp[i]);
		}
	}
	cout << dp.back() << endl;
	return 0;
} 

Measured memory_bytes: 1024
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
#define rep(i,n) for(ll i=0;i<n;++i)
#define ocut cout
#define ouct cout
#define itn int

struct Union{
  vector<ll> par;
  Union(ll a){
  par=vector<ll>(a,-1);
  }
  ll find(ll a){
    if(par[a]<0){
      return a;
    }
    else{
      return par[a]=find(par[a]);
    }
  }
  bool same(ll a,ll b){
    return (find(a)==find(b));
  }
  ll size(ll a){
    return -par[find(a)];
  }
  void unite(ll a,ll b){
    ll c=find(a),d=find(b);
    if(c==d)
      return;
    if(size(c)<size(d)){
      swap(c,d);
    }
    par[c]+=par[d];
    par[d]=c;
  }
};

int main(){
  char s[4];
  cin >> s;
  if(s[0]=='7'||s[1]=='7'||s[2]=='7')cout << "Yes";
  else cout << "No";
}


Measured memory_bytes: 3676
#include <bits/stdc++.h>

#define M_PI       3.14159265358979323846   // pi

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<ll> VI;
typedef pair<ll, ll> P;
typedef tuple<ll, ll, ll> t3;
typedef tuple<ll, ll, ll, ll> t4;

#define rep(a,n) for(ll a = 0;a < n;a++)
#define repi(a,b,n) for(ll a = b;a < n;a++)

static const ll INF = 1e15;



int main(void)
{
	ll a, b, m;
	cin >> a >> b >> m;
	vector<ll> as(a);
	rep(i, a) {
		cin >> as[i];
	}
	vector<ll> bs(b);
	rep(i, b) {
		cin >> bs[i];
	}
	ll r = INF;
	rep(i, m) {
		ll x, y, c;
		cin >> x >> y >> c;
		x--; y--;
		ll rr = as[x] + bs[y] - c;
		r = min(r, rr);
	}
	sort(as.begin(), as.end());
	sort(bs.begin(), bs.end());
	r = min(r, as[0] + bs[0]);
	cout << r << endl;
	return 0;
}

Measured memory_bytes: 1792
double x,y,r,X,Y,R;main(n){for(scanf("%d",&n);n--;printf("%d\n",x+R<r?2:x+r<R?-2:x<=r+R))scanf("%lf%lf%lf%lf%lf%lf",&x,&y,&r,&X,&Y,&R),x=hypot(X-x,Y-y);exit(0);}

Measured memory_bytes: 652
#include <bits/stdc++.h>
using namespace std;
#define i64 long long
#define input freopen("input.txt", "r", stdin)
#define output freopen("output.txt", "w", stdout)
#define fast_io ios_base::sync_with_stdio(0);cin.tie(0);
#define pi 2.0*acos(0.0)
#define mod 1000000007
#define mp make_pair
#define pii pair<int,int>
#define pss pair<string,string>
#define fi first
#define se second
#define pb push_back
#define sortVA(v) sort(v.begin(),v.end())
#define sortVD(v) sort(v.begin(),v.end(),greater<int>())
#define ASC(a,n) sort(a,a+n);
#define DESC(a,n) sort(a,a+n,greater<int>());
#define out(x) cout <<x<<endl
#define outt(x,y) cout <<x<<" "<<y<<endl
#define mem(array,value) memset(array,value,sizeof(array))

int main()
{
    fast_io
    int n;
    cin >>n;
    int s=n/3;
    out(s);
    return 0;
}







Measured memory_bytes: 384
N = int(input())

def dev(n):
    if n == 0:
        return ""
    if n%2 == 0:
        return dev(n//(-2))+"0"
    else:
        return dev((n-1)//(-2))+"1"

res = dev(N)
if N == 0:
    res = "0"
print(res)

Measured memory_bytes: 38256
#include <bits/stdc++.h>
using namespace std;

int main() {
    int n;
    cin >> n;
    vector<int> a(n), b(n);
    for (int i = 0; i < n; i++) cin >> a[i];
    for (int i = 0; i < n; i++) cin >> b[i];

    int ans = 0;
    for (int i = 0; i < n; i++) {
        int sum = 0;
        for (int j = 0; j <= i; j++) sum += a[j];
        for (int j = i; j < n; j++) sum += b[j];
        ans = max(ans, sum);
    }
    cout << ans << endl;
}

Measured memory_bytes: 3568
#include <bits/stdc++.h>
#define int long long int
#define ll long long int
#define ld long double
#define getFaster ios_base::sync_with_stdio(false), cin.tie(nullptr)
#define rep(i, init, n) for (int i = init; i < (int)n; i++)
#define rev(i, n, init) for (int i = (int)n; i >= init; i--)
#define MOD1 1e9 + 7
#define MOD2 998244353
#define f first
#define s second
#define endl '\n'
#define pii pair<int, int>
#define piii pair<pii, int>
#define precise(i) cout << fixed << setprecision(i)
#define codejam cout << "Case #" << ii + 1 << ": ";
#define impossible cout << "IMPOSSIBLE" << endl;
#define error(s) throw runtime_error(s)
std::mt19937_64 rng(std::chrono::steady_clock::now().time_since_epoch().count());
int myRand(int R){int val=rng()%R;assert(val >= 0);return val;}

const long double PI = atan(1.0) * 4;
const int64_t INF64 = 3e18;
const int32_t INF32 = 2e9 + 7;
const int32_t LOG = 21;
const int32_t MOD = MOD1;

using namespace std;


//-------------------DEBUGGING-------------------------
void my_debugger(string s,int LINE_NUM){cerr<<endl;}
template<typename start,typename... end>
void my_debugger(string s,int LINE_NUM,start x,end... y) 
{
    if(s.back()!=',') {s+=',';cerr<<"LINE("<<LINE_NUM<<"): ";}
    int i=s.find(',');
    cerr<<s.substr(0,i)<<" = "<<x;
    s=s.substr(i+1);
    if(!s.empty()) cerr<<", ";
    my_debugger(s,LINE_NUM,y...);
}

#ifdef AJIT
#define debug(...) my_debugger(#__VA_ARGS__,__LINE__,__VA_ARGS__);
#else
#define debug(...) ;
#endif

//-----------------------------------------------------


int32_t main()
{
      getFaster;
      //files_init();
      int tests = 1;
      //cin >> tests;
      rep(ii, 0, tests)
      {
            int n;
            cin>>n;
            vector<int> dp(n+1,0);
            dp[0]=1;
            int MOD=1e9+7;
            rep(i,3,n+1)
            {
                  dp[i]=1;
                  rep(j,1,i)
                  {
                        if(j<3 || i-j<3)continue;
                        dp[i]+=dp[i-j];
                        while(dp[i]>=MOD)dp[i]-=MOD;
                  }
            }
            cout<<dp[n]<<endl;
      }
      return 0;
}


Measured memory_bytes: 3652
import math
MOD = 10 ** 9 + 7


def main():
    n, m = map(int, input().split())
    total =math.factorial(n+m)
    if abs(n-m) >= 2:
        return 0
    if abs(n-m) == 1:
        return math.factorial(n) * math.factorial(m) % MOD
    return math.factorial(n) * math.factorial(m) * 2 % MOD
print(main())

Measured memory_bytes: 5776
#include <algorithm>
#include <cmath>
#include <climits>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <fstream>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <cassert>
#include <functional>

using namespace std;

#define LOG(...) printf(__VA_ARGS__)
//#define LOG(...)
#define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define REP(i,n) for(int i=0;i<(int)(n);++i)
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define RSORT(c) sort((c).rbegin(),(c).rend())
#define CLR(a) memset((a), 0 ,sizeof(a))

typedef long long ll;
typedef unsigned long long ull;
typedef vector<bool> vb;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vb> vvb;
typedef vector<vi> vvi;
typedef vector<vll> vvll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

const int dx[] = {-1, 0, 1, -2, -2, -2, 2, 2, 2, -1, 0, 1};
const int dy[] = {-2, -2, -2, -1, 0, 1, -1, 0, 1, 2, 2, 2};

bool G[100][10];

int main() {
	int pyonX, pyonY, n;
	while(cin >> pyonX >> pyonY, pyonX|pyonY){
		fill_n((bool *)G, 100*10, false);
		cin >> n;
		vi water;
		REP(i, n){
			int x, y;
			cin >> x >> y;
			water.push_back(y * 10 + x);
		}

		queue<int> que;
		que.push(pyonY * 10 + pyonX);
		que.push(0);
		int step = 0;
		while(1){
			int p = que.front(); que.pop();
			if(p == 0){
				step++;
				if(step == n){
					if(que.empty()){
						cout << "NA" << endl;
						break;
					}
					cout << "OK" << endl;
					break;
				}
				if(que.empty()){
					cout << "NA" << endl;
					break;
				}

				que.push(p);
				continue;
			}
			int y = p/10;
			int x = p%10;

			REP(i, 12){
				int sx = x + dx[i];
				int sy = y + dy[i];
				if(sx < 0 || sx >= 10 || sy < 0 || sy >> 10)
					continue;

				int waterY = water[step]/10;
				int waterX = water[step]%10;
				if(abs(waterX - sx) <= 1 && abs(waterY - sy) <= 1){
					if (G[sy*10+sx][step] != true){
						G[sy*10+sx][step] = true;
						que.push(sy*10+sx);
					}
				}
			}
		}
	}
}

Measured memory_bytes: 1208
#include <bits/stdc++.h>

using namespace std;
int n, a[25005], sz;

inline int gcd(const int &a, const int &b) {
	if (!b) return a;
	return gcd(b, a%b);
}

int main() {
	for (int i = 1; i <= 30000; i++) {
		if (i % 2 == 0 || i % 3 == 0) a[sz++] = i;
	}
	scanf("%d", &n);
	srand(time(NULL));
	while (true) {
		random_shuffle(a, a+sz);
		int sum = 0;
		int x = a[0];
		for (int i = 0; i < n; i++) {
			sum += a[i];
			x = gcd(x, a[i]);
		}
		if (x != 1) continue;
		bool flag = true;
		for (int i = 0; i < n; i++) {
			x = gcd(a[i], sum-a[i]);
			if (x == 1) {
				flag = false;
				break;
			}
		}
		if (flag) {
			for (int i = 0; i < n; i++) {
				printf("%d%c", a[i], " \n"[i+1 == n]);
			}
			return 0;
		}
	}
	return 0;
}

Measured memory_bytes: 384
import java.io.*;
import java.util.*;

class Main {
    static Scanner scanner = new Scanner();

    public static void main(String[]$) throws IOException {
        int h = scanner.nextInt();
        int w = scanner.nextInt();
        int n = scanner.nextInt();
        int sr = scanner.nextInt();
        int sc = scanner.nextInt();
        String s = scanner.next();
        String t = scanner.next();

        int l = sc;
        int r = w - sc + 1;
        int u = sr;
        int d = h - sr + 1;

        for (int i = 0; i < n; i++) {
            if (s.charAt(i) == 'L') {
                l--;
            } else if (s.charAt(i) == 'R') {
                r--;
            } else if (s.charAt(i) == 'U') {
                u--;
            } else if (s.charAt(i) == 'D') {
                d--;
            }
            if (l * r * u * d == 0) {
                System.out.println("NO");
                return;
            }
            if (t.charAt(i) == 'L' && r < w) {
                r++;
            } else if (t.charAt(i) == 'R' && l < w) {
                l++;
            } else if (t.charAt(i) == 'U' && d < h) {
                d++;
            } else if (t.charAt(i) == 'D' && u < h) {
                u++;
            }
        }
        System.out.println("YES");
    }

    static class Scanner {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in), 1 << 15);
        StringTokenizer tokenizer;

        String next() throws IOException {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                tokenizer = new StringTokenizer(reader.readLine());
            }
            return tokenizer.nextToken();
        }

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

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

Measured memory_bytes: 26932
#include <bits/stdc++.h>
using namespace std;
template<class T> ostream& operator<<(ostream &os, vector<T> V) { os << "[ "; 
  for(auto v:V)os << v << " "; return os << "]";
}
template<class T> ostream& operator<<(ostream &os, set<T> S){ os << "{ "; 
  for(auto s:S) os<<s<<" ";  return os<<"}"; 
}
template<class L, class R> ostream& operator<<(ostream &os, pair<L,R> P) {
  return os<<"("<<P.first<<","<< P.second << ")";
}
template<class L, class R> ostream& operator<<(ostream &os, map<L,R> M) {
  os<<"{ ";for(auto m:M)os<<"("<<m.first<<":"<<m.second<<")";
  return os<<"}";
}
#define cerr cout
#define TRACE
#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
  cerr << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
  const char* comma = strchr(names + 1, ',');cerr.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
}
#else
#define trace(...) 1
#endif
// #include <ext/pb_ds/assoc_container.hpp> 
// #include <ext/pb_ds/tree_policy.hpp> 
// using namespace __gnu_pbds;
// #define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
// find_by_order(k)  returns iterator to kth element starting from 0;
// order_of_key(k) returns count of elements strictly smaller than k;
//For multiset use less_equal operator but it does support erase operations for multiset
#define ll long long
#define ld long double
#define vll vector<ll>
#define pll pair<ll,ll>
#define vpll vector<pll>
#define I insert 
#define pb push_back
#define F first
#define S second
#define endl "\n"
#define all(v) (v).begin(),(v).end()
#define For(i,n) for(int i=0;i<(int)n;++i)
#define Rev(i,n) for(int i=(int)n-1;i>=0;--i)
#define Rep(i,n) for(int i=1;i<=(int)n;++i)
typedef vector<int> vi;
typedef pair<int,int> pii;
typedef pair<pii,int> ppi;
typedef vector<pii> vpi;
#define fio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define mp make_pair
// inline void modadd(int &a,int &b){a+=b;if(a>=mod)a-=mod;} 
int main(){
  fio; cout<<fixed<<setprecision(25);	
  int k; cin >> k;
  if(k%7 == 0) k /= 7;
  int rem = 0;
  for(int i = 1;i <= k ; ++i){
    rem = (10*rem + 1)%k;
    if(rem == 0){
      cout << i << endl;
      return 0;
    }
  }
  cout << -1 << endl;
  return 0; 
}


Measured memory_bytes: 3660