akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <fstream>
#include <typeinfo>
#include <vector>
#include <stack>
#include <cmath>
#include <set>
#include <map>
#include <string>
#include <algorithm>
#include <cstdio>
#include <queue>
#include <iomanip>
#include <cctype>
#define syosu(x) fixed<<setprecision(x)
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<double,double> pdd;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<char> vc;
typedef vector<vc> vvc;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef vector<P> vp;
typedef vector<vp> vvp;
typedef pair<int,P> pip;
typedef vector<pip> vip;
const int inf=1<<28;
const ll INF=1ll<<50;
const double pi=acos(-1);
const double eps=1e-10;
const ll mod=1e9+7;
const vi emp;
const int dx[4]={0,1,0,-1},dy[4]={1,0,-1,-0};
const int DX[8]={-1,-1,-1,0,0,1,1,1},DY[8]={1,0,-1,1,-1,1,0,-1};

int w,h,n;
vvi a(4);

int main(){
	cin>>w>>h>>n;
	a[0].push_back(0);
	a[1].push_back(w);
	a[2].push_back(0);
	a[3].push_back(h);
	for(int i=0;i<n;i++){
		int x,y,t;
		cin>>x>>y>>t;
		int rec=(t>0&&t<3)?x:y;
		a[t-1].push_back(rec);
	}
	for(int i=0;i<4;i++) sort(a[i].begin(),a[i].end());
	int H=a[1][0]-a[0].back(),W=a[3][0]-a[2].back();
	if(H<0||W<0) H=0;
	cout<<H*W<<endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <string>
#include <string.h>
#include <math.h>
#include <cmath>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <algorithm>
#include <utility>
#include <deque>
#include <queue>
#include <functional>
//#include <boost/multiprecision/cpp_int.hpp>

#define rep(i, n) for(int i = 0; i < n; ++i)
#define REP(i, m, n) for(int i = m; i < n; ++i)
#define rrep(i,n) for(int i = n; i >= 0; --i)
#define RREP(i, m, n) for(int i = n; i >= m; --i)
#define llrep(i, n) for(ll i = 0; i < n; ++i)
#define llREP(i, m, n) for(ll i = m; i < n; ++i)
#define llrrep(i,n) for(ll i = n; i >= 0; --i)
#define llRREP(i, m, n) for(ll i = n; i >= m; --i)

using ll = long long;
using ull = unsigned long long;
using pii = std::pair<int, int>;
using pll = std::pair<long long, long long>;
using pil = std::pair<int, long long>;
using pli = std::pair<long long, int>;
using plpii = std::pair<long long, std::pair<int, int>>;
using pdd = std::pair<double, double>;
using pis = std::pair<int, std::string>;

const long long INF = 1000000000000000001;
const long long _MOD = 1000000007;
const long long MOD = 998244353;
const int ALPHABET = 27;
const double pi = 3.14159265358979;

using namespace std;
//namespace mp = boost::multiprecision;

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

	int n, k;
	cin >> n >> k;
	int r, s, p;
	cin >> r >> s >> p;
	string t;
	cin >> t;

	int ans = 0;
	rep(i, n) {
		if (i >= k) {
			if (t[i - k] == t[i]) {
				t[i] = '%';
				continue;
			}
		}

		if (t[i] == 'r') ans += p;
		else if (t[i] == 's') ans += r;
		else ans += s;
	}

	cout << ans << "\n";

	return 0;
}


Measured memory_bytes: 3768
#include<bits/stdc++.h>
#define rep(i, l, r) for(int i = (l), i##end = (r);i <= i##end;++i)
using std::cin; using std::cout;
const int maxn = 200200;
typedef long long ll;
const int mod = 998244353;
inline ll pow(ll a,int b,int ans = 1) {
	for(;b;b >>= 1,a = a * a % mod) if(b & 1)
		ans = ans * a % mod;
	return ans;
}
inline ll inverse(int x){ return pow(x, mod - 2); }
struct T {
	int to, nxt;
} way[maxn << 1];
int h[maxn], num;
inline void link(int x,int y) {
	way[++num] = {y,h[x]}, h[x] = num;
	way[++num] = {x,h[y]}, h[y] = num;
}
int n;
inline int dfs(int x,int fa = 0) {
	int ret = 0;
	for(int i = h[x];i;i = way[i].nxt) if(way[i].to != fa)
		ret ^= dfs(way[i].to, x) + 1;
	return ret;
}
int main() {
	std::ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
	cin >> n;
	rep(i, 1, n - 1) { 
		int x, y;
		cin >> x >> y;
		link(x, y);
	}
	cout << (dfs(1) ? "Alice" : "Bob") << '\n';
}


Measured memory_bytes: 4352
#include<bits/stdc++.h>
#define ll long long
using namespace std;
int main()
{
	ll a,b;
	scanf("%lld%lld",&a,&b);
	if (a==b)puts("1");
	else
	{
		int t=60;
		while((a&(1LL<<t))==(b&(1LL<<t)))
			t--;
		//cout<<t<<(1<<t)<<endl;
		a&=(1LL<<t+1)-1;
		b&=(1LL<<t+1)-1;
		int t1=t-1;
		while(t1>=0&&(b&(1LL<<t1))==0)
			t1--;
		b|=(1LL<<(t1+1))-1;
		printf("%lld\n",b-a+(1LL<<t+1)-max((1LL<<t)+a,b+1)+1);
		
	}
	
}

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

int main() 
{
    int res = 700;
    for (int i=0; i<3; i++)
    {
        char c; cin >> c;
        if (c=='o') res+=100;
    }
    cout << res;    
    return 0;
}

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

typedef long long ll;

int main(){
    int n;  cin >> n;
    vector<pair<int,int>> a(n);
    for(int i=0;i<n;i++){
        int x;
        cin >> x;
        a[i] = make_pair(x,i+1);
    }
    
    sort(a.begin(),a.end());
    
    for(int i=0;i<n;i++){
        if(i==n-1){
            cout << a[i].second << endl;
        }else{
            cout << a[i].second << " ";
        }
    }
    
    return 0;
}

Measured memory_bytes: 4056
#include <stdio.h>

#ifdef DEBUG
#define DPRTF(x) printf x
#define TRACE (printf("%s:%s:%d\n", __FILE__, __func__, __LINE__))
#define ERR(x) (TRACE, (x))
#else
#define DPRTF(x)
#define TRACE
#define ERR(x) (x)
#endif

int main(int argc, char *argv[])
{
    int N = 0;
    int K = 0;
    int h[100000];
    int count = 0;

    scanf("%d", &N);
    scanf("%d", &K);
    for (int i = 0; i < N; i++) {
        scanf("%d", &h[i]);
    }

    for (int j = 0; j < N; j++) {
        if (h[j] >= K) {
            count++;
        }
    }

    printf("%d\n", count);
    
    return 0;
}


