akhauriyash/Code-Regression huggingface dataset:
#pragma GCC optimize("O3")
#include<bits/stdc++.h> 
using namespace std;
using ll=long long;
using P=pair<ll,ll>;
template<class T> using V=vector<T>; 
#define fi first
#define se second
#define all(v) (v).begin(),(v).end()
const ll inf=(1e18);
const ll mod=998244353;
//const ll mod=1000000007;
ll GCD(ll a,ll b) {return b ? GCD(b,a%b):a;}
ll LCM(ll c,ll d){return c/GCD(c,d)*d;}
struct __INIT{__INIT(){cin.tie(0);ios::sync_with_stdio(false);cout<<fixed<<setprecision(15);}} __init;
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }
int h,w;
V<int> dy={0,-1,0,1},dx={-1,0,1,0};
bool b_ok[55][55],w_ok[55][55];
V<string> s;
void dfs(int y,int x,char c){
     for(int i=0;i<4;i++){
         int ny=dy[i]+y,nx=dx[i]+x;
         if(ny<0||ny>=h||nx<0||nx>=w)continue;
         if(s[ny][nx]!='.')continue;
         if(c=='W'&&w_ok[ny][nx])continue;
         if(c=='B'&&b_ok[ny][nx])continue;
         if(c=='W')w_ok[ny][nx]=true;
         if(c=='B')b_ok[ny][nx]=true;
         dfs(ny,nx,c);
     }
}
int main(){
    while(1){
        cin>>w>>h;
        if(h==0||w==0)return 0;
        s=V<string>(h);
        for(int i=0;i<h;i++)cin>>s[i];
        for(int i=0;i<h;i++){
            for(int j=0;j<w;j++){
                w_ok[i][j]=false;
                b_ok[i][j]=false;
            }
        }
        for(int i=0;i<h;i++){
            for(int j=0;j<w;j++){
                if(s[i][j]=='B'){
                    dfs(i,j,'B');
                }
                if(s[i][j]=='W'){
                  dfs(i,j,'W');
                }
            }
        }
        int B=0,W=0;
        for(int i=0;i<h;i++){
            for(int j=0;j<w;j++){
                if(s[i][j]!='.')continue;
                if(w_ok[i][j]&&b_ok[i][j])continue;
                if(w_ok[i][j])W++;
                if(b_ok[i][j])B++;
            }
        }
        cout<<B<<" "<<W<<"\n";
    }
}



Measured memory_bytes: 3320
#define _USE_MATH_DEFINES
#define INF 0x3f3f3f3f

#include <iostream>
#include <cstdio>
#include <sstream>
#include <cmath>
#include <cstdlib>
#include <algorithm>
#include <queue>
#include <stack>
#include <limits>
#include <map>
#include <string>
#include <cstring>
#include <set>
#include <deque>
#include <bitset>
#include <list>
#include <cctype>
#include <utility>
  
using namespace std;
  
typedef long long ll;
typedef pair <int,int> P;
typedef pair <int,P> PP;
  
static const double EPS = 1e-8;
  
static const int tx[] = {0,1,0,-1};
static const int ty[] = {-1,0,1,0};

int main(){
  int total_holidays;
  while(~scanf("%d",&total_holidays)){
    int japanese_drill_pages;
    int math_drill_pages;
    int max_japanese_pages_par_day;
    int max_math_pages_par_day;
    scanf("%d %d %d %d",
	  &japanese_drill_pages,
	  &math_drill_pages,
	  &max_japanese_pages_par_day,
	  &max_math_pages_par_day);

    int remaining_days =
      total_holidays
      - max(japanese_drill_pages / max_japanese_pages_par_day
	    + (bool)(japanese_drill_pages % max_japanese_pages_par_day),
	    math_drill_pages / max_math_pages_par_day
	    + (bool)(math_drill_pages % max_math_pages_par_day));
	    
    printf("%d\n",remaining_days);
  }
}

Measured memory_bytes: 1188
#include <stdio.h>

int main(){
  char s[4];
  for(int i=0;i<4;i++){
    scanf("%c",&s[i]);
  }
  int code = 0;
  for(int j=0;j<3;j++){
    if(s[j+1] == s[j]){
      code = 1;
    }
  }
  if(code == 1){
    printf("Bad\n");
  }else{
    printf("Good\n");
  }
  return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < n; i++)
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
template<class T> inline bool chmax(T& a, T b) {
  if (a < b) { a = b; return 1; }
  return 0; }
template<class T> inline bool chmin(T& a, T b) {
  if (a > b) { a = b; return 1; }
  return 0; }

int main(void){
  long double a,b; cin >> a >> b;
  ll c = floor(a*b);
  cout << c << endl;
  return 0;
}


Measured memory_bytes: 3736
#include <iostream>

int main()
{
	int h, w;
	for (;;) {
		std::cin >> h >> w;
		if (h == 0 && w == 0) break;
		for (int i=0; i!=h; ++i) {
			for (int j=0; j!=w; ++j) {
				if ((i+j)%2 == 0) std::cout << '#';
				else std::cout << '.';
			}
			std::cout << '\n';
		}
		std::cout << '\n';
	}
}

Measured memory_bytes: 3092
/*  -*- coding: utf-8 -*-
 *
 * a.cc: A: Two Coins
 */

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<stack>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<functional>
 
using namespace std;

/* constant */

/* typedef */

/* global variables */

/* subroutines */

/* main */

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

  if (a + b >= c) puts("Yes");
  else puts("No");
  return 0;
}


Measured memory_bytes: 256
#include<vector>
#include<cmath>
#include<map>
#include<cstdlib>
#include<iostream>
#include<sstream>
#include<fstream>
#include<string>
#include<algorithm>
#include<cstring>
#include<cstdio>
#include<set>
#include<stack>
#include<bitset>
#include<functional>
#include<ctime>
#include<queue>
#include<deque>
#include<complex>
#include<cassert>
using namespace std;
#define pb push_back
#define pf push_front
typedef long long lint;
typedef complex<double> P;
#define mp make_pair
#define fi first
#define se second
typedef pair<int,int> pint;
#define All(s) s.begin(),s.end()
#define rAll(s) s.rbegin(),s.rend()
#define REP(i,a,b) for(int i=a;i<b;i++)
#define rep(i,n) REP(i,0,n)
//問題文および制約はちゃんと確認しよう！
//サイズは10^5じゃなくて2×10^5とかかもしれないし、重要な制約・条件を見落としているかも
//とりあえずサンプルを読んでから解法を考えよう？
lint zyo[2001001],rz[2001001],z25[2001001],z26[2001001];
lint mo=1000000007;
lint extgcd(lint a, lint b, lint &x, lint &y) {
  lint g = a; x = 1; y = 0;
  if (b != 0) g = extgcd(b, a % b, y, x), y -= (a / b) * x;
  return g;
}
lint invMod(lint a, lint m) {
  lint x, y;
  if (extgcd(a, m, x, y) == 1) return (x + m) % m;return 0;
}
lint co(int a,int b){
	if(a<0 || b<0 || a<b) return 0;
	return (zyo[a]*rz[b])%mo*rz[a-b]%mo;
}
int main()
{
	zyo[0]=1;rep(i,2000100) zyo[i+1]=zyo[i]*(i+1)%mo;
	rep(i,2000100) rz[i]=invMod(zyo[i],mo);
	z25[0]=z26[0]=1;
	rep(i,2000100) z25[i+1]=z25[i]*25%mo,z26[i+1]=z26[i]*26%mo;
	int k,n;cin>>k;string s;cin>>s;n=s.size();
	/*lint out=co(k+n,n);
	rep(i,k-1){
		out*=25;out%=mo;
	}
	out*=26;out%=mo;
	out-=n;out%=mo;out+=mo;out%=mo;*/
	lint out=0;
	rep(i,k+1){
		lint t=co(n-1+i,i)*z25[i];t%=mo;
		t*=z26[k-i];out+=t;out%=mo;
	}
	cout<<out<<endl;
}