Measured memory_bytes: 512
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(ll i=0;i<n;i++)
#define repl(i,l,r) for(ll i=(l);i<(r);i++)
#define per(i,n) for(ll i=n-1;i>=0;i--)
#define perl(i,r,l) for(ll i=r-1;i>=l;i--)
#define fi first
#define se second
#define pb push_back
#define ins insert
#define pqueue(x) priority_queue<x,vector<x>,greater<x>>
#define all(x) (x).begin(),(x).end()
#define CST(x) cout<<fixed<<setprecision(x)
#define vtpl(x,y,z) vector<tuple<x,y,z>>
#define rev(x) reverse(x);
using ll=long long;
using vl=vector<ll>;
using vvl=vector<vector<ll>>;
using pl=pair<ll,ll>;
using vpl=vector<pl>;
using vvpl=vector<vpl>;
const ll MOD=1000000007;
const ll MOD9=998244353;
const int inf=1e9+10;
const ll INF=4e18;
const ll dy[8]={1,0,-1,0,1,1,-1,-1};
const ll dx[8]={0,-1,0,1,1,-1,1,-1};
ll powmod(ll n, ll k, ll m) {
ll r=1;
 for(; k>0; k >>=1) {
   if(k&1) r=(r*n)%m;
   n=(n*n)%m;
 }
  return r;
}

ll fact(ll n) {
ll a=1;
rep(i,n) {
a=a*(n-i);
}
return a;
}

ll pow(ll a, ll b) {
ll x=1;
rep(i,b) {
x=x*a;
}
return x;
}



int main() {
ll A;
  ll B;
    ll C;
  ll D;
  cin >>A>>B>>C>>D;
  rep(i,1000) {
    if((A<=0) &&(C>0)) {
cout<<"No"<<endl;
      //cout<<A<<" "<<B<<endl;
      break;
    }
else if ((C<=0)&&(A>0)) {
cout<<"Yes"<<endl;
  break;
}
    
else {
  if(i%2!=0) {
A=A-D;
  }
  else {
    C=C-B;
  }

}
    

//cout<<i<<"i"<<A<<" "<<C<<endl;
 
    
  }
  
  
  
}


Measured memory_bytes: 3608
#200802C
X = int(input())
L = len(str(X))
#print(L)


Y = 0

for l in range(L):
    Y += 7*10**l
    
flag = 0
for i in range(1000000):
    Y = Y%X
    #print(i)

    if Y == 0:
        ans = L+i
        flag = 1
        break
    else: 
        Z = Y * 10 + 7
        if Z == Y:
            break
        else:
            Y = Z

if flag == 0:
    print("-1")
else:
    print(ans)

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

struct Dice {
  int label[6];
  void swap(int a, int b, int c, int d) {
    int temp = label[a];
    label[a] = label[b];
    label[b] = label[c];
    label[c] = label[d];
    label[d] = temp;
  }
  void roll(char dir) {
    switch (dir) {
    case 'N': swap(0, 1, 5, 4); break;
    case 'E': swap(0, 3, 5, 2); break;
    case 'W': swap(0, 2, 5, 3); break;
    case 'S': swap(0, 4, 5, 1); break;
    case 'R': swap(1, 2, 4, 3); break;
    }
  }
  bool is_same(Dice& d) {
    for (auto& dir : "RRRRNRRRRERRRRNRRRRERRRRNRRRR") {
      if (sequence_equal(d)) return true;
      roll(dir);
    }
    return false;
  }
  bool sequence_equal(Dice& d) {
    for (int i = 0; i < 6; i++) {
      if (label[i] != d.label[i]) return false;
    }
    return true;
  }
};

int main() {
  int n;
  cin >> n;
  vector<Dice> d(n);
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < 6; j++) {
      cin >> d[i].label[j];
    }
  }
  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j < n; j++) {
      if (d[i].is_same(d[j])) {
        cout << "No\n";
        return 0;
      }
    }
  }
  cout << "Yes\n";
  return 0;
}


Measured memory_bytes: 3060
#include<stdio.h>
#include<string.h>
#include<algorithm>
#include<vector>
#include<queue>
using namespace std;
#define N 100010
vector<int> p[N];
vector<int> q[N];
int vis[N],s[N];
int Spfa(int x)
{
    int i,j,k,t,mx,mi;
    queue<int> Q;
    vis[x]=1;
    s[x]=0;
    Q.push(x);
    mx=0;
    mi=0;
    while(!Q.empty())
    {
        t=Q.front();
        Q.pop();
        k=p[t].size();
        for(i=0;i<k;i++)
        {
            j=p[t][i];
            if(vis[j]==0)
            {
                s[j]=s[t]+q[t][i];
                mx=max(mx,s[j]);
                mi=min(mi,s[j]);
                if(mx-mi>1000000000)
                    return 0;
                vis[j]=1;
                Q.push(j);
            }
            else
            if(vis[j]==1&&(s[j]!=s[t]+q[t][i]))
                    return 0;
        }
    }
    return 1;
}
int main()
{
    int n,m,x,y,z,i,j,k,flag=1;
    scanf("%d%d",&n,&m);
    for(i=1;i<=m;i++)
    {
        scanf("%d%d%d",&x,&y,&z);
        p[x].push_back(y);
        p[y].push_back(x);
        q[x].push_back(z);
        q[y].push_back(-z);
    }
    for(i=1;i<=n;i++)
    if(vis[i]==0)
    {
        j=Spfa(i);
        if(j==0)
        {
            printf("No\n");
            return 0;
        }
    }
    printf("Yes\n");
    return 0;
}

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

int main(){
    int n,m;
    //int matA[n][m];
    //int matb[m];
    //int matans[n];
    cin >> n >> m;
    
    vector<vector<int> > matA(n, vector<int>(m));
    vector<int> matb(m);
    vector<int> matans(n,0);
    
    for(int row=0; row<n; row++){
        for(int column=0; column<m; column++){
            cin >> matA[row][column];
        }
    }
    
    for(int row=0; row<m; row++){
        cin >> matb[row];
    }
    
    for(int i=0; i<n; i++){
        for(int j=0; j<m; j++){
            matans[i] += (matA[i][j]*matb[j]);
        }
        cout << matans[i] << endl;
    }
    
    //for(int row=0; row<n; row++){
       
    //}

    return 0;
}


Measured memory_bytes: 3168
import java.util.*;
class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int num = sc.nextInt();
    int hint = sc.nextInt();
    
    int max = hint + num - 1;
    int min = hint - num + 1;
    
    for(int i=min;i<=max;i++) {
      System.out.print(i);
      System.out.print(" ");
    }
  }
}

Measured memory_bytes: 21716
import java.util.Scanner;
import java.util.Arrays;

class Main{
        public static void main(String[] args) {
                Scanner scan = new Scanner(System.in);
                int N = scan.nextInt();
                long a[] = new long[N];

                for (int i = 0; i < N; i++) {
                        a[i] = scan.nextInt();
                }

                sunukeSad(a, N);
        }

        private static void sunukeSad(long a[], int N){
                long b[] = new long[N];
                long c = 0;
                long result = 0;

                for (int i = 0; i < N; i++) {
                        b[i] = a[i] - i;
                }

                Arrays.sort(b);
                c = b[(N/2)];

                for (int j = 0; j < N; j++) {
                        result = result + Math.abs(b[j] - c);
                }

                System.out.println(result);
        }
}


Measured memory_bytes: 81460
//AtCoder ABC047 B - すぬけ君の塗り絵 2 イージー / Snuke's Coloring 2 (ABC Edit)
#include <bits/stdc++.h>
using namespace std;
using lli=int64_t;

int main() {
    int W,H,N;
    cin>>W>>H>>N;
    int minx=0;
    int maxx=W;
    int miny=0;
    int maxy=H;
    for(int i=0;i<N;++i){
        int x,y,a;
        cin>>x>>y>>a;
		switch(a) { 
        case 1: minx=max(x,minx); break;
        case 2: maxx=min(x,maxx); break;
		case 3: miny=max(y,miny); break;
        case 4: maxy=min(y,maxy); break;
		}
	}
    int ans=max(maxx-minx,0)*max(maxy-miny,0);
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 384
#include <cstdio>
#include <map>
#include <iostream>
using namespace std;
int main(){
    string s;
    cin >> s;
    map<string, int> res;
    res["MON"] = 6;
    res["TUE"] = 5;
    res["WED"] = 4;
    res["THU"] = 3;
    res["FRI"] = 2;
    res["SAT"] = 1;
    res["SUN"] = 7;
    cout << res[s] << endl;

    return 0;
}

Measured memory_bytes: 256
Q=int(input())
AB=[list(map(int,input().split())) for i in range(Q)]
for a,b in AB:
    x=int((a*b)**.5)
    if x*x==a*b:
        x-=1
    if max(a,b)-min(a,b)<2:
        print(2*min(a,b)-2)
    elif a*b<=x*(x+1):
        print(2*x-2)
    else:
        print(2*x-1)

Measured memory_bytes: 9456
i = 1
while i <= 3000:
    x,y = map(int, input().split())
    if (x == 0 and y == 0) or (x < 0 or 10000 < x) or (y < 0 or 10000 < y):
        break
    result = (str(x) + ' ' + str(y)) if x < y  else (str(y) + ' ' + str(x))
    print(result)
    i += 1

Measured memory_bytes: 5616
{-# LANGUAGE BangPatterns #-}

import qualified Data.Vector.Unboxed as U
import qualified Data.ByteString.Char8 as C
import Data.List
import Control.Arrow

r' :: IO [Int]
r'  =   unfoldr    (C.readInt . C.dropWhile (==' ')) <$> C.getLine




main = do
    [n,k] <- r'
    print $ sum $ map (M .(solveExact n)) [k..n+1]

lg x = x * (x + 1) `div` 2

solveExact n k =
    let l = lg (k-1)
        m = lg n - lg (n-k)
    in  m - (l - 1)

---------------------
-- #   Modulus   # --
---------------------

mdl = 1000000007

(^%) :: Int -> Int -> Int
b ^% e = powAux (b `rem` mdl) e 1 `mod` mdl
    where 
        powAux _ 0 !ac = ac
        powAux b e !ac = powAux (b*b `rem` mdl) (e `quot` 2)
            (if odd e then b*ac `rem` mdl else ac)

(+%), (-%), (*%), (/%) :: Int -> Int -> Int
a +% b = (a + b) `rem` mdl
a -% b = (a - b) `mod` mdl
a *% b = (a * b) `rem` mdl
a /% b = (a * invMod b) `mod` mdl
    where   invMod :: Int -> Int
            invMod = (^% (mdl-2))

newtype Mint = M Int deriving Eq
instance Show Mint where
    show (M i) = show i 
instance Num Mint where
    M a + M b = M (a +% b)
    M a * M b = M (a *% b)
    M a - M b = M (a -% b)
    abs = id
    signum (M 0) = 0
    signum _ = 1
    fromInteger = M.(`mod`mdl).fromInteger

Measured memory_bytes: 3768
#include <bits/stdc++.h>
using namespace std;
 
int main() {
 int N , a;
  cin >> N;
  a = N % 10;
  if(a == 2 || a == 4 || a == 5 || a == 7 || a == 9){
    cout << "hon" << endl;
}
  if(a == 3){
    cout << "bon" << endl;
  }
   if(a == 0 || a == 1 || a == 6 || a == 8){
    cout << "pon" << endl;
  }
}

Measured memory_bytes: 3632
N = int(input())
s = [int(input()) for _ in range(N)]

total = sum(s)
if (total % 10):
    print(total)
else:
    update = False
    ans = - float('inf')
    for i in range(N):
        if (total - s[i]) % 10:
            update = True
            ans = max(ans, total - s[i])
    if update:
        print(ans)
    else:
        print(0)


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

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
#define all(x) (x).begin(),(x).end()
#define sz(x) ((int)(x).size())

void solve(){

    vi v(3);
    for (int i = 0; i < 3; i++) {
        cin >> v[i];
    }
    sort(all(v));

    cout << v[2]*10+v[1]+v[0] << endl;


    return;
}

int main(int argc, char const* argv[])
{
    solve();
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define _USE_MATH_DEFINES
using namespace std;
    
#define ll long long int
#define pb push_back
#define rep(i , j , n) for(ll i = j ; i < n ; i++)
#define pre(i , j , n) for(ll i = j ; i >= n ; i--)
#define all(x) x.begin(), x.end()
typedef pair<int, int>	pii;
typedef pair<ll, ll>	pl;
typedef vector<int>		vi;
typedef vector<ll>		vll;
typedef vector<char>	vc;
typedef vector<bool>	vb;
typedef pair<ll,ll> 	pll;
#define br "\n"
#define MAX  1000001
#define ff first
#define ss second
#define MAXIM 100003



void solve(){
    ll x;
    cin >> x;
    cout << (!x);
}
	

int main(){
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif 

	ll t = 1;

	// cin >> t;
	rep(i,0,t){
		solve();
	}
 
}	

Measured memory_bytes: 3648
#include <bits/stdc++.h>
using namespace std;
typedef struct{
    int x1,x2,y1,y2;
} geser;
int main(){
    int h,w;
    scanf("%d %d",&h,&w);
    int arr[h+5][w+5];
    for(int a=0;a<h;a++){
        for(int b=0;b<w;b++) scanf("%d",&arr[a][b]);
    }
    vector<geser> ans;
    for(int a=0;a<h;a++){
        for(int b=0;b<w;b++){
            if(arr[a][b]%2){
                geser temp;
                temp.x1=a;
                temp.y1=b;
                if(b+1<w){
                    temp.x2=a;
                    temp.y2=b+1;
                    ans.push_back(temp);
                    arr[a][b+1]++;
                    arr[a][b]--;
                }
                else if(a+1<h){
                    temp.x2=a+1;
                    temp.y2=b;
                    ans.push_back(temp);
                    arr[a+1][b]++;
                    arr[a][b]--;
                }
            }
        }
    }
    printf("%d\n",ans.size());
    for(int a=0;a<ans.size();a++){
        printf("%d %d %d %d\n",ans[a].x1+1,ans[a].y1+1,ans[a].x2+1,ans[a].y2+1);
    }
}


Measured memory_bytes: 5232
#include <bits/stdc++.h>
using namespace std;
int main(){
    int a,b,c,d,z;
    cin>>z;
    d=z%10;
    c=(z/10)%10;
    b=(z/100)%10;
    a=(z/1000)%10;
    for(int i = 0; i < 2; i++){
        int t1;
        char s1;
        if(i==0){
            t1=a+b;
            s1 ='+';
        }
        else{
            t1=a-b;
            s1='-';
        }
        for(int j = 0; j < 2; j++){
            int t2;
            char s2;
            if(j==0){
                t2=t1+c;
                s2='+';
            }
            else{
                t2=t1-c;
                s2='-';
            }
            for(int k = 0; k < 2; k++){
                int t3;
                char s3;
                if(k==0){
                    t3=t2+d;
                    s3='+';
                }
                else{
                    t3=t2-d;
                    s3='-';
                }
                if(t3==7){
                    cout<<a<<s1<<b<<s2<<c<<s3<<d<<"=7";
                    return 0;
                }
            }
        }
    }
}

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

int main()
{

  string S,T;
  cin >> S;
  cin >> T;
  
  int l = S.length();

  int nDif = 0;
  for(int i=0;i<l;i++)
  {
    if(S[i] == T[i])
    {
      
    }else
    {
      nDif++;      
    }    
  }

  cout << nDif << endl;
  return 0;
}
  

Measured memory_bytes: 3920
def main():
  s = str(input())
  
  f = "" # 前回のステップの文字 "<" or ">" 
  ans = 0 # Answer
  count = 0 # Ai
  continuous = 0 # ">" が何回連続するか
  
  for m in s:
    if m=="<":
      if f==">" and count>0:
        # 清算
        ans-=count*continuous
        count=0
      count+=1
        
    else:
      if f=="<":
        # セット
        continuous=0
      count-=1
      continuous+=1

    if count>=0:
      ans+=count
    else:
      ans+=continuous
      count=0
    
    f=m

  print(ans)
    
if __name__ == '__main__':
    main()

Measured memory_bytes: 4120
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.StringTokenizer;

public class Main {
  public static void main(String[] args) {
    FastReader sc = new FastReader();
    int a = sc.nextInt();
    int b = sc.nextInt();
    
    int res = 0 ;
    res = Math.max(a + b, Math.max(a - b, a*b));
    System.out.println(res);
  }

  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;
      }
  }
}


Measured memory_bytes: 22996
#include <stdio.h>

int main() {
  int c[128][14] = {0};
  int n, r;
  char s, ss[] = {'S', 'H', 'C', 'D'};

  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf(" %c %d", &s, &r);
    c[s][r] = 1;
  }
  
  for (int i = 0; i < 4; i++) {
    s = ss[i];
    for (r = 1; r <= 13; r++) {
      if (c[s][r] == 0)
        printf("%c %d\n", s, r);
    }
  }
  
  return 0;
}