Measured memory_bytes: 67792
N, x, *A = map(int, open(0).read().split())
ans = 0
for i in range(1, N):
    required = (A[i] + A[i - 1]) - x
    if required <= 0:
        continue
    elif required <= A[i]:
        A[i] -= required
    else:
        A[i] = 0
        rem = required - A[i]
        A[i - 1] -= rem
    ans += required

print(ans)


Measured memory_bytes: 19960
#include<iostream>
#include<algorithm>
#include<queue>
#include<string>
#include<map>
#include<cassert>
#include<deque>
#include<vector>
#include<random>
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;
const long long inf = 1145141919810000;
typedef pair<int, int> P;

signed main() {
	string s; cin >> s;
	vector<int>V;
	rep(i, s.size()) {
		if (s[i] == 'B')V.push_back(i);
	}
	int sum = 0;
	int n = s.size();
	vector<int>V1;
	rep(i, V.size()) {
		V1.push_back(n - 1 - i);
	}
	reverse(V1.begin(), V1.end());
	rep(i, V.size()) {
		sum += V1[i] - V[i];
	}
	cout << sum << endl;

}


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

typedef long long LL;

LL ans;
int n, a, b;

int main()
{
    while(~scanf("%d%d%d", &n, &a, &b)){
        LL minx=a+b+(n-2ll)*a;
        LL maxx=a+b+(n-2ll)*b;
        ans=maxx-minx+1;
        if(a>b)ans=0;
        if(ans<0)ans=0;
        cout<<ans<<endl;

    }
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include<cmath>
#include<algorithm>
#include<vector>
using namespace std;
#define ll long long
#define ld long double


int main(){
int a,b;
cin>>a>>b;
int no=0;
int x=1;
while(b/x){
    x*=10;
}
no=a*x+b;
double sqroot= sqrt(no);
if(sqroot==(int)sqroot)
    cout<<"Yes";
else
    cout<<"No";
}

Measured memory_bytes: 3028
import numpy as np


def get_Negative(K, pos, neg):
    K = len(pos) * len(neg) - K + 1
    l = 0
    r = 10 ** 18 + 10
    while r - l > 1:
        m = (l + r) // 2
        target = m // pos
        x = np.searchsorted(neg, target, side="right").sum()
        if x >= K:
            r = m
        else:
            l = m
    return -r


def get_Positive(K, pos, neg):
    l = 0
    r = 10 ** 18 + 10
    tmp_pos = np.arange(len(pos))
    tmp_neg = np.arange(len(neg))
    while r - l > 1:
        m = (r + l) // 2
        cnt = 0
        if len(pos) > 1:
            t1 = m // pos
            x1 = np.searchsorted(pos, t1, side="right")
            x1 = np.maximum(0, x1 - tmp_pos - 1)
            cnt += x1.sum()
        if len(neg) > 0:
            t2 = m // neg
            x2 = np.searchsorted(neg, t2, side="right")
            x2 = np.maximum(0, x2 - tmp_neg - 1)
            cnt += x2.sum()
        if cnt >= K:
            r = m
        else:
            l = m
    return r


def main():
    N, K = map(int, input().split())
    A = np.array(input().split(), dtype=np.int64)

    positive = A[A > 0]
    negative = -A[A < 0]
    positive.sort()
    negative.sort()

    Npos = len(positive)
    Nneg = len(negative)
    Nzero = N - Npos - Nneg

    P_neg = Npos * Nneg
    P_pos = 0
    if Npos:
        P_pos += Npos * (Npos - 1) // 2
    if Nneg:
        P_pos += Nneg * (Nneg - 1) // 2
    P_zero = N * (N - 1) // 2 - P_pos - P_neg

    if K <= P_neg:
        ans = get_Negative(K, positive, negative)
        return ans
    K -= P_neg
    if K <= P_zero:
        return 0
    K -= P_zero
    ans = get_Positive(K, positive, negative)
    return ans


if __name__ == "__main__":
    print(main())

Measured memory_bytes: 34660
def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque
    #from collections import defaultdict
    from itertools import combinations, permutations, accumulate, groupby, product
    from bisect import bisect_left,bisect_right
    from heapq import heapify, heappop, heappush
    from math import floor, ceil
    #from operator import itemgetter

    #inf = 10**17
    #mod = 10**9 + 7

    a,b = map(int, input().split())
    if a<b:
        a,b = b,a
    c = a-b
    if c%2 == 0:
        print(c//2+b)
    else:
        print('IMPOSSIBLE')

if __name__ == '__main__':
    main()

Measured memory_bytes: 3316
#include <queue>
#include <iostream>
#include <sstream>
#include <cstring>
#include <algorithm>

using namespace std;

typedef struct {
	string name;
	int p;
	int idx;
} info;

vector<info> list;

bool operator<(const info& left, const info& right)
{
	if( left.name == right.name ){
		return left.p > right.p;
	}
	return left.name < right.name;
}


/*
林檎が A 個、林檎の欠片が P 個あります。 
林檎 1 個は、砕くことで林檎の欠片 3 個になります。
また、林檎の欠片 2 個を鍋で煮込むことで、アップルパイが 1 個作れます。

今ある材料で作れるアップルパイの最大数を求めてください。
*/
int main(void) {

	int n;
	cin >> n;

	int i = 1;
	while(n-->0){
		string s;
		int p;
		cin >> s >> p;
		info _info = { s, p, i++ };
		list.push_back(_info);
	}

	sort(list.begin(), list.end());
	for( vector<info>::iterator it = list.begin(); it != list.end(); it++ ){
		//cout << it->idx << " " << it->name << " " << it->p <<endl;
		cout << it->idx <<endl;
	}
}


Measured memory_bytes: 256
#!/usr/bin/env python3
#CODEFESTIVAL2016qualC B

import sys
import math
import bisect
sys.setrecursionlimit(1000000000)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

k,t = LI()
a = LI()
maxa = max(a)
ans = max(maxa-1-(sum(a)-maxa),0)
print(ans)


Measured memory_bytes: 38256
#include <bits/stdc++.h>
#define aaa cout<<233<<endl;
#define endl '\n'
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
// mt19937 rnd(TM(0));
const int inf = 0x3f3f3f3f;//1061109567 > 1e9
const ll linf = 0x3f3f3f3f3f3f3f3f;
const double eps = 1e-6;
const double pi = 3.14159265358979;
const int maxn = 1e5 + 5;
const int maxm = 5e5 + 233;
const int mod = 1e9 + 7;

ll n, a[maxn];
int main()
{
    // double pp = clock();
    // freopen("233.in", "r", stdin);
    // freopen("233.out", "w", stdout);
    ios_base::sync_with_stdio(0);
    cin.tie(0);cout.tie(0);
    
    double a, b, x;
    // cin >> a >> b >> x;
    scanf("%lf%lf%lf", &a, &b, &x);
    double ans;
    if(x >= a * a * b / 2){
        ans = (2 * a * a * b - 2 * x) / (a * a * a);
    }
    else{
        ans = (a * b * b) / 2 / x;
    }
    ans = atan(ans) / pi * 180;
    printf("%.10f\n", ans);
    // cout << atan(ans) / pi * 180 << endl;

    // cout << endl << (clock() - pp) / CLOCKS_PER_SEC << endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string.h>

using namespace std;

int main(){
  char S[99];
  cin >> S;
  int N = strlen(S);
  
  int jud1 = 1; //回文かの判定
  int jud2 = 1; //(N-1)/2のやつの判定
  int jud3 = 1; //(N+3)/2のやつの判定
  
  //回文かの判定
  for(int i=1;i<=N/2;i++){
    if(S[N/2+i] != S[N/2-i]){
      jud1 = 0;
    }
  }
  
  //(N-1)/2のやつの判定
  for(int i=0;i<(N-1)/2;i++){
    if(S[i] != S[(N-1)/2-1-i]){
      jud2 = 0;
    }
  }
  
  //(N-1)/2のやつの判定
  for(int i=0;i<N/2;i++){
    if(S[N/2+2-1+i] != S[N-1-i]){
      jud3 = 0;
    }
  }
  
  if(jud1 && jud2 && jud3){
    cout << "Yes";
  }else{
    cout << "No";
  }
  
  //cout << jud1 << jud2 << jud3;
  
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define FOR(i,r,n) for(ll i = (ll)(r); i < (ll)(n); i++)
#define RFOR(i,r,n) for(ll i=(ll)(n-1);i>=r;i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define ALL(x) x.begin(),x.end()
#define RALL(x) x.rbegin(),x.rend()
typedef long long int ll;
typedef vector<ll> vi;
typedef vector<pair<ll, ll> > vp;
typedef vector<string> vs;
typedef vector<char> vc;
typedef list<ll> lst;
typedef pair<ll, ll> P;
const long long INF = 1e9;
const long long MOD = 1000000007;
const long double PI = 3.1415926;
template <class T> T &chmin(T &a, const T &b) { return a = min(a, b); }
template <class T> T &chmax(T &a, const T &b) { return a = max(a, b); }
 
ll n, m, k, ans = 0, sum = 0, cnt = 0;
string s;
//char c;
 
#define Endl endl
 
/*--------------------template--------------------*/

int main() {
    ll N,T;
    cin>>N>>T;
    ll t1;
    cin>>t1;
    REP(i,N-1){
        ll t;
        cin>>t;
        ans+=min(t-t1,T);
        t1=t;
    }
    cout<<ans+T<<endl;
    return 0;
}


Measured memory_bytes: 384
#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <utility>
#include <cmath>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <functional>
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
typedef pair<ll, ll> P;
typedef vector<vector<P>> vvP;
#define rep(i, n) for(ll i = 0; i < n; i++)
#define exrep(i, a, b) for(ll i = a; i <= b; i++)
#define out(x) cout << x << endl
#define exout(x) printf("%.10f\n", x)
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define pb push_back
#define re0 return 0
const ll mod = 1000000007;
const ll INF = 1e16;
const ll MAX_N = 100010;

// Binary Index Treeは長さnの数列に対して
// 1. 区間[a,b)にxを加算する
// 2. 区間[a,b)の総和を求める
// という操作をO(log(n))で処理できる

// 区間加算にも対応したBinary Index Tree(1-indexで使うことに気をつける)
template <class Abel> struct BIT {

    vector<Abel> dat[2];
    Abel UNITY_SUM = 0;
    
    BIT(ll n) { 
        init(n);
    }

    void init(ll n) { 
        for(ll iter = 0; iter < 2; ++iter) {
            dat[iter].assign(n+1, UNITY_SUM); 
        }
    }
    
    inline void sub_add(ll p, ll a, Abel x) {
        for(ll i = a; i < (ll)dat[p].size(); i += i & -i) {
            dat[p][i] = dat[p][i] + x;
        }
    }
    // 区間[a,b)にxを加算する(a,bは1-index)
    inline void add(ll a, ll b, Abel x) {
        sub_add(0, a, x * -(a - 1)); 
        sub_add(1, a, x);
        sub_add(0, b, x * (b - 1));
        sub_add(1, b, x * (-1));
    }
    
    inline Abel sub_sum(ll p, ll a) {
        Abel res = UNITY_SUM;
        for(ll i = a; i > 0; i -= i & -i) {
            res = res + dat[p][i];
        } 
        return res;
    }
    // 区間[a,b)の総和を計算する(a, bは1-index)
    inline Abel getsum(ll a, ll b) {
        return sub_sum(0, b - 1) + sub_sum(1, b - 1) * (b - 1) - sub_sum(0, a - 1) - sub_sum(1, a - 1) * (a - 1);
    }
};

int main() {
    ll n, d, a;
    cin >> n >> d >> a;

    vector<P> p(n);
    rep(i, n) {
        ll x, h;
        cin >> x >> h;
        p[i] = make_pair(x, h);
    }
    sort(all(p));

    vl x(n), h(n);
    rep(i, n) {
        x[i] = p[i].first;
        h[i] = p[i].second;
    }
    
    BIT<ll> biTree(n+10);
    rep(i, n) {
        biTree.add(i+1, i+2, h[i]);  // biTree[i]をh[i]で初期化
    }
    
    ll ans = 0;
    exrep(i, 1, n) {  // BITは1-indexで使う
        ll hp_i = biTree.getsum(i, i+1);  // モンスタiの体力
        if(hp_i <= 0) {  // モンスタiの体力が0以下の場合
            continue;  // モンスタiはおしまい
        }
        ll cnt = (hp_i + a - 1)/a;  // モンスタiを倒すのに必要な操作回数
        //　モンスタiのいる座標を左端とした爆発が届く範囲を求める
        ll right = x[i-1] + 2*d;  // 爆発が届く右端の座標
        ll id = upper_bound(all(x), right) - x.begin();  // 爆発が届かないモンスタの中で最も左にいるモンスタの番号 
        id++;
        biTree.add(i, id, -a*cnt);  // モンスタiからモンスタid-1の体力をa*need減らす
        ans += cnt;
    }

    out(ans);
    re0;
}

Measured memory_bytes: 9600
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);i++)
#define all(v) v.begin(),v.end()
#define len(x) (ll)(x).length()
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
const int INF=1e9;
const ll INFS=1e18;
const int MOD=INF+7;
const int di[] = {-1,0,1,0};
const int dj[] = {0,-1,0,1};

int main(){
  ll a;
  double b;
  cin>>a>>b;
  ll ib=b*100+0.99;
  a*=ib;
  a/=100;
  cout<<a<<endl;
}

Measured memory_bytes: 3724
input_data = gets.chomp
n = input_data.to_i

arr = []
n.times do 
    arr.push(gets.chomp)
end

input_data = gets.chomp
m = input_data.to_i

openFlug = false
m.times do
    gg = gets.chomp
    if arr.include?(gg) && openFlug == false
        puts 'Opened by' + " "+ gg
        openFlug = true
    elsif arr.include?(gg) && openFlug != false
        puts 'Closed by' + " "+ gg
        openFlug = false
    else
        puts 'Unknown' + " "+ gg
    end
end



Measured memory_bytes: 8884
#include <stdio.h>
#include <iostream>
#include <stdlib.h>
#include <utility>
#include <math.h>
#include <stdexcept>
#include <algorithm>
#include <vector>
#include <cstring>
#include <cassert>
#include <string.h>

using namespace std;
#define  rep(i,n) for(int i=0;i<n;i++)
#define  REP(i,a,b) for(int i=a;i<b;i++)
typedef long long int lld;
typedef vector<lld> vl;
typedef vector<int> vi;
typedef vector<char> vc;



//int arr[N]
////sort(arr,arr +N)

//vector <int> hoge
////sort(hoge.begin(),hoge.end());

int main(){
	long int N;
	int a,b,k,ans,count=1;
	cin>>a>>b>>k;
	ans=min(a,b);
	while(1){
		if(a%ans==0 &&b%ans==0 && count==k){
			cout<<ans;
			return 0;
		}
		if(a%ans==0 &&b%ans==0){
			count++;
		}
		ans--;

	}
	cout<<ans;
	return 0;
}

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

using namespace std;

#define mp make_pair
#define pb push_back
#define fi first
#define se second
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) ((int)((x).size()))

typedef pair<int, int> PII;
typedef vector<int> VI;
typedef long long int64;
typedef unsigned int uint;
typedef unsigned long long uint64;

#define gi(x) ((x) = F())
#define gii(x, y) (gi(x), gi(y))
#define giii(x, y, z) (gii(x, y), gi(z))

int F()
{
	char ch;
	int x, a;
	while (ch = getchar(), (ch < '0' || ch > '9') && ch != '-');
	if (ch == '-') ch = getchar(), a = -1;
	else a = 1;
	x = ch - '0';
	while (ch = getchar(), ch >= '0' && ch <= '9')
		x = (x << 1) + (x << 3) + ch - '0';
	return a * x;
}

int A, B, C; 

int main()
{
	giii(A, B, C);
	if (A % 2 == 0 || B % 2 == 0 || C % 2 == 0) puts("0");
	else printf("%lld\n", min(1LL * A * B, min(1LL * B * C, 1LL * A * C)));
	return 0;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
#define f first
#define s second
#define MOD 1000000007
#define PMOD 998244353
#define pb(x) push_back(x)
using namespace std;

typedef long long int ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> plii;
typedef pair<int, pii> piii;
const int INF = 1e9+10;
const ll LINF = 1LL*INF*INF;
const int MAXN = 2e5+10;
const int MAXM = 5e3+10;

priority_queue<int> pq;
vector<vector<int> > graph;
queue<int> que;

int A[MAXN];
char S[MAXN];
char T[MAXN];

int main()
{
    int n,m,k,a,b,x,y,q;
    int sum = 0;
    int cnt = 0;
    int mx = 0;
    int mn = INF;
    int cur = 0, idx = -1;
    int tc;

    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    cin>>n;
    cin>>S;
    cin>>T;

    bool judge = true;

    int res = -1;

    for(int i=0;i<n;i++){
        judge = true;
        for(int j=i;j<n;j++)
            if(S[j]!=T[j-i])judge = false;
        if(judge){
            res = i+n;
            break;
        }
    }

    if(res==-1)res = 2*n;

    cout<<res<<"\n";

    return 0;
}


Measured memory_bytes: 256
n,k=map(int,input().split())
a=list(map(int,input().split()))
for i in range(n):
  a[i]=(a[i]+1)/2
ans=sum(a[:k])
chk=ans
for i in range(n-k):
  chk=chk-a[i]+a[i+k]
  if chk>ans:ans=chk
  
print(ans)

Measured memory_bytes: 71792
#include <iostream>

using namespace std;
using ll = long long;

int main()
{
    ll A;
    string B;
    cin >> A >> B;

    int B_x_100 = (B[0]-'0') * 100 + (B[2]-'0') * 10 + (B[3]-'0');
    ll ans = A * B_x_100 / 100;

    cout << ans << endl;
}


Measured memory_bytes: 3624
use std::io;
use std::io::Read;
use std::iter;

fn merge_sort(xs: &mut [usize], left: usize, right: usize) -> usize {
    if left + 1 < right {
        let mid = (left + right) / 2;
        let ninvleft = merge_sort(xs, left, mid);
        let ninvright = merge_sort(xs, mid, right);
        let ninvthis = merge(xs, left, mid, right);
        ninvleft + ninvright + ninvthis
    } else {
        0
    }
}

fn merge(xs: &mut [usize], left: usize, mid: usize, right: usize) -> usize {
    let nl = mid - left;
    let l: Vec<usize> = xs[left..mid]
        .iter()
        .cloned()
        .chain(iter::once(std::usize::MAX))
        .collect();
    let r: Vec<usize> = xs[mid..right]
        .iter()
        .cloned()
        .chain(iter::once(std::usize::MAX))
        .collect();
    let mut i = 0;
    let mut j = 0;
    let mut ninv = 0;

    for k in left..right {
        if l[i] <= r[j] {
            xs[k] = l[i].clone();
            i += 1;
        } else {
            xs[k] = r[j].clone();
            j += 1;
            ninv += nl - i;
        }
    }

    ninv
}

fn main() {
    let mut stdin = io::stdin();
    let mut buf = String::new();

    stdin.read_to_string(&mut buf);

    let mut iter = buf.split_whitespace();
    let n = iter.next().unwrap().parse().unwrap();
    let mut s: Vec<usize> = iter.map(|s| s.parse().unwrap()).collect();
    let cnt = merge_sort(&mut s, 0, n);
    println!("{}", cnt);
}



Measured memory_bytes: 11748
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include<numeric>
#include<cmath>
#include<map>
#include<iomanip>
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define INF 2e9
#define ALL(v) v.begin(), v.end()
using namespace std;
using ll = long long;
using P = pair<int,int>;
using pll = pair<ll,ll>;
using pdd = pair<double,double>;
using vvi = vector<vector<int> >;
using vvll =  vector<vector<ll> >;

int main(){
    cin.tie(nullptr);
	ios_base::sync_with_stdio(false);
	cout << fixed << setprecision(15);
    string S;cin>>S;
    int l = S.length();
    if(S[l-1] == 's'){
        S += "es";
    }
    else S += "s";
    cout <<S<<endl;
}



Measured memory_bytes: 3656
#include<bits/stdc++.h>
using namespace std;
#define lli long long int
#define inf 1000000000
#define pb push_back
#define mp make_pair
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define yoi cout<<"yo"<<endl;
#define debug(i) cout<<i<<endl;
const int mod=1e9 +7;
int main(){
IOS;
string s;
cin>>s;
int i;
set<char> st;
for(i=0;i<s.length();i++){
    st.insert(s[i]);
}
if(st.size()==2)
    cout<<"Yes"<<endl;
else cout<<"No"<<endl;
}


Measured memory_bytes: 256
n = int(input())
s = input().rstrip()
remaining_l = 0
remaining_r = 0
index = 0
while index < n:
    left = right = 0
    while index < n and s[index] == '(':
        left += 1
        index += 1
    while index < n and s[index] == ')':
        right += 1
        index += 1
    if left > right:
        remaining_r += left - right
    elif left < right:
        k = right - left
        if remaining_r <= k:
            remaining_l += k - remaining_r
            remaining_r = 0
        else:
            remaining_r -= k
print('(' * remaining_l + s + ')' * remaining_r)

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

using namespace std;

int main(){
	int n;
	cin>>n;
	int even=0;
	int four=0;
	int odd=0;

	for(int i=0;i<n;i++){
		int hoge;
		cin>>hoge;

		if(hoge%4==0) four++;
		else if(hoge%2==0) even++;
		else odd++;
	}

	if(even%2==1){
		even--;
		odd++;
	}

	if(four>=odd-1) cout<<"Yes"<<endl;
	else cout<<"No"<<endl;

	return 0;
}


Measured memory_bytes: 256
#![allow(unused_macros, unused_imports, dead_code)]

use std::io;
use std::process;
use std::collections::BinaryHeap;
use std::ops::Add;
use std::ops::SubAssign;
use std::ops::Mul;

fn read_line() -> String {
    let mut s = String::new();
    io::stdin().read_line(&mut s).unwrap();
    s
}

macro_rules! reads {
    ($($t:ty),+) => {
        {
            let line = read_line();
            let mut it = line.trim().split_whitespace();
            let result = (
                $(it.next().unwrap().parse::<$t>().unwrap(),)+
            );
            assert!(it.next().is_none());
            result
        }
    };
}

const INF: i64 = 1000000000000000;
const MOD: i64 = 1000000007;

fn mul(x: i64, y: i64) -> i64 {
    (x * y) % MOD
}

fn sub(x: i64, y: i64) -> i64 {
    (x + MOD - y) % MOD
}

fn sq(x: i64) -> i64 {
    mul(x, x)
}

fn main() {
    let (N, M) = reads!(usize, usize);
    let mut edges = vec![vec![]; N];

    let (mut S, mut T) = reads!(usize, usize);
    S -= 1; T -= 1;

    for _ in 0..M {
        let (mut U, mut V, D) = reads!(usize, usize, i64);
        U -= 1; V -= 1;
        edges[U].push((V, D));
        edges[V].push((U, D));
    }

    fn dijkstra(s: usize, edges: &Vec<Vec<(usize, i64)>>) -> Vec<i64> {
        let mut dist = vec![INF; edges.len()];
        dist[s] = 0;
        let mut heap = BinaryHeap::new();
        heap.push((0, s));

        while !heap.is_empty() {
            let (d, x) = heap.pop().unwrap();
            if dist[x] < -d {
                continue;
            }
            for &(y, c) in &edges[x] {
                if dist[x] + c < dist[y] {
                    dist[y] = dist[x] + c;
                    heap.push((-dist[y], y));
                }
            }
        }
        dist
    }

    let dS = dijkstra(S, &edges);
    let dT = dijkstra(T, &edges);

    fn count(s: usize, edges: &Vec<Vec<(usize, i64)>>, dist: &Vec<i64>) -> Vec<i64> {
        let N = edges.len();
        let mut ns = vec![0; N]; ns[s] = 1;

        let mut vs = (0..N).collect::<Vec<usize>>();
        vs.sort_by_key(|&i| dist[i]);

        for &x in &vs {
            for &(y, d) in &edges[x] {
                if dist[y] - dist[x] == d {
                    ns[y] = (ns[y] + ns[x]) % 1000000007;
                }
            }
        }

        ns
    }

    let nS = count(S, &edges, &dS);
    let nT = count(T, &edges, &dT);

    // println!("dS: {:?}", dS);
    // println!("dT: {:?}", dT);
    // assert!(dS[T] == dT[S]);

    // println!("nS: {:?}", nS);
    // println!("nT: {:?}", nT);
    // assert!(nS[T] == nT[S]);

    let mut result = sq(nS[T]);

    for i in 0..N {
        if dS[i] == dT[i] && dS[i] + dT[i] == dS[T] {
            result = sub(result, sq(mul(nS[i], nT[i])));
        }
    }

    for i in 0..N {
        for &(j, d) in &edges[i] {
            if (dS[i] - dT[j]).abs() < d && dS[i] + d + dT[j] == dS[T] {
                result = sub(result, sq(mul(nS[i], nT[j])));
            }
        }
    }

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

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

int main()
{
    int a, b;
    cin >> a >> b;

    //前提としてa <= bである
    if(a > 0){
        cout << "Positive" << endl;
    }else if(b >= 0){
        cout << "Zero" << endl;
    }else{
        if((a - b) % 2 == 0){
            cout << "Negative" << endl;
        }else{
            cout << "Positive" << endl;
        }
    }
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(){
    int N;
    int bingo[9]={0,0,0,0,0,0,0,0,0};
    bool ans[9]={0,0,0,0,0,0,0,0,0};
    for(int i=0;i<9;i++){
        cin >> bingo[i];
    }
    cin >> N;
    vector<int>vec;
    vec.resize(N);
    for(int i=0;i<N;i++){
        cin >> vec[i];
    }
    
    for(int i=0;i<9;i++){
        for(int a=0;a<N;a++){
            if(bingo[i]==vec[a]){
                ans[i]=1;
            }
            }
            }
    
    if((ans[0]==1)&&(ans[1]==1)&&(ans[2]==1)){
        cout << "Yes" << endl;
        return 0;}
    if((ans[3]==1)&&(ans[4]==1)&&(ans[5]==1)){
        cout << "Yes" << endl;
        return 0;}
    if((ans[6]==1)&&(ans[7]==1)&&(ans[8]==1)){
        cout << "Yes" << endl;
        return 0;}
    if((ans[0]==1)&&(ans[4]==1)&&(ans[8]==1)){
        cout << "Yes" << endl;
        return 0;}
    if((ans[2]==1)&&(ans[4]==1)&&(ans[6]==1)){
        cout << "Yes" << endl;
        return 0;}
    if((ans[0]==1)&&(ans[3]==1)&&(ans[6]==1)){
        cout << "Yes" << endl;
        return 0;}
    if((ans[1]==1)&&(ans[4]==1)&&(ans[7]==1)){
        cout << "Yes" << endl;
        return 0;}
    if((ans[2]==1)&&(ans[5]==1)&&(ans[8]==1)){
        cout << "Yes" << endl;
        return 0;}
    cout << "No" << endl;
    return 0;
}

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

using ll = long long;
using ld = long double;
using vi = vector<int>;
using vll = vector<ll>;
using P = pair<int, int>;

const int INF = 1e9;
const ll INFLL = 1e18;
const int MOD = 1e9 + 7;
const int NIL = -1;

#define rep(i,n) for(int i=0; i<(n); ++i)
#define all(n) n.begin(),n.end()

template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

#define DEBUG

struct waribiki
{
	int x, y, c;
};

int main()
{
	ios::sync_with_stdio(false); cin.tie(0);
	int A, B, M;
	cin >> A >> B >> M;
	vi a(A), b(B);
	rep(i, A) cin >> a[i];
	rep(i, B) cin >> b[i];
	vector<waribiki> w(M);
	rep(i, M)
		cin >> w[i].x >> w[i].y >> w[i].c;

	int ans = INF;
	rep(i, M)
	{
		chmin(ans, a[w[i].x-1] + b[w[i].y-1] - w[i].c);
	}
	sort(all(a)); sort(all(b));
	chmin(ans, a[0] + b[0]);
	cout << ans << endl;
	return 0;
}

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

#define ll long long int

int main()
{
   

   ll i,n,l;
   cin>>n>>l;
   ll sum[n+5],sum2=0,sum3=0,sum4=0;
   for(i=0;i<n;i++)
   {
       sum[i]=l+i;
       //cout<<sum[i]<<" ";
   }
   //cout<<endl;
   sort(sum,sum+n);
   ll j;
   for(i=0;i<n;i++)
   {
       sum4+=sum[i];
   }
   for(i=1;i<n;i++)
   {
       sum3+=sum[i];
   }
   //sum3=sum4-sum3;
 
   //cout<<sum4<<" "<<sum3<<endl;
   for(j=0;j<n;j++)
   {
       sum2=0;
       for(i=0;i<n;i++)
       {
           if(i!=j)
                sum2+=sum[i];
           //cout<<sum[i]<<endl;
       }
       //cout<<j<<" : "<<sum2<<endl;
       if(abs(sum4-sum2)<abs(sum4-sum3))
        sum3=sum2;
        //cout<<j<<" :: "<<sum3<<endl;
   }
   cout<<sum3;
   
   
    return 0;
}



Measured memory_bytes: 256
import java.util.Scanner;
 
public class Main {
    public static void main(String[] args) throws Exception {
 
//    	File file = new File("test.txt");
//    	Scanner sc = new Scanner(file);
        Scanner sc = new Scanner(System.in);
        int s = sc.nextInt();
        int w = sc.nextInt();
        System.out.println(w >= s ? "unsafe":"safe");
    }
}

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

using namespace std;

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define pf push_front
#define iter(v, i) for (__typeof__((v).begin()) i = (v).begin(); i != (v).end(); i++)
#define fast_io_without_cstdio ios_base::sync_with_stdio(false), cin.tie(NULL)
#define all(v) (v).begin(), (v).end()
#define rep(i, s, e) for (int i = s; i < e; i++)

// START for segment tree
#define params int p, int L, int R
#define housekeep int mid = (L + R) >> 1, left = p << 1, right = left | 1
// END

#ifdef __linux__
#define gc getchar_unlocked
#define pc putchar_unlocked
#else
#define gc getchar
#define pc putchar
#endif

#if __cplusplus <= 199711L
template<class BidirIt>
BidirIt prev(BidirIt it, typename iterator_traits<BidirIt>::difference_type n = 1) {
    advance(it, -n);
    return it;
}

template<class ForwardIt>
ForwardIt next(ForwardIt it, typename iterator_traits<ForwardIt>::difference_type n = 1) {
    advance(it, n);
    return it;
}
#endif

typedef long long ll;
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;
typedef long double ldouble;

const double EPS = 1e-9;
const double PI = 3.141592653589793238462;

template<typename T>
inline T sq(T a) { return a * a; }

//#ifdef LOCAL_MACHINE
//#endif

int main() {
    //freopen("", "r", stdin);
    //freopen("", "w", stdout);
    int n, k;
    scanf("%d %d", &n, &k);
    if (k == 0) {
        printf("%lld\n", n * 1LL * n);
        return 0;
    }
    ll ans = 0;
    for (int b = k + 1; b <= n; b++) {
        int last = b;
        for (int j = b; j <= n; j += b) {
            ans += b - k;
            last = j;
        }
        if (last + k <= n)
            ans += max(0, n - (last + k) + 1);
    }
    printf("%lld\n", ans);
    return 0;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
struct node
{
	int id,s;
}a[100005];
bool cmp(node a,node b)
{
	return a.id<b.id;
}
int main()
{
	int n,m,ans=0;
	cin>>n;
	for(int i=1;i<=n;i++)
	cin>>a[i].id,a[i].s=i;
	sort(a+1,a+1+n,cmp);
	for(int i=1;i<=n;i++)
	cout<<a[i].s<<" ";
}

Measured memory_bytes: 1536
#define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
using namespace std;
#define IO ios::sync_with_stdio(false); cin.tie(0);
#define all(v) (v).begin(), (v).end()
#define fi first
#define se second
typedef long long ll;
typedef pair<int, int> ii;
typedef pair<ll, int> li;
const int INF = (int) 1e9;
const ll LINF = (ll) 1e18;
int main() {
    IO;
    int n;
    cin >> n;
    if (n < 1200) cout << "ABC";
    else 
        if (n < 2800) cout << "ARC";
        else cout << "AGC";
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <map>
#include <numeric>
#include <string>
#include <cmath> 
#include <queue>
#include <functional>

typedef long long ll;
using namespace std;

int main() {

    ll N, A, B; cin >> N >> A >> B;

    vector<ll> X(N);
    for (int i = 0; i < N; i++) cin >> X[i];

    vector<ll> Y(N);
    for (int i = 0; i < N-1; i++) Y[i] = X[i+1] - X[i];

    ll ans = 0;
    for (int i = 0; i < N-1; i++) {
        //cout << Y[i] << ' ' << Y[i] * A << ' ' << ((Y[i] * A) <= B)  << '\n';
        if (Y[i] * A <= B) ans += Y[i] * A;
        else ans += B;
    }

    cout << ans << '\n';

}


Measured memory_bytes: 1792
/*
これを入れて実行
g++ code.cpp
./a.out
 */
 
#include <iostream>
#include <stdio.h>
#include <vector>
#include <string>
#include <cstring>
#include <queue>
#include <deque>
#include <stack>
#include <algorithm>
#include <utility>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <cmath>
#include <math.h>
#include <tuple>
#include <iomanip>
#include <bitset>
#include <functional>
#include <cassert>
#include <random>

#define all(x) (x).begin(),(x).end()
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
 
using namespace std;
typedef long long ll;
typedef long double ld;
 
int dy4[4] = {-1, 0, +1, 0};
int dx4[4] = {0, +1, 0, -1};
int dy8[8] = {-1, -1, 0, 1, 1, 1, 0, -1};
int dx8[8] = {0, 1, 1, 1, 0, -1, -1, -1};
 
const long long INF = 1LL << 60;
const ll MOD = 1e9 + 7;
 
bool greaterSecond(const pair<int, int>& f, const pair<int, int>& s){
    return f.second > s.second;
}
 
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;
}

ll conbinationMemo[100][100];

void cmemoInit(){
    rep(i, 100){
        rep(j, 100){
            conbinationMemo[i][j] = -1;
        }
    }
}
 
ll nCr(ll n, ll r){
    if(conbinationMemo[n][r] != -1) return conbinationMemo[n][r];
    if(r == 0 || r == n){
        return 1;
    } else if(r == 1){
        return n;
    }
    return conbinationMemo[n][r] = (nCr(n - 1, r) + nCr(n - 1, r - 1));
}
 
ll nPr(ll n, ll r){
    r = n - r;
    ll ret = 1;
    for (ll i = n; i >= r + 1; i--) ret *= i;
    return ret;
}
//-----------------------ここから-----------
int main(void){
    ll l;
    cin >> l;

    ll idx = 0;
    vector<pair<pair<ll,ll>,ll>> ans;
    vector<ll> vec;
    while(pow(2LL, idx + 1) <= l){
        vec.push_back(idx);
        ans.push_back({{idx, idx + 1}, pow(2LL, idx)});
        ans.push_back({{idx, idx + 1}, 0});
        idx++;
    }

    //cout << idx << endl;

    ll rest = l - pow(2LL, idx);
    //cout << rest << endl;
    for(ll i = vec.size() - 1; i >= 0; i--){
        ll tmp = pow(2LL, vec[i]);
        if(rest - tmp >= 0){
            ans.push_back({{vec[i], vec.back() + 1}, l - rest});
            rest -= tmp;
        }
    }

    cout << vec.back() + 2 << " " << ans.size() << endl;
    rep(i, ans.size()){
        cout << ans[i].first.first + 1 << " " << ans[i].first.second + 1 << " " << ans[i].second << endl; 
    }



    
}



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

#define ll              long long int
#define scan(any)       for(auto &i:any) cin>>i;
#define print(any)      for(auto i:any) cout<<i<<" "; 
#define endl            '\n'
#define pb push_back
#define vll vector<ll> 
#define f(i,x,y)  for(i=x;i<y;i++)
#define INF     LLONG_MAX
#define fast    ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define s(x) sort(x.begin(),x.end())
#define all(v) v.begin(),v.end()
#define p2(n,x)    cout << fixed << setprecision(x) <<n<<endl; 
#define pll    pair<ll,ll> 
#define ff first
#define ss second
#define blt(x)   __builtin_popcount(x)

void solve()
{
    double i,j,k;
    cin>>i>>j>>k;
    if((double)(i/k*1.0)<=j)
    {
        cout<<"Yes";
    }
    else
        cout<<"No";
}

int main()
{
   
    fast
    ll t = 1;

    

    while(t--)
    solve();
    
    return 0;
}

Measured memory_bytes: 3716
#include<stdio.h>
#include<string.h>
int main(){
    int x,y;
    scanf("%d%d",&x,&y);
    int a[13]={0,1,2,1,3,1,3,1,1,3,1,3,1};
    if(a[x]==a[y]) puts("Yes");
    else puts("No");
    return 0;
}


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

#define ll long long

template<typename T> void drop(const T &x){cout<<x<<endl;exit(0);}

void solve() {
  ll a,b,c,d;
  cin >> a >> b >> c >> d;
  ll ab, cd;
  ab = a*b; cd = c*d;
  cout << (ab>=cd?ab:cd) << endl;

  return;
}

signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int T=1;
  while(T--) solve();

  return 0;
}


Measured memory_bytes: 3624
import static java.lang.Integer.parseInt;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;

/**
 * Longest Steps
 */
public class Main {

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

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String line = "";

		while (!(line = br.readLine()).equals("0 0")) {

			int n = parseInt(line.substring(0, line.indexOf(' ')));
			int k = parseInt(line.substring(line.indexOf(' ') + 1));

			boolean[] cards = new boolean[n + 1];
			for (int i = 0; i < k; i++) {
				cards[parseInt(br.readLine())] = true;
			}

			int sum = 0;
			List<Integer> list = new ArrayList<Integer>();
			list.add(0);
			for (int i = 1; i < n + 1; i++) {
				if (cards[i]) {
					sum += 1;
				} else {
					if (sum > 0) {
						list.add(sum);
					}
					list.add(0);
					sum = 0;
				}
			}
			if (sum > 0) {
				list.add(sum);
			}
			list.add(0);

			int max = 0;
			for (int i = 1; i < list.size() - 1; i++) {
				if (cards[0] && list.get(i) == 0) {
					int steps = list.get(i - 1) + 1 + list.get(i + 1);
					if (steps > max) {
						max = steps;
					}
				} else {
					if (list.get(i) > max) {
						max = list.get(i);
					}
				}
			}
			System.out.println(max);
		}

	}
}

Measured memory_bytes: 30516
use proconio::input;
use proconio::marker::{Bytes, Chars};

// x ** n % mods を求める
pub fn mod_pow(x: i64, n: i64, mods: i64) -> i64 {
    if n == 0 {
        return 1;
    }
    let mut res = mod_pow(x * x % mods, n / 2, mods);
    if n % 2 == 1 {
        res = res * x % mods;
    }
    return res;
}

// (1/n) % mods を求める
pub fn mod_inv(n: i64, mods: i64) -> i64 {
    return mod_pow(n, mods-2, mods);
}

// nCk % mods を求める
pub fn mod_comb(n: i64, k: i64, mods: i64) -> i64 {
    let sum1 = (n-k+1..n+1).fold(1, |ac, x| ac * x % mods);
    let sum2 = (1..k+1).fold(1, |ac, x| ac * x % mods);
    return sum1 * mod_inv(sum2, mods) % mods;
}

// nCk の組み合わせを列挙する
pub fn combination(n: usize, k: usize) -> Vec<Vec<usize>> {
    let mut ans = Vec::new();
    if k == 1 {
        for i in 1..n+1 {
            let mut tmp = Vec::new();
            tmp.push(i);
            ans.push(tmp);
        }
    }
    else {
        for iter in combination(n-1, k-1) {
            let max = iter.iter().max().unwrap();
            for j in *max+1..n+1 {
                let mut tmp = iter.clone();
                tmp.push(j);
                ans.push(tmp);
            }
        }
    }
    ans
}


fn main() {
    input!{
        n: usize,
        a: [usize; n],
    }
    let mut ans = 1000;
    let mut min = 201;
    for i in 0..n-1 {
        if a[i] < min {
            min = a[i];
        }
        if a[i+1] > min {
            let buy = ans / min;
            ans = ans + (a[i+1] - min) * buy;
            min = 201;
        }
    }
    println!("{}", ans);
}


Measured memory_bytes: 2104
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <cmath>
#include <vector>
#include <map>
#include <set>
#include <string>
#include <stack> // s.top()
#include <bitset>
#include <queue> // s.front()
using namespace std;

typedef long long Int;
typedef pair<Int,Int> P;

#define INF10 10000000000
#define INF5 100000
#define EPS 1e-10
#define MOD 1000000007


int main() {
	int N, K, X, Y;

	cin >> N >> K >> X >> Y;
	int ans = 0;

	for (int i = 0; i < N; i++) {
		if (i < K)ans += X;
		else ans += Y;
	}

	cout << ans << endl;







	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i<(n); i++)
#define rep2(i,x,n) for(int i=x; i<(n); i++)
#define ALL(n) begin(n),end(n)
using namespace std;
using ll = long long;

int main()
{
    int n;
    cin >> n;
    vector<int> x(n);
    float a = 0;
    rep(i,n){
        cin >> x[i];
        a += x[i];
    }
    a = a/n;
    int aa = round(a);
    int ans = 0;
    rep(i,n){
        ans += pow(aa-x[i],2);
    }

    cout << ans << endl;
    
    return 0;
}

Measured memory_bytes: 384
from collections import deque
import copy

# グラフの作成(無向グラフでは#を消す)
n, q = map(int, input().split())
graph = [deque([]) for _ in range(n+1)]
for _ in range(n-1):
    a, b  = [int(x) for x in input().split()]
    graph[a].append(b)
    graph[b].append(a) # 無向グラフ
#print(graph)
q_sum_list = [0 for _ in range(n)]
for i in range(q):
    p, x = map(int, input().split())
    q_sum_list[p-1] += x
#print(q_sum_list)
arrive_rireki = [-1] * (n + 1)

score = [0]*n
score_temp = 0

# 深さ優先探索
def dfs(v):
    global score_temp
    stack = [v]
    arrive_rireki[v] = 1
    score_temp += q_sum_list[v-1]
    while stack:
        v = stack[-1]
        if graph[v]:
            w = graph[v].popleft()
            if arrive_rireki[w] < 0:
                arrive_rireki[w] = 1
                stack.append(w)
                score_temp += q_sum_list[w-1]
        else:
            stack.pop()
            score[v-1] = score_temp
            score_temp -= q_sum_list[v-1]
    return score

dfs(1)
#print(eda_list)
print(* score)


Measured memory_bytes: 162064
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
const ll MOD = 1000000007;

int gcd(int a, int b){
  if(a < b) return gcd(b, a);
  int r;
  while((r=a%b)){
    a = b;
    b = r;
  }
  return b;
}

int main(){
  int N;
  cin >> N;
  int A[N];
  for(int i = 0; i < N; i++) cin >> A[i];

  if(N == 2){
    cout << max(A[0],A[1]) << "\n";
    return 0;
  }

  int cumgcdFrontTo[N];
  int cumgcdEndTo[N];
  cumgcdFrontTo[0] = A[0];
  cumgcdEndTo[N-1] = A[N-1];

  for(int i = 1; i < N; i++){
    cumgcdFrontTo[i] = gcd(cumgcdFrontTo[i-1],A[i]);
    cumgcdEndTo[N-1-i] = gcd(cumgcdEndTo[N-i],A[N-i-1]);
  }

  int answeres[N];
  answeres[0] = cumgcdEndTo[1];
  answeres[N-1] = cumgcdFrontTo[N-2];
  for(int i = 1; i < N-1; i++){
    answeres[i] = gcd(cumgcdFrontTo[i-1], cumgcdEndTo[i+1]);
  }
  int ans = 0;

  for(int i = 0; i < N; i++){
    ans = max(ans, answeres[i]);
  }

  cout << ans << "\n";
  return 0;
}

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

#define REP(i, m, n) for (int i = (m); i < (int)(n); i++)
#define REPS(i, m, n) for (int i = (m); i <= (int)(n); i++)
#define rep(i, n) REP(i, 0, n)
#define reps(i, n) for (int i = 0; i <= (int)(n); i++)
#define rrep(i, x) for (int i = ((int)(x)-1); i >= 0; i--)
#define rreps(i, x) for (int i = (int)(x); i >= 0; i--)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define pb push_back
#define fi first
#define se second
typedef long long ll;
typedef pair<int, int> P;
const int inf = INT_MAX;
const ll INF = 1LL << 60;
const ll mod = 1e9 + 7;
const double EPS = 1e-10;
const double PI = acos(-1.0);
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
template<typename A, size_t N, typename T> void Fill(A (&array)[N], const T &val) { fill( (T*)array, (T*)(array+N), val ); }
template <class T1, class T2, class Pred = std::less<T2> >
struct sort_pair_second {
    bool operator()(const std::pair<T1,T2>&left, const std::pair<T1,T2>&right) {
        Pred p;
        return p(left.second, right.second);
    }
};

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

    int N; cin >> N;
    cout << (N * (N + 1)) / 2 << endl;
    return 0;
}

Measured memory_bytes: 256