Measured memory_bytes: 2112
#include <iostream>
#include <cstring>
#include <cstdlib>
#include <set>
#include <vector>
#include <map>
#include <cstdio>
#include <utility>
#include <algorithm>
#include <cmath>
#include <queue>
#include <stack>
#include <cassert>
#include <climits>
#include <numeric>
#include <sstream>
using namespace std;
typedef long long ll;
#define DEBUG
#ifdef DEBUG
	#define debug printf
#else
	#define debug(...)
#endif
const int maxn = 2e5 + 5;
string s;
int n,k,c,a[maxn],b[maxn];
int main(int argc, char const *argv[])
{
	scanf("%d%d%d",&n,&k,&c);
	cin>>s;
	int cnt = 0;
	for(int i = 0;i < s.size() && cnt < k; ++i)
	{
		if(s[i] == 'o')
		{
			cnt++;
			a[i] = cnt;
			i += c;
		}
	}
	cnt = 0;
	for(int i = s.size() - 1;i >= 0 && cnt < k; --i)
	{
		if(s[i] == 'o')
		{
			cnt++;
			b[i] = cnt;
			i -= c;
		}
	}
	for(int i = 0;i < s.size(); ++i)
	{
		if(a[i] != 0 && b[i] != 0 && a[i] + b[i] == k + 1)
		{
			printf("%d\n",i + 1);
		}
	}
	return 0;
}

Measured memory_bytes: 3332
#pragma region header
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep1(i, n) for (int i = 1; i <= (int)(n); i++)
#define rev(i, n) for(int i = (int)(n - 1); i >= 0; i--)
#define rev1(i, n) for(int i = (int)(n); i > 0; i--)
#define pb push_back
#define all(v) (v).begin(), (v).end()
#define resort(v) sort((v).rbegin(), (v).rend())
#define vi vector<int>
#define vvi vector<vector<int>>
#define vc vector<char>
#define vvc vector<vector<char>>
#define vb vector<bool>
#define vvb vector<vector<bool>>
using ll = long long;
using P = pair<int, int>;

int dx[] = {1,0,-1,0};
int dy[] = {0,1,0,-1};
constexpr ll mod = 1e9+7;
constexpr ll inf = INT32_MAX/2;
constexpr ll INF = LLONG_MAX/2;
constexpr long double eps = DBL_EPSILON;
constexpr long double pi = 3.141592653589793238462643383279;



template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}

ll fact(int i) {       
    if (i == 0) return 1;
    return (fact(i - 1)) * i % mod;
}
ll gcd(ll a, ll b) {        
    if(b == 0) return a;
    return gcd(b, a % b); 
}
ll lcm(ll a, ll b) {      
    return a / gcd(a, b) * b ;
}
int keta(ll n) {       
    if(n == 0) return 1;
    int count = 0;
    while(n != 0) {
        n /= 10;
        count++;
    }
    return count;
}
ll ketasum(ll n) {   
    ll sum = 0;
    while(n != 0) {
        sum += n % 10;
        n /= 10;
    }
    return sum;
}

#pragma endregion
int v[40];
int ans[40];
signed main() {
    int n,k;cin >> n >> k;
    vi vec(n);
    rep(i, n) {
        int a;cin >> a;
        vec[i]=a;
        int j = 0;
        while(a>0) {
            if(a&1) v[j]++;
            // cout << a << ' ' << j << endl;
            j++;
            a>>=1;
            // cout << a << ' ' << j << endl;
        }
    }
    rep(i, 40) {
        if(v[i]<=n/2) ans[i]=1;
    }
    int x = 0;
    rev(i, 40) {
        if(x+ans[i]*pow(2,i)>k) {
            // cout << i << endl;
            // break;
            continue;
        }
        x+=ans[i]*pow(2,i);
    }
    int sum = 0;
    // x=0;
    // for(;x<=k;x++) {
        // sum=0;
        rep(i, n) sum+=vec[i]^x;
        // cout << x << ":" << sum << endl;
    // }
    cout << sum << endl;
    // cout << x << endl;
    // rep(i, 5) cout << v[i] << ' ';cout << endl;
    return 0;
}

Measured memory_bytes: 4160
@a=map[glob<>],1..<>;
@b=map[glob],<>;
for$a(@a){
	$d=1e9;
	$i=0;
	for$b(@b){
		++$i;
		$t=abs(@$a[0]-@$b[0])+abs(@$a[1]-@$b[1]);
		$t<$d&&($d=$t,$x=$i)
	}
	print$x,$/
}


Measured memory_bytes: 768
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees#, log2
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left, insort, insort_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10**9 + 7
#from decimal import *

N = INT()
S = input()

W = [0]*N
E = [0]*N

tmp = 0
for i in range(N):
	if S[i] == "W":
		tmp += 1
	W[i] = tmp

tmp = 0
for i in range(N-1, -1, -1):
	if S[i] == "E":
		tmp += 1
	E[i] = tmp

ans = INF
for i in range(N):
	ans = min(ans, W[i]+E[i])
print(ans-1)






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

#define endl "\n"
#define all(x) x.begin(),x.end()
#define pb push_back
#define ff first 
#define ss second 
#define pii pair<int,int>
#define vi vector<int>
#define vc vector<char>
#define vii vector<pii>
#define vvi vector<vi>
#define fori(i,n) for(int i=1;i<=n;++i)
#define forn(i,n) for(int i=0;i<n;++i)
#define sz(x) int(x.size())
#define error(x) cout<<#x<<" "<<x<<endl
#define IOS  ios::sync_with_stdio(0);cin.tie(0);cout.tie(0)

const int N=100*1000;
const int mod=1e9+7;

int min3(int a,int b,int c){return min(a,min(b,c));}
int max3(int a,int b,int c){return max(a,max(b,c));}
int min4(int a,int b,int c,int d){return min(min(a,b),min(c,d));}
int max4(int a,int b,int c,int d){return max(max(a,b),max(c,d));}


int32_t  main(){
	IOS;
  int n;cin>>n;
  int gc=0;
  fori(i,n){
    int x;cin>>x;
    gc=__gcd(gc,x);
  }
  cout<<gc<<endl;

  return 0;
}



Measured memory_bytes: 256
import math

N, D = map(int, input().split())
XY = []
for _ in range(N):
    x, y = map(int, input().split())
    XY.append([x, y])
ans = 0
for xy in XY:
    x = xy[0]
    y = xy[1]
    d = math.sqrt(x**2 + y**2)
    if d <= D:
        ans += 1
print(ans)


Measured memory_bytes: 39288
#[allow(unused_macros)]
macro_rules! input {
    ( $($t:ty),* ) => {{
        let mut s = String::new();
        std::io::stdin().read_line(&mut s);
        let mut splits = s.trim().split_whitespace();
        ($( { splits.next().unwrap().parse::<$t>().unwrap() },)*)
    }}
}

#[allow(dead_code)]
fn prime_factorization(n: u64) -> std::collections::HashMap<u64, u32> {
    let primes = primes((n as f32).sqrt().ceil() as u64);
    let mut h = std::collections::HashMap::new();
    let mut current = n;
    while current != 1 {
        let mut found = false;
        for p in &primes {
            if current % p == 0 {
                let count = h.entry(*p).or_insert(0);
                *count += 1;
                current /= *p;
                found = true;
            }
        }
        if !found {
            let count = h.entry(n).or_insert(0);
            *count += 1;
            break;
        }
    }
    return h;
}

#[allow(dead_code)]
fn primes(n: u64) -> Vec<u64> {
    if n < 3 {
        return vec![];
    }
    let mut res: Vec<u64> = vec![2];
    for i in 3..n {
        let i = i as u64;
        let root = ((n as f64).sqrt().ceil() as usize + 1) as u64;
        let composite = res.iter().take_while(|&&x| x <= root).any(|x| i % x == 0);
        if !composite {
            res.push(i);
        }
    }
    return res;
}

#[allow(unused_must_use)]
#[allow(unused_variables)]
fn solve() {
    let (n,) = input!(u64);

    let factors = prime_factorization(n);

    let mut total = 0;

    for (k, v) in factors {
        let mut count = 1;
        let mut vcount = v;
        while vcount >= count {
            vcount -= count;
            count += 1;
        }
        total += count - 1;
    }

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

fn main() {
    solve();
}


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

vector<long long> st;

void update(int i, long long x) {
    st[i] = x;
    while (i > 0) {
        i = (i-1)/2;
        st[i] = min(st[i*2+1], st[i*2+2]);
    }
}

long long query(int s, int t, int k, int ks, int kt) {
    if (kt <= s || t <= ks) return (1LL<<31)-1;
    if (s <= ks && kt <= t) return st[k];
    return min(
        query(s, t, k*2+1, ks, (ks+kt)/2),
        query(s, t, k*2+2, (ks+kt)/2, kt)
    );
}

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

    int n, q;
    cin >> n >> q;

    int m = 1;
    while (m < n) m *= 2;
    st.resize(m*2-1, (1LL<<31)-1);

    int com;
    long long x, y;
    for (int i=0; i<q; ++i) {
        cin >> com >> x >> y;
        if (com == 0) {
            update(m-1+x, y);
        } else if (com == 1) {
            cout << query(x, y+1, 0, 0, m) << endl;
        }
    }
}


Measured memory_bytes: 4896
#include<stdio.h>

int main(){
    char S[11];
    scanf("%s", S);

    char acgt[] = {'A', 'C', 'G', 'T'};
    int nn = 4;

    int answer = 0;
    int tmpsum = 0;
    for(int i=0; i<11; i++){
        //printf("%c:\n", S[i]);
        if(S[i] == '\0')
            break;
        int addflag = 0;
        for(int j=0; j<nn; j++){
            if(S[i] == acgt[j]){
                addflag = 1;
                //printf("->%c %d", acgt[j], addflag);
                break;
            }
            //printf("->%c %d", acgt[j], addflag);
        }
        //printf("\n");
        if(addflag)
            tmpsum++;
        else{
            tmpsum = 0;
        }
        if(tmpsum > answer)
            answer = tmpsum;
    }

    printf("%d\n", answer);

    return 0;
}

Measured memory_bytes: 256
<?php
$first_line = fgets(STDIN);
$second_line = fgets(STDIN);
$first_line_array = explode(" ", $first_line);

// 足場の数の合計
$steps_amount = $first_line_array[0];
// ジャンプで飛べる足場の数
$skip_power = $first_line_array[1];
// 足場の高さの配列
$steps_heights = explode(" ", $second_line);
// 足場ごとにたどり着くまでのコストの総和の最小値を入れていく配列
$dps = [];

foreach (range(0, $steps_amount - 1) as $index) {

    // 最初にいた足場に辿り着くまでのコストは０
    if ($index === 0) {
        $dps[0] = 0;
        continue;
    }

    // 一つ前の踏み台につくまでの総コスト
    $previous_total_cost = $dps[$index - 1];
    // 一つ前の踏み台から飛ぶためのコスト
    $jump_cost = abs($steps_heights[$index] - $steps_heights[$index - 1]);
    // とりあえず一つ前の踏み台から飛んだ場合の総コストで初期化して、数を比較して最小値を入れていく
    $dps[$index] = $previous_total_cost + $jump_cost;

    // 足場を飛ばした場合のことを考える
    foreach (range(1, $skip_power) as $i) {
        if ($index >= $i) {
            $new_total_cost = abs($dps[$index - $i] + abs($steps_heights[$index] - $steps_heights[$index - $i]));
            // 足場を飛ばした時のコストの方が少ない場合は値を更新する
            if ($dps[$index] > $new_total_cost) {
                $dps[$index] = $new_total_cost;
            }
        }
    }

}

//最後の足場の総コストを出力
echo end($dps);

Measured memory_bytes: 30960
#include <iostream>
#include <climits>
#include <algorithm>
#include <utility>

using namespace std;

typedef long long ll;

#define REP(i, n) for (ll i = 0; i < n; i++)
#define REPR(i, n) for (ll i = n; i >= 0; i--)
#define FOR(i, m, n) for (ll i = m; i < n; i++)

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

int main() {
    int n, s[10000], q, ans = 0;
    cin >> n;
    REP(i, n) cin >> s[i];
    cin >> q;
    REP(i, q){
        int t;
        cin >> t;
        REP(j,n){
            if(s[j]==t){
                ans++;
                break;
            }
        }
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 3104
#include<bits/stdc++.h>
using namespace std ;
#define int long long
#define pb push_back
#define mp make_pair
#define fastIO ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define sorta(v) stable_sort(v.begin(),v.end())
#define sortd(v) stable_sort(v.begin(),v.end(),greater <> ())
#define gcd(a,b) __gcd(a,b)
#define lcm(a,b) (a*b)/gcd(a,b)
#define I(a) insert(a)
#define F first
#define S second
const int N=1e9+7;

int power(int x, int y){ 
    int res = 1; 
    while (y > 0){
        if (y & 1) 
            res = ((res) * (x));
        res %= N; 
        y = y >> 1; 
        x = ((x) * (x)); 
    }
    return res; 
}

int powmod(int a,int b,int n){
    int x=1, y=a; 
    while (b > 0) {
        if (b%2 == 1) {
            x = (x*y) % n;
        }
        y = (y*y) % n; 
        b /= 2;
    
    }
    return x % n;
}

int32_t main(){
    fastIO
    int t=1;
    //cin>>t;
    while(t--){
	int n;
	cin>>n;
	int a[n], b[n], c[n];
	for(int i = 0; i < n; i++) 
	    cin>>a[i]>>b[i]>>c[i];
	int dp[n+1][3];
	
	dp[1][0] = a[0];
	dp[1][1] = b[0];
	dp[1][2] = c[0];
	
	for(int i = 2; i <=n; i++){
	    for(int j = 0;j < 3; j++){
	        if(j == 0)
	            dp[i][j] = a[i-1] + max(dp[i-1][1], dp[i-1][2]);
	        else if(j == 1)
	            dp[i][j] = b[i-1] + max(dp[i-1][0], dp[i-1][2]);
	        else
	            dp[i][j] = c[i-1] + max(dp[i-1][0], dp[i-1][1]);
	    }
	}
	cout<<max(dp[n][0], max(dp[n][1],dp[n][2]));
    }
    return 0;
}

Measured memory_bytes: 4992
#include<bits/stdc++.h>
#define F first
#define S second
#define MP make_pair
#define pb push_back
#define endl '\n'

using namespace std;

typedef long long LL;
typedef pair< int, int > P;
typedef pair< LL, LL > LP;
typedef pair< int, P > iP;
typedef pair< P, P > PP;

static const int INF = INT_MAX;
static const LL LINF = LLONG_MAX;
static const int MIN = INT_MIN;
static const LL LMIN = LLONG_MIN;
static const int MOD = 1000000007;

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

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    
    int a, b, c, x;
    cin >> a >> b >> c >> x;
    
    int cnt = 0;
    for( int i = 0; i <= a; ++i ) {
        for ( int j = 0; j <= b; ++j ) {
            for( int k = 0; k <= c; ++k ) {
                if( 500 * i + 100 * j + 50 * k == x ) ++cnt;
            }
        }
    }
    cout << cnt << endl;
    return 0;
}




Measured memory_bytes: 256
#include<stdio.h>
int main(void)
{
	int i,n,w,h,x[101],y[101],z[101];
	int a,b,c,d;
	scanf("%d %d %d",&w,&h,&n);
	a=w;
	b=h;
	c=0;
	d=0;
	for(i=0;i<n;i++){
		scanf("%d %d %d",&x[i],&y[i],&z[i]);
	}
	for(i=0;i<n;i++){
		if(z[i]==1 && c<x[i]){
			c=x[i];
		}
		else if(z[i]==2 && a>x[i]){
			a=x[i];
		}
		else if(z[i]==3 && d<y[i]){
			d=y[i];
		}
		else if(z[i]==4 && b>y[i]){
			b=y[i];
		}
	}
	if(a<=c || b<=d){
		printf("0\n");
	}
	else{
		printf("%d\n",(a-c)*(b-d));
	}
	return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pi;

#define INF 1LL << 60
#define MOD 1000000007;
#define pb push_back

#define REP(i, n) for (int i = 0; i < (n); i++)
#define REPR(i, b, e) for (int i = (b); i <= (e); i++)
#define DEBUG(x) cout << #x << ": " << (x) << endl
#define DEBUGA(a) cout << #a << ": " << endl; for (const auto& v: (a)) cout << v << endl

int H, W;
vector<string> in;
int d[1005][1005];

int main() {
    cin.tie(0);
    cin >> H >> W;
    in.resize(H, "");
    REP(i, H) cin >> in[i];

    queue<pi> q;
    REP(i, H) REP(j, W) {
        d[i][j] = -1;
        if (in[i][j] == '#') {
            d[i][j] = 0;
            q.push(pi(i, j));
        }
    }

    int x, y, nx, ny;
    int dx[4] = {1, 0, -1, 0};
    int dy[4] = {0, 1, 0, -1};
    while (q.size()) {
        pi p = q.front(); q.pop();
        x = p.first;
        y = p.second;

        REP(i, 4) {
            nx = x + dx[i];
            ny = y + dy[i];

            if (nx < 0 || nx >= H || ny < 0 || ny >= W) continue;
            if (d[nx][ny] == -1) {
                d[nx][ny] = d[x][y] + 1;
                q.push(pi(nx, ny));
            }
        }
    }

    int ans = -1;
    REP(i, H) REP(j, W) ans = max(ans, d[i][j]);

    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 13456
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll ZERO = 0;
const int Inf = 1000000000;
const ll INF= 1e18;
const ll MOD = 1000000007;
const double PI = 3.1415926535897;
typedef pair<ll,ll> P;

ll dp[100010][13];

int main() {
    string S;
    cin >> S;
    reverse(S.begin(),S.end());
    for(int i = 0;i < 100010;i++) {
        for(int j = 0;j < 13;j++) {
            dp[i][j] = 0;
        }
    }
    if(S.at(0) != '?') {
        dp[1][S.at(0) - '0']++;
    }
    else {
        for(int i = 0;i < 10;i++) {
            dp[1][i]++;
        }
    }
    vector<int> cnt = {1,10,9,12,3,4};
    for(int i = 1;i < S.size();i++) {
        if(S.at(i) != '?') {
            int cnt2 = cnt.at(i % 6) * (S.at(i) - '0');
            for(int j = 0;j < 13;j++) {
                dp[i + 1][(j + cnt2) % 13] = dp[i][j];
            }
        }
        else {
            for(int j = 0;j < 10;j++) {
                int cnt2 = cnt.at(i % 6) * j;
                for(int k = 0;k < 13;k++) {
                    dp[i + 1][(k + cnt2) % 13] = (dp[i + 1][(k + cnt2) % 13] + dp[i][k]) % MOD;
                }
            }
        }
    }
    cout << dp[S.size()][5] << endl;
}

Measured memory_bytes: 10624
n,q=map(int,input().split())
s=input()
temp=[0]*(n+1)
for i in range(n):
	if s[i:i+2]=="AC":
		temp[i+1]=temp[i]+1
	else:
		temp[i+1]=temp[i]
# print(temp)
for i in range(q):
	l,r=map(int,input().split())
	print(temp[r-1]-temp[l-1])

Measured memory_bytes: 6188
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace AOJ
{
	class Program
	{
		static void Main(string[] args)
		{
			var n = int.Parse(Console.ReadLine());
			for (int i = 0; i < n; i++)
			{
				Console.WriteLine("Case {0}:", i + 1);
				var s = int.Parse(Console.ReadLine());
				for (int j = 0; j < 10; j++)
				{
					s = int.Parse(Math.Pow(s, 2).ToString("00000000").Substring(2, 4));
					Console.WriteLine(s);
				}
			}
		}
	}
}

Measured memory_bytes: 5764
#include <bits/stdc++.h>
#include <unistd.h>
#include <sys/time.h>
#include <stdlib.h>
 
using namespace std;
 
typedef long long ll;
typedef pair<ll,ll> P;
typedef pair<P, ll> T;
typedef pair<long double , ll> Ps;
 
const ll INF = 2e18;
const ll fact_table = 3200008;
long double Pi = 3.1415926535897932384626;

priority_queue <ll> pql;
priority_queue <P> pqp;
priority_queue <P> bag;
//big priority queue
priority_queue <ll,vector<ll>,greater<ll> > pqls;
priority_queue <P,vector<P>,greater<P> > pqps;
//small priority queue
//top pop
 
ll dx[8]={1,0,-1,0,1,1,-1,-1};
ll dy[8]={0,1,0,-1,1,-1,-1,1};
char dir[] = "DRUL";
//↓,→,↑,←

#define endl "\n"
#ifdef ENJAPMA
    #undef endl
#endif
#define p(x) cout<<x<<endl;
#define el cout<<endl;
#define pe(x) cout<<x<<" ";
#define ps(x) cout<<fixed<<setprecision(25)<<x<<endl;
#define pu(x) cout<<(x);
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define CLEAR(a) a = decltype(a)(); 
#define pc(x) cout << x << ",";
#define rep(i, n) for (ll i = 0; i < (n); i ++)

// const ll mod = 998244353ll;
const ll mod = 1000000007ll;

ll mypow(ll a, ll b, ll mod){ll x=1;while(b){while(!(b&1)){(a*=a)%=mod;b>>=1;}(x*=a)%=mod;b--;}return x;}
void YES(bool cond){ if(cond){ p("YES");}else{ p("NO");} return;}
void Yes(bool cond){ if(cond){ p("Yes");}else{ p("No");} return;}


ll fact[fact_table + 5],rfact[fact_table + 5]; 
 
void c3_init(){
    fact[0] = rfact[0] = 1;
    for(ll i=1; i<=fact_table; i++){
        fact[i] = (fact[i-1]*i) % mod;
    }
    rfact[fact_table] = mypow(fact[fact_table],mod - 2, mod);
    for(ll i=fact_table; i>=1; i--){
       rfact[i-1] = rfact[i] * i;
       rfact[i-1] %= mod;
    }
    return;}
ll c3(ll n,ll r){
    return (((fact[n] * rfact[r]) % mod ) * rfact[n-r]) % mod;}


bool multicase = false;

ll n,m,num,a,b,c,d,e,h,q;
ll w, k, ans;

ll x[500005], y[500005], z[500005];
ll dp[5005][5005];
string s;

ll mul(ll a, ll b){
    if(b == 0)return 0;
    if(a > INF / b){
        return INF;
    }else{
        return a * b;
    }
}

void solve(){
    ll a;
    long double b;
    cin >> a >> b;
    b *= 100;
    ll bb = (b + 0.1);
    ll c = a * bb;
    c /= 100;
    p(c);
    return;
}


int main(){
    // init();
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    ll q, testcase = 1;
    if(multicase){
        cin >> q;
    }else{
        q = 1; 
    }
    while(q--){
        // pu("Case ");pu("#");pu(testcase);pu(": ");
        solve();
        testcase++;
    }
    // solve();
    return 0;
}
















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

using namespace std; 
#define REP(i, n) for (int i = 0; i < (n); i++)

typedef long long ll;
int main(int argc, char const *argv[])
{
    cin.tie(0);
   	ios::sync_with_stdio(false);
    ll A, B;
    cin >> A >> B;
    cout << A*B << endl;
    return 0;
}


Measured memory_bytes: 3640
#include<iostream>
#include<string>
#include<cstdio>
#include<cmath>
#include<cstring>
#include<algorithm>
#include<vector>
#include<functional>
#include<iomanip>
#include<queue>
#include<cassert>
#include<tuple>
#include<set>
#include<map>
#include<list>
#include<bitset>
#include<utility>
#include<numeric>

#define PB push_back
#define all(a)  (a).begin(),(a).end()
#define ALL(v) begin(v), end(v)
#define DWN(a)  (a).begin(),(a).end(), greater<int>()
#define rep(i, m) for (int i = 0; i < m; i++)
#define REP(i, n, m) for (int i = n; i < m; i++)
#define V vector<int>
#define VV vector<V>
#define VVV vector<VV>

using namespace std;

typedef long long ll;
typedef pair<int, int> P;

const int dx[4] = { 1, 0, -1, 0 };
const int dy[4] = { 0, 1, 0, -1 };
const int inf = (int)1e9;
const ll INF = (ll)1e18;
const ll MOD{ (ll)1e9 + 7 };
const long double EPS = 1e-10;

int main() {
	int H, W;
	char a[101][101];
	bool retu[101] = {}, gyo[101] = {};

	cin >> H >> W;

	rep(i, H) {
		rep(j, W) {
			cin >> a[i][j];

			if (a[i][j] == '#') {
				gyo[i] = true;
				retu[j] = true;
			}
		}
	}

	rep(i, H) {
		if (!gyo[i]) continue;
		rep(j, W) {
			if (!retu[j]) continue;
			cout << a[i][j];
		}
		cout << '\n';
	}

	return 0;
}


Measured memory_bytes: 256
from bisect import bisect


from bisect import bisect_left

n = int(input())
lis = list(map(int, input().split()))

lis.sort()

cnt = 0
for i in range(n-2):
    a = lis[i]
    for j in range(i+1, n-1):
        b = lis[j]
        tmp = bisect_left(lis, a+b)
        
        cnt += tmp - 1 -j
    

print(cnt)

Measured memory_bytes: 9296
import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        // 整数の入力
        int N=sc.nextInt();
        int[] b = new int[N];
        for(int i=0;i<N;i++){
            b[i]=sc.nextInt();
        }
        int[] result=new int[N];

        for(int i=N-1;i>=0;i--){
            for(int j=i;j>=0;j--){
                if(b[j]==j+1){
                    result[i]=j+1;
                    for(int k=j;k<i;k++){
                        b[k]=b[k+1];
                    }
                    break;
                }
                if(j==0){
                    System.out.println(-1);
                    return;
                }
            }
        }
        for(int i=0;i<N;i++){

            System.out.println(result[i]);
        }


    }
}

Measured memory_bytes: 25300
#include<stdio.h>
int main(void)
{
	int h,w,i,j,k,flg,x[101][101],e;
	char a[101][101];
	scanf("%d %d",&h,&w);
	for(i=0;i<h;i++){
		scanf("%s",a[i]);
	}
	for(i=0;i<h;i++){
		for(j=0;j<w;j++){
			flg=0;	e=0;
			for(k=j;k>=0;k--){
				if(a[i][k]=='c'){
					flg=1;
					break;
				}
				e++;
			}
			if(flg==0)	e=-1;
			x[i][j]=e;
		}
	}
	for(i=0;i<h;i++){
		printf("%d",x[i][0]);
		for(j=1;j<w;j++){
			printf(" %d",x[i][j]);
		}
		printf("\n");
	}
	return 0;
}
	
	
	



Measured memory_bytes: 2132
#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, q;
  cin >> n >> q;
  vector<long long> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  while (q--) {
    long long x;
    cin >> x;
    int l(0), r(0);
    long long cnt = 0;
    long long crr = 0;
    while (l < n) {
      if (r < n && crr + a[r] <= x) {
        crr += a[r];
        r++;
        cnt += (r - l);
      } else if (l < r) {
        crr -= a[l];
        l++;
      } else {
        r++;
        l++;
      }
    }
    cout << cnt << '\n';
  }
  return 0;
}


Measured memory_bytes: 3636
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<int,P> P1;
typedef pair<P,P> P2;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-7
#define INF 1000000000
#define mod 1000000007 
#define fi first
#define sc second
#define rep(i,x) for(int i=0;i<x;i++)
#define repn(i,x) for(int i=1;i<=x;i++)
#define SORT(x) sort(x.begin(),x.end())
#define ERASE(x) x.erase(unique(x.begin(),x.end()),x.end())
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin())
#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin())

int n,d,a[300005];
int ans;

int main(){
	scanf("%d%d",&n,&d);
	for(int i=1;i<=n;i++){
		scanf("%d",&a[i]);
		ans ^= (a[i]-1)%(d+1);
	}
	if(ans == 0) puts("Second");
	else puts("First");
}


Measured memory_bytes: 4072
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define fi first
#define se second
#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define repp(i, a, b) for (int i = a; i <= (b); ++i)
#define repr(i, a, b) for (int i = a; i >= (b); --i)
#define bit(n) (1LL << (n))
#define sz(x) ((int)(x).size())
typedef long long ll;
const int INF = 1001001001;
const ll LINF = 1001001001001001001ll;
const int MOD = 1000000007;

template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}

template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}

int main() {
  int N, A, B;
  cin >> N >> A >> B;
  int mx = min(A, B);
  int mn = max(0, A + B - N);
  cout << mx << ' ' << mn << endl;
}

Measured memory_bytes: 256