akhauriyash/Code-Regression huggingface dataset:
//http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ITP1_3_B
#include <iostream>
using namespace std;
int main(){
  int x,i=1;
  while(cin >> x){
    if(x == 0){
      break;
    }
    else{
      cout << "Case " << i << ": "<< x << endl;
    }
    i++;
  }
}

Measured memory_bytes: 1160
#include <stdio.h>
#include <stdlib.h>
#define MAX 2000001
#define VMAX 10000

int main(){
unsigned short *A, *B;
  int C[VMAX+1];
  int n, i, j;

  scanf("%d", &n);

  A = malloc(sizeof(short)*n+1);
  B = malloc(sizeof(short)*n+1);
  
  /*******************************************/
  
  for(i=0;i<=VMAX;i++){
  C[i]=0;
  }
  
  for(i=0;i<n;i++){
  scanf("%d",&A[i+1]);
  C[A[i+1]]++;
  }
  
  for(i=1;i<VMAX;i++){
  C[i]=C[i]+C[i-1];
  }
  
  for(j=1;j<=n;j++){
  B[C[A[j]]]=A[j];
  C[A[j]]--;
  }
  
  for(i=1;i<=n;i++){
  if(i>1){
  printf(" ");
  }
  printf("%d",B[i]);
  }
  printf("\n");
  return 0;
  
  /*******************************************/
}


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

using namespace std;
typedef long long ll;
typedef pair<int, int> i_i;
typedef pair<ll, ll> l_l;
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
#define int ll
//const ll mod = 1000000007;

int n, a[200010];
int mx, nx;

signed main() {
    cin >> n;
    for (int i = 0; i < n; i++) {
        cin >> a[i];
        if (a[i] > mx) {
            nx = mx;
            mx = a[i];
        } else if (a[i] > nx) {
            nx = a[i];
        }
    }

    for (int i = 0; i < n; i++) {
        int ans = (a[i] == mx) ? nx : mx;
        cout << ans << endl;
    }

}



Measured memory_bytes: 3200
#include <iostream>
#include <string>
#include <vector>

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

using std::cin;
using std::cout;
using std::endl;
using std::string;
using std::vector;

int main() {
  int A, B, C;

  cin >> A >> B >> C;

  if ((A == 5 && B == 5 && C == 7) || (A == 7 && B == 5 && C == 5) || (A == 5 && B == 7 && C == 5)) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }

  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <iomanip>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <vector>
#include <string>
#include <queue>
#include <deque>
#include <list>
#include <set>
#include <map>
#include <bitset>

using namespace std;
typedef long long ll;

/////////////         modの計算

int mod = 1000000007;

ll mod_adjust(ll a) {//	余りをとる(0～mod-1に調整する)
	if (a >= mod) {
		return a % mod;
	}
	if (a < 0) {
		a *= -1;
		a %= mod;
		return mod - a;
	}
	return a;
}
int mod_add(int a, int b) {//	足し算
	ll k = mod_adjust((ll)a); k += mod_adjust((ll)b);
	k = mod_adjust(k);
	return (int)k;
}
int mod_sub(int a, int b) {//	引き算
	return mod_add(a, -b);
}
int mod_multi(int a, int b) {//	掛け算
	ll k = mod_adjust((ll)a);
	k *= mod_adjust((ll)b);
	k = mod_adjust(k);
	return (int)k;
}

int main() {
	int N, K; cin >> N >> K;

	set<int> st;
	for (int i = 1; i <= sqrt(N); i++) {
		st.insert(i);
		st.insert(N / i);
	}

	N = st.size();
	vector<int> X;
	vector<int> Y;

	int prev = 0;
	for (auto itr = st.begin(); itr != st.end(); itr++) {
		X.push_back(*itr);
		Y.push_back(*itr - prev);
		prev = *itr;
	}

	int** dp = new int* [K];
	for (int k = 0; k < K; k++) {
		dp[k] = new int[N];
		for (int i = 0; i < N; i++) {
			dp[k][i] = 0;
		}
	}
	for (int i = 0; i < N; i++) {
		dp[0][i] = X[i];
	}

	for (int k = 1; k < K; k++) {
		int j = N - 1;
		dp[k][0] = mod_multi(dp[k - 1][j], Y[0]);
		for (int i = 1; i < N; i++) {
			dp[k][i] = mod_add(dp[k][i - 1], mod_multi(dp[k - 1][N - 1 - i], Y[i]));
		}
	}

	cout << dp[K - 1][N - 1] << endl;

	return 0;
}

Measured memory_bytes: 28668
#include<stdio.h>
int main(){
  int n,a,b,i,j,sum[100],max,min;
  while(1){
    scanf("%d",&n);
    for(i=0;i<n;i++)sum[i]=0;
    if(n==0)break;
    for(i=0;i<n;i++){
      for(j=0;j<5;j++){
      scanf("%d",&a);
      sum[i]+=a;
      }
    }
    max=0,min=100000;
    for(i=0;i<n;i++){
      if(max<sum[i])max=sum[i];
      if(min>sum[i])min=sum[i];
    }
    printf("%d %d\n",max,min);
  }
  return 0;
}

Measured memory_bytes: 600
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define sz(x) (int)(x.size())
#define double long double 
#define x real()
#define y imag()
#define fi first
#define se second
#define pii pair<int, int>

signed main() {
    ios::sync_with_stdio(false); cin.tie(nullptr);
	int n;
	cin >> n;
	string s;
	cin >> s;
	if (n % 2 == 1) {
		cout << "No\n";
	} else {
		int m = n / 2;
		string a = s.substr(0, m);
		string b = s.substr(m);
		if (a == b) {
			cout << "Yes\n";
		} else {
			cout << "No\n";
		}
	}
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
 
typedef pair<int,int> P;
struct edge{int to, id;};
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define mod 1000000007

int main(){
    int a,b,c,d;
    a = 0;
    b = 0;
    c = 0;
    d = 0;
    int n;
    cin >> n;
    rep(i,n){
        string s;
        cin >> s;
        if(s == "AC") a++;
        else if(s == "WA") b++;
        else if(s == "TLE") c++;
        else if(s == "RE") d++;
    }
    cout << "AC x " << a << endl;
    cout << "WA x " << b << endl;
    cout << "TLE x " << c << endl;
    cout << "RE x " << d << endl;
}

Measured memory_bytes: 3628
//Code by : Abhishek Tiwari
//codechef.com/users/devil_within || hackerearth.com/@devil_within
#include<bits/stdc++.h>
#define fio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define int long long int 
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define mp make_pair
#define pb push_back
#define pf push_front
#define pii pair<int,int> 
#define ff first
#define ss second 
#define mod 1000000007
#define gcd __gcd
#define lcm(a,b) ((a)*(b))/gcd(a,b)
using namespace std;

/*******************************************************************************************/
/*******************************************************************************************/
template <typename T> ostream& operator<<(ostream& os, const vector<T>& v) { 
    os<<"["; for(int i=0;i<v.size()-1; ++i)os<<v[i]<<", ";os<<v[v.size()-1]<<"]\n"; return os; 
} 
template <typename T> ostream& operator<<(ostream& os, const set<T>& v) { 
    os<<"{"; for(auto it : v) { os<<it; if(it!=*v.rbegin()) os<<", "; } os<<"}\n"; 
    return os; 
}
template <typename T, typename S> ostream& operator<<(ostream& os, const map<T, S>& v) { 
    os<<"{"; for(auto it:v){ os<<"("<<it.first<<" : "<<it.second<<")"; if(it!=*v.rbegin()) os<<", "; } os<<"}\n"; 
    return os; 
}
template <typename T, typename S> ostream& operator<<(ostream& os, const pair<T, S>& v) { 
    os<<"("; os<<v.first<<", "<< v.second<<")"; 
    return os; 
} 
/*******************************************************************************************/
/*******************************************************************************************/
int fpow(int x, int y, int p); 


int32_t main()  
{
#ifndef ONLINE_JUDGE
//freopen("input.txt" , "r" , stdin);freopen("output.txt" , "w" , stdout);freopen("error.txt" , "w" , stderr);
#endif
fio;
int tcases = 1;
//cin>>testcases;
for(int tcase = 1 ; tcase <= tcases ; ++tcase)
{
    int n;
    cin>>n;
    vector<int> a(n+1) , b(n+1) , c(n+1);
    FOR(i , 1 , n+1) cin>>a[i]>>b[i]>>c[i];
    vector<int> dpa(n+1 , 0) , dpb(n+1 , 0) , dpc(n+1 , 0);
    for(int i = 1; i <= n;++i)
    {
        dpa[i] = a[i]+max( dpb[i-1] , dpc[i-1] );
        dpb[i] = b[i]+max( dpa[i-1] , dpc[i-1] );
        dpc[i] = c[i]+max( dpa[i-1] , dpb[i-1] );
    }    
    //cout<<dpa<<dpb<<dpc;
    cout<<max( dpa[n] , max( dpb[n] , dpc[n]));
    //cout<<"Case #"<<tcase<<": ";
}
return 0;
}



//Functions 

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


Measured memory_bytes: 4992
#include<stdio.h>
#include<stdlib.h>
#include<string.h>

#define ll long long
#define INF 1<<31-1
#define LNF 9223372036854775807
#define PI 3.14159265358979
#define MIN(x,y) ((x)<(y)?(x):(y))
#define MAX(x,y) ((x)<(y)?(y):(x))
#define FOR(i,a,n) for(i=a;i<n;i++)
#define MOD 1000000007
//#define MOD 998244353
#define NUM 200010
 
void swap(int* a,int* b){int tmp=*a;*a=*b;*b=tmp;}
int abs(int a){if(a<0)return -a;return a;}
int dup(int a,int d){if(a%d==0)return a/d;else return a/d+1;}
int mod(int a,int m){if(a<0)return a%m+m;else return a%m;}

void swapl(ll* a,ll* b){ll tmp=*a;*a=*b;*b=tmp;}
ll absl(ll a){if(a<0)return -a;return a;}
ll dupl(ll a,ll d){if(a%d==0)return a/d;else return a/d+1;}
ll modl(ll a,ll m){if(a<0)return a%m+m;else return a%m;}

ll GCD(ll a,ll b){ll c=1,tmp=MAX(a,b);b=MIN(a,b);a=tmp;while(c!=0){c=a%b;a=b;b=c;}return a;}
ll LCM(ll a,ll b){return a*b/GCD(a,b);}

ll factorial(ll n, ll m) {return n < m ? 1 : n*factorial(n-1, m);}

int upll(const void*a, const void*b){return*(ll*)a<*(ll*)b?-1:*(ll*)a>*(ll*)b?1:0;}
int downll(const void*a, const void*b){return*(ll*)a<*(ll*)b?1:*(ll*)a>*(ll*)b?-1:0;}
void sortup(ll*a,int n){qsort(a,n,sizeof(ll),upll);}
void sortdown(ll*a,int n){qsort(a,n,sizeof(ll),downll);}

//0 R 1 : G 2 : B
ll dp[3][4000];

int RGB2INT(char c){
    if (c == 'R') return 0;
    if(c == 'G') return 1;
    return 2;
}

int main(){
  ll N;
  ll sum=0;
  int ni, nj, nk, k;
  char S[5000];
  char RGB[3] = {'R', 'G', 'B'};
  
  scanf("%lld", &N);
  scanf("%s", S);
  
  dp[RGB2INT(S[N-1])][N-1]++;

  for (int i = N-2; i >= 0; i--)
  {
      dp[0][i] = dp[0][i+1];
      dp[1][i] = dp[1][i+1];
      dp[2][i] = dp[2][i+1];

      dp[RGB2INT(S[i])][i]++;
  }

  for (int i = 0; i < N; i++)
  {
      for (int j = i+1; j < N; j++)
      {
          if(S[i] == S[j]) continue;

          ni = RGB2INT(S[i]);
          nj = RGB2INT(S[j]);
          nk = 3 - ni -nj;

          sum += dp[nk][j];

          k = 2*j -i;
          if(k < N && S[k] == RGB[nk]) sum--;

      }
  }
  
  printf("%lld", sum);
  
  
  return 0;
}

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

int main() {
	int N,sum,bot;
	cin >> N;
	vector<int> an(N);
	bot=1;
	sum=1;
	
	for(int i=0; i<N;i++){
		cin >> an.at(i);
	}
	
	for(int j=0;j<100000;j++){
		bot = an.at(bot-1);
		if(bot == 2){
			cout << sum <<endl;
			break;
		}
		
		else{
			sum++;
		}
		
	}
	
	if (sum == 100001){
		cout << -1 << endl;
	}
	
	
}

Measured memory_bytes: 1148
s = input()
if s == 'MON':
  print(6)
elif s == 'TUE':
  print(5)
elif s == 'WED':
  print(4)
elif s == 'THU':
  print(3)
elif s == 'FRI':
  print(2)
elif s == 'SAT':
  print(1)
elif s == 'SUN':
  print(7)


Measured memory_bytes: 2940
#include <iostream>

using namespace std;

int main() {
    const int MAX_N = 50000, MAX_M = 20, INF = 50001;
    int n, m, c[MAX_M];
    cin >> n >> m;
    for (int i = 0; i < m; ++i) {
        cin >> c[i];
    }
    int dp[MAX_M + 1][MAX_N + 1];
    fill(dp[0], dp[0] + n + 1, INF);
    dp[0][0] = 0;
    for (int i = 0; i < m; ++i) {
        for (int j = 0; j <= n; ++j) {
            if (j >= c[i]) {
                dp[i + 1][j] = min(dp[i][j], dp[i + 1][j - c[i]] + 1);
            } else {
                dp[i + 1][j] = dp[i][j];
            }
        }
    }
    cout << dp[m][n] << endl;
    return 0;
}



Measured memory_bytes: 7208
#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
#include <string>
#include <functional>
#include <set>
#define DB cerr<<"D"<<endl
#define pb push_back
using namespace std; using ll=long long; using ld=long double; const int INF=1e9; const ll LINF=1e18; const double dINF = 1e18; const ld ldINF = 1e18; const double EPS = 1e-6;
template<typename T, typename U, typename O> void caut(T a, U b, O c){cout<<"("<<a<<","<<b<<","<<c<<") ";} template<typename T, typename U> void caut(T a, U b){cout<<"("<<a<<","<<b<<") ";} template<typename T> void caut(T a){cout<<"("<<a<<") ";}
using P=pair<double,int>;
const ll M = 998244353;
void add(ll& x, ll y) {x+=y; x%=M;}
void chmax(ll& x, ll y) {if (x<y) x=y;}
const int up[]={1,-1,0,0}, lf[]={0,0,1,-1};
bool vaild(int x, int y, int hh, int ww){return 0<=x&&x<hh&&0<=y&&y<ww;}

string s[400];
ll an=0, bl=0, wh=0, h, w;

void dfs(int x, int y) {
  bool bu = s[x][y]=='#';
  if (bu) bl++;
  else wh++;
  s[x][y]='z';

  for(int i=0;i<4;i++) {
    int nx = up[i] + x, ny = lf[i] + y;
    if (!vaild(nx,ny,h,w) || s[nx][ny] == 'z') continue;
    if (bu ^ s[nx][ny]=='#') {
      dfs(nx,ny);
    }
  }
}

int main() {
  cin>>h>>w;
  for(int i=0;i<h;i++) cin>>s[i];

  for(int i=0;i<h;i++) {
    for(int j=0;j<w;j++) {
      if (s[i][j]=='z') continue;
      bl=0,wh=0;
      dfs(i,j);
      an+=bl*wh;
    }
  }
  cout<<an<<endl;
}

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

signed main() {
    ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    int N;
    cin >> N;
    vector<int> L(N);
    for (int i = 0; i < N; i++) {
        cin >> L[i];
    }
    sort(L.begin(), L.end());
    int sum = 0;
    for (int i = 0; i < N - 2; i++) {
        for (int j = i + 1; j < N - 1; j++) {
            int v = L[i] + L[j];
            sum += max((int)(lower_bound(L.begin(), L.end(), v) - L.begin()) - j - 1, 0LL);
        }
    }
    cout << sum << endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstring>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <queue>
#include <stack>
#include <map>
#include <utility>
#include <set>

using namespace std;

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

int cnt[100005];

int main() {
    int N;
    scanf ("%d", &N);
    memset (cnt, 0, sizeof (cnt));
    int max_cnt = 0;
    for (int i = 0; i < N; ++i) {
        int x;
        scanf ("%d", &x);
        ++cnt[x]; ++cnt[x + 1]; ++cnt[x + 2];
        max_cnt = max(cnt[x], max(cnt[x + 1], max (cnt[x + 1], max_cnt)));
    }
    printf ("%d\n", max_cnt);
    return 0;
}


Measured memory_bytes: 640
#include <iostream>
#include <string>
#include <cstring>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <numeric>
#include <regex>
#include <climits>

#define FOR(i, f, n) for(int (i) = (f); (i) < (n); (i)++)
#define RFOR(i, f, n) for(int (i) = (f); (i) >= (n); (i)--)
#define REP(i, n) for(int (i) = 0; (i) < (n); (i)++)
#define RREP(i, n) for(int (i) = (n); (i) >= 0; (i)--)
#define rep(i, n) for(int (i) = 0; (i) < (n); (i)++)
#define rrep(i, n) for(int (i) = (n); (i) >= 0; (i)--)
#define forin(i, a) for(auto i: (a))
#define p(...) printf(__VA_ARGS__); cout << endl;
#define in(...) __VA_ARGS__; input__(__VA_ARGS__);
#define input(...) in(__VA_ARGS__)
#define out(...) output__(__VA_ARGS__);
#define output(...) out(__VA_ARGS__)
#define list_input(x, n) x[(n)]; for(int (i) = 0; (i) < (n); (i)++) cin >> x[i];
#define lambda(a, b, c) [](auto const &a, auto const &b){ return c ;}
#define key(t, x, compare) [](const t &a, const t &b){ return a x compare b x ;}
#define unless(a) if(!(a))

using namespace std;

using pii = pair<int, int>;

template <class... T>
void input__(T &...a) {
  for(auto v: {&a...}) {
    cin >> *v;
  }
}

void output__(){
  cout << endl;
}

template <class Head, class... T>
void output__(Head const &v, T const &...a) {
  if(sizeof...(a) == 0) {
    cout << v;
  } else {
    cout << v << " ";
  }
  output__(a...);
}

int main(){
  int in(n);
  int list_input(a, n);
  vector<int> tmp(a, a + n);
  sort(tmp.begin(), tmp.end());
  int low = tmp[n / 2 - 1];
  int high = tmp[n / 2];
  forin(v, a) {
    if(v <= low) {
       out(high);
    } else {
      out(low);
    }
  }
}


Measured memory_bytes: 3712
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <cmath>
#include <stack>
#include <queue>
#include <functional>
#include <set>
#include <map>
#include <tuple>
#include <bitset>
#include <random>
#define REP(i,n) for(int i=0;i<n;i++)
#define INF 100000000000007
using namespace std;
using pii=pair<int,int>;
using LL=int64_t;



vector<pair<int64_t, int64_t>> fs;//素因数分解の素数，指数のペア
 
void prime_factorize(LL N){
   vector<pair<LL, LL>> res;
   for (LL a = 2; a * a <= N;a++) {
	   if(N % a != 0) continue;
	   LL ex = 0; //指数
 
	   //割れる限り割り続ける
	   while (N % a == 0) {
		   ++ex;
		   N /= a;
	   }
 
	   res.push_back(make_pair(a, ex));
   }
 
   //最後に残った数について
   if ( N != 1) res.push_back(make_pair(N, 1));
   fs = res;
}
	
void factorization(int64_t base){//baseを素因数分解
    //base未満のiが約数か
    for(int i=2;i*i<=base;i++){
        //iで割り切れるなら限界まで割る
        
        if(base%i==0){
            int cnt=0;
            while(base%i==0){
                base/=i;
                cnt++;
            }
            fs.push_back(make_pair(i,cnt));
        }
    }
    //baseが素数
    if(base>1){
        fs.push_back(make_pair(base,1));
    }
}
int main(){
    int64_t n;
    cin>>n;
    
    
    //factorization(n);
    prime_factorize(n);
    int64_t ans=0;
    for(auto p : fs){
        int64_t e;
        e=p.second;
        int k=1;
        while(e-k>=0){
            e-=k;
            k++;
            ans++;
        }
    }

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

Measured memory_bytes: 3184
package main

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

var a, b, c int

func main() {
	readVariables()
	comp := 4*a*b < (c-a-b)*(c-a-b)
	notNegative := c-a-b >= 0
	if comp && notNegative {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}

func readVariables() {
	a, b, c = nextInt(), nextInt(), nextInt()
}

/* Template */

var scanner *bufio.Scanner

func init() {
	Max := 1001001
	scanner = bufio.NewScanner(os.Stdin)
	scanner.Buffer(make([]byte, 0, Max), Max)
	scanner.Split(bufio.ScanWords)
}

//nextInt converts next token from stdin and returns integer value.
//nextInt panics when conversion into an integer fails.
func nextInt() int {
	if !scanner.Scan() {
		panic("No more token.")
	}
	num, err := strconv.Atoi(scanner.Text())
	if err != nil {
		panic("nextInt(): cannot convert to int: " + scanner.Text())
	}
	return num
}

func nextStr() string {
	if !scanner.Scan() {
		panic("No more token.")
	}
	return scanner.Text()
}

// MinInt returns minimum argument
func MinInt(x, y int) int {
	if x < y {
		return x
	} else {
		return y
	}
}

//MaxInt returns maximum argument
func MaxInt(x, y int) int {
	if x < y {
		return y
	} else {
		return x
	}
}

//AbsInt returns |x| for x
func AbsInt(x int) int {
	if x < 0 {
		return -x
	}
	return x
}

//ModPow calculates integer power with modulo operation
//if modulo <= 1, it powers w/o module operation
//if base < 0, return value might be negative too.
func ModPow(base, exponent, modulo int) (result int) {
	result = 1
	for exponent > 0 {
		if exponent%2 == 1 {
			result *= base
			if modulo > 1 {
				result %= modulo
			}
		}
		base *= base
		if modulo > 1 {
			base %= modulo
		}
		exponent /= 2
	}
	return
}

//Gcd
func Gcd(vals ...int) (result int) {
	if len(vals) == 0 {
		return
	}
	result = vals[0]
	for i := 1; i < len(vals); i++ {
		result = gcd(result, vals[i])
	}
	return
}

func gcd(x, y int) int {
	x, y = AbsInt(x), AbsInt(y)
	for y > 0 {
		x, y = y, x%y
	}
	return x
}

//Lcm
func Lcm(vals ...int) (result int) {
	if len(vals) == 0 {
		return
	}
	result = vals[0]
	for i := 1; i < len(vals); i++ {
		result = lcm(result, vals[i])
	}
	return
}

func lcm(x, y int) int {
	return x * y / gcd(x, y)
}


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

using namespace std;

#define rep(i, n) for (int i = 0; i < (int)n; ++i)
#define REP(i, a, b) for (int i = (int)a; i < (int)b; ++i)
#define each(i,c) for(__typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
#define all(v) v.begin(), v.end()
#define mset(a, n) memset(a, n, sizeof(a))

typedef long long ll;
typedef tuple<string, int, int> tpl;

const int INF = 1000000000;
const int MOD = 1000000007;

bool tpl_comp(const tpl &l, const tpl &r) {
    if (get<0>(l) != get<0>(r)) return get<0>(l) < get<0>(r);
    else if (get<1>(l) != get<1>(r)) return get<1>(l) > get<1>(r);
    else return get<2>(l) < get<2>(r);
}

int main () {
    int N; cin >> N;
    vector<tpl> r(N);
    rep(i, N) {
        string S;
        int P;
        cin >> S >> P;
        r[i] = make_tuple(S, P, i+1);
    }

    sort(all(r), tpl_comp);
    rep(i, N) cout << get<2>(r[i]) << endl;
}


Measured memory_bytes: 256
//  Created by conan1024hao in 2019.
//  Copyright © 2019 conan1024hao. All rights reserved.
//  専用ライブラリです、自由にコピーして構いません。
//  感谢看我的代码！Wechat:conan1024hao QQ:810396815
#pragma GCC optimize ("O3")
#include <iostream>
#include <iomanip>
#include <istream>
#include <ostream>
#include <sstream>
#include <iterator>
#include <vector>
#include <algorithm>
#include <queue>
#include <deque>
#include <list>
#include <stack>
#include <map>
#include <set>
#include <utility>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <string>
#include <ctime>
#include <cctype>
#include <cstdlib>
#define INF 10e16
#define MOD 1000000007
#define rep(i, a, n) for (ll i = a; i < (ll)(n); i++)
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define mmax(x,y)(x>y?x:y)
#define mmin(x,y)(x<y?x:y)
#define chmax(x,y) x=mmax(x,y)
#define chmin(x,y) x=mmin(x,y)
#define all(x) (x).begin(),(x).end()
#define siz(x) (ll)(x).size()
#define PI acos(-1.0)
using namespace std;
//using Int=int_fast64_t;
typedef long long int ll;
typedef pair<ll,ll>Pll;
typedef pair<int,int>Pin;
long long GCD(long long a, long long b) { return b ? GCD(b, a%b) : a; }
long long LCM(long long a, long long b)  {return a/GCD(a,b)*b;}
int dx[8]={-1,0,1,0,1,1,-1,-1};
int dy[8]={0,-1,0,1,1,-1,1,-1};
char dir[4]={'u','l','d','r'};
ll cmp1(pair<ll,string>a,pair<ll,string> b){
        if(a.fi!=b.fi)
        return a.fi<b.fi;
        else
        return a.se<b.se;
}
//--------------------------------------------------------------------------
int n;double ans=0;
int cnt=0;
void dfs(double t,int m1,int m2,int m3){
    if(m1==0&&m2==0&&m3==0){
        ans+=t;
        cnt++;
        return;
    }
    t+=(double)n/(m1+m2+m3);
    //cout<<t<<endl;
    
   
        if(m1)
        dfs(t,m1-1,m2,m3);
        if(m2)
        dfs(t,m1+1,m2-1,m3);
        if(m3)
        dfs(t,m1,m2+1,m3-1);
    
}
//---------------------------------------------------------------------------
int main(){//問題をちゃんと見ろ!!!!!!!!!!!!!!!!!      llか??????????        memset()!!!!!!!!!!!!
    cin.tie(0);
    ios::sync_with_stdio(false);
    //-------------------------------
    ll n;cin>>n;
    vector<ll>a(n);for(int i=0;i<n;i++)cin>>a[i];
    vector<ll>b(n);for(int i=0;i<n;i++)cin>>b[i];
    vector<ll>c(n);for(int i=0;i<n;i++)cin>>c[i];
    sort(all(a));sort(all(b));sort(all(c));
    ll ans=0;
    ll cob[100001];
    ll sb[100001];
    memset(cob,0,sizeof(cob));
    memset(sb,0,sizeof(sb));
    int nc=0;
    for(int i=0;i<n;i++){
            while(c[nc]<=b[i]&&nc<n)
                nc++;
            cob[i]=n-nc;
            if(nc==n-1&&c[nc]<=b[i])
                cob[i]=0;
    }
    sb[n-1]=cob[n-1];
    for(int i=n-2;i>=0;i--){
        sb[i]=sb[i+1]+cob[i];
    }
 
    vector<ll>::iterator nowb=b.begin();
    for(int i=0;i<n;i++){
        auto m=upper_bound(nowb,b.end(),a[i]);
        ans+=sb[m-b.begin()];
        nowb=m;
    }
    cout<<ans<<endl;
    //-------------------------------
    return 0;
}
//---------------------------------------------------------------------------


Measured memory_bytes: 4224
N = int(input())
A = list(map(int, input().split()))

m = 1000
s = 0
for i in range(N):
    if i == N-1 or A[i] > A[i+1]: 
        m += s * A[i]
        s = 0
    elif A[i] < A[i+1]:
        x = m // A[i]
        s += x
        m -= x * A[i]
print(m)

Measured memory_bytes: 62052
N,K = map(int,input().split())
S = input()
l = [1]
for i in range(N-1):
    if S[i] == S[i+1]:
        l[-1] += 1
    else:
        l.append(1)
if S[0] == "0":
    l = [0] + l
if S[-1] == "0":
    l += [0]
s = [0]
for i in range(len(l)):
    s.append(s[-1]+l[i])
if len(l) <= 2*K + 1:
    print(s[-1])
else:
    cnt = 0
    for i in range((len(l)-2*K-1)//2+1):
        cnt = max(cnt,s[2*K+2*i+1]-s[2*i])
    print(cnt)

Measured memory_bytes: 8548
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>

using namespace std;

main()
{
    int n; cin>>n;
    vector<int> cnt(n);
    for(int i=1; i<n; ++i)
    {
        int x; cin>>x; --x;
        cnt[x]++;
    }
    for(int i:cnt) cout << i << "\n";
}

Measured memory_bytes: 4048
#define __USE_MINGW_ANSI_STDIO 0
#include <bits/stdc++.h>
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl '\n'
#define ff first
#define ss second
#define mod 1000000007
#define pb push_back
#define mp make_pair
#define int long long
#define all(a) a.begin(), a.end()
#define ull unsigned long long
#define inf 10000000000000000
#define debug1(x) cerr << #x << ": " << x <<'\n'
#define debug2(x, y) cerr << #x << ": " << x << '\t' << #y << ": " << y <<'\n'
#define debug3(x, y, z) cerr << #x << ": " << x << '\t' << #y << ": " << y << '\t' << #z << ": " << z <<'\n'
using namespace std;
int dx[]={1,0,-1,0};int dy[]={0,1,0,-1}; //4 Direction
//int dx[]={1,1,0,-1,-1,-1,0,1};int dy[]={0,1,1,1,0,-1,-1,-1};//8 direction
int gcd(int x,int y)
{
    if(y==0)
        return x;
    else
        return gcd(y,x%y);
}
int expo(int n,int m,int p)   //modULAR EXPONENTIATION
{
    int r=1;
    n=n%p;
    while(m>0)
    {
        if(m%2)
            r=(r*n)%p;
        n=(n*n)%p;
        m=m/2;
    }
    return r%p;
}
bool isPrime(int n)
{
    // Corner cases
    if (n <= 1)  return false;
    if (n <= 3)  return true;
 
    // This is checked so that we can skip 
    // middle five numbers in below loop
    if (n%2 == 0 || n%3 == 0) return false;
 
    for (int i=5; i*i<=n; i=i+6)
        if (n%i == 0 || n%(i+2) == 0)
           return false;
 
    return true;
}
int32_t main()
{
   IOS;
   /*#ifndef ONLINE_JUDGE
   freopen("input.txt","r",stdin); 
   freopen("output.txt","w",stdout);
   #endif
   /********************* Code starts here ************************/
   int x,y;
   cin>>x>>y;
   int g=gcd(x,y);
   if(g!=y)
   {
   	cout<<x;
   }
   else
   {
   	cout<<-1;
   }
}     	

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include<queue>
typedef long long ll;
using namespace std;
#define ALL(v) (v).begin(), (v).end()
bool compare_by_b(pair<int, int> a, pair<int, int> b) {
    if(a.second != b.second){
        return a.second < b.second;
    }else{
        return a.first < b.first;
    }
}
int main(){
    int n,m; cin >> n >> m;
    vector<pair<int,int>> p(m);
    priority_queue<int> pq;   
    int a[n];
    for(int i=0;i<n;i++){ cin >> a[i]; pq.push(a[i]); }

    int b[m],c[m];   
    for(int i=0;i<m;i++){
        cin >> b[i] >> c[i];
        p[i] = make_pair(b[i],-c[i]);
    }
    sort(ALL(p), compare_by_b);
    for(int i=0;i<m;i++){
        for(int j=0;j<p[i].first;j++){
            if(pq.size() > 2*n) break;
            pq.push(-p[i].second);
        }
        if(pq.size() > 2*n) break;
    }
    ll ans =0;
    for(int i=0;i<n;i++){
        ans += pq.top(); pq.pop();
    }
    cout << ans;
    return 0;
}




Measured memory_bytes: 3320
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
typedef long long ll;
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define REP(i,a) FOR(i,0,a)
using namespace std;
const ll MAX_N=50;
ll N,K,V[MAX_N];
int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	cin>>N>>K;
	REP(i,N)cin>>V[i];
	ll ans=0;
	REP(i,min(K+1,N+1))REP(j,min(K-i+1,N-i+1)){
		ll rem=K-i-j,sm=0;
		vector<ll> vec;
		REP(k,i){
			sm+=V[k];
			if(V[k]<0){
				vec.push_back(V[k]);
			}
		}
		REP(k,j){
			sm+=V[N-k-1];
			if(V[N-k-1]<0){
				vec.push_back(V[N-k-1]);
			}
		}
		sort(vec.begin(),vec.end());
		REP(k,min(rem,(ll)vec.size())){
			sm-=vec[k];
		}
		ans=max(ans,sm);
//		cout<<"debug:"<<i<<' '<<j<<' '<<sm<<endl;
	}
	cout<<ans<<endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(){

int N;
cin >> N;

vector<int> table(N);
for (int i = 0; i < N; i++){
    cin >> table.at(i);
}

int ans = 0;

for (int i = 0; i < N; i++){
    if((i + 1) % 2 == 1 && table.at(i) % 2 == 1){
        ans++;
    }
}

cout << ans << endl;

return 0;
}

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

#define ff              first
#define ss              second
#define int             long long
#define pb              push_back
#define mp              make_pair
#define pii             pair<int,int>
#define vi              vector<int>
#define mii             map<int,int>
#define pqb             priority_queue<int>
#define pqs             priority_queue<int,vi,greater<int> >
#define setbits(x)      __builtin_popcountll(x)
#define zrobits(x)      __builtin_ctzll(x)
#define mod             1000000007
#define inf             1e18
#define ps(x,y)         fixed<<setprecision(y)<<x
#define mk(arr,n,type)  type *arr=new type[n];
#define w(x)            int x; cin>>x; while(x--)


void aryan_p() {
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	return;
}


int32_t main() {


	int n, m;
	cin >> n >> m;

	priority_queue<int> pq;

	for (int i = 0 ; i < n ; i++) {
		int k ;
		cin >> k;
		pq.push(k);
	}
	int cost = 0 ;
	while (m--) {
		int v = pq.top();
		v /= 2;
		pq.pop();
		pq.push(v);
	}
	for (int i = 0 ; i < n ; i++) {
		cost += pq.top();
		pq.pop();
	}
	cout << cost;

	return 0;
}

Measured memory_bytes: 4292
#include <iostream>
#include <string>
#include <cstdlib>
#include <vector>
#include <algorithm>
using namespace std;

int main(){
   int N, D, X, k, d, total;
   cin >> N >> D >> X;
   vector<int> A(N);
   for(int i = 0; i < N ; i++){
       cin >> A.at(i);
   }

   for(int i = 0; i < N; i++){
       total++;
       k = A.at(i) + 1;
       d = 2;
       while(k <= D){
           k = d * (A.at(i)) + 1;
           d++;
           total++;
       }
   }
   
   cout << total + X << endl;
}


Measured memory_bytes: 256
#include<iostream>
#include<iomanip>
#include<cstdio>

#include<vector>
#include<queue>
#include<set>
#include<map>
#include<string>

#include<algorithm>
#include<cmath>
#include<numeric>

using namespace std;
typedef long long ll;
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;}


/*
vkからvk+1が増加したときはそのまま加速していけばよいのだが、
減少したときには、予め減速していなければならない
*/

int main() {
    int N; cin >> N;
    vector<int> t(N+2,0), v(N+2,0);
    for (int i = 1; i <= N; i++) scanf("%d", &t[i]);
    for (int i = 1; i <= N; i++) scanf("%d", &v[i]); N += 2; 
    int T = 0;
    for (int i = 0; i < N; i++) T += t[i];
    
    
    vector<double> b(2*T+1,1e8);

    int s = 0, e = 0;
    for (int i = 0; i < N; i++) {
        int e = s + 2*t[i];
        for (int j = s; j <= e; j++) chmin(b[j],(double)v[i]);
        for (int j = s; j >= 0; j--) chmin(b[j],(double)v[i]+(s-j)/2.0);
        for (int j = e; j <= 2*T; j++) chmin(b[j],(double)v[i]+(j-e)/2.0);
        s += 2*t[i];
    }

    //for (int i = 0; i <= 2*T; i++) cout << b[i] << " ";
    
    
    double res = 0;
    for (int i = 0; i < 2*T; i++) {
        res += (b[i]+b[i+1])/4.0; 
    }
    printf("%.2lf\n", res);


}


Measured memory_bytes: 512
class ScoreBoard:
    def __init__(self, n, k):
        self.answerd = [0 for i in range(n)]
        self.init_score = k
        self.num_questions = 0

    def answer(self, i):
        ai = i - 1
        self.answerd[ai] += 1
        self.num_questions += 1

    def calc_score(self, i):
        answerd = self.answerd[i]
        return self.init_score - self.num_questions + answerd

    def isWon(self, i):
        return self.calc_score(i) > 0


def main():
    n, k, q = (int(i) for i in input().split(' '))

    score_board = ScoreBoard(n, k)

    for i in range(q):
        ai = int(input())
        score_board.answer(ai)

    for i in range(n):
        if score_board.isWon(i):
            print("Yes")
        else:
            print("No")


if __name__ == "__main__":
    main()


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

using namespace std;
typedef long long ll;
//typedef unsigned long long ll;

//#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rep(i, n) for (ll i = 0; i < (n); ++i)
//#define sz(x) ll(x.size())
//typedef pair<ll, int> P;
typedef pair<ll, ll> P;
//const double INF = 1e10;
const ll INF = LONG_LONG_MAX / 100;
//const ll INF = 1e15;
const ll MINF = LONG_LONG_MIN;
//const int INF = INT_MAX / 10;
#define cmin(x, y) x = min(x, y)
#define cmax(x, y) x = max(x, y)

bool contain(set<char> &s, int a) { return s.find(a) != s.end(); }

//ifstream myfile("C:\\Users\\riku\\Downloads\\0_00.txt");
//ofstream outfile("log.txt");
//outfile << setw(6) << setfill('0') << prefecture << setw(6) << setfill('0') << rank << endl;
// std::cout << std::bitset<8>(9);
void print_line(vector<int> &line) {
    for (int i = 0; i < line.size(); i++) {
        cout << line[i];
        if (i == line.size() - 1) cout << endl;
        else cout << ' ';
    }
}

typedef priority_queue<long long, vector<long long>, greater<long long> > PQ_ASK;
const int mod = 1000000007;

int main() {

    int n;
    cin >> n;
    vector<int> a(n);
    rep(i, n) cin >> a[i];
    print_line(a);
    for (int i = 1; i <= n - 1; i++) {
        int v = a[i];
        int j = i - 1;
        for (; j >= 0 && a[j] > v; j--) {
            a[j + 1] = a[j];
        }
        a[j + 1] = v;
        print_line(a);
    }


}



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

using namespace std;
typedef long long ll;
const int N=55;
const int dir[4][2]= {0,1,1,0,0,-1,-1,0};

char a[N][N];
int cnt;
int n,m;
int main()
{
    while(~scanf("%d %d",&n,&m))
    {
        for(int i=0; i<n; i++)
        {
            scanf("%s",a[i]);
        }
       /* for(int i=0; i<n; i++)
        {
            printf("%s\n",a[i]);
            // scanf("%s",a);
        }*/
        bool flag=0;
        bool flag2=0,flag3=0;
        for(int i=0; i<n; i++)
        {
            for(int j=0; j<m; j++)
            {
                if(a[i][j]=='#')
                {
                    flag=0;
                    bool flag5=0;
                    for(int k=0; k<4; k++)
                    {
                        int nx=i+dir[k][0];
                        int ny=j+dir[k][1];
                        if(nx>=0&&nx<n&&ny>=0&&ny<m)
                        {
                            if(a[nx][ny]=='#')
                            {
                                flag=1;
                                break;
                            }
                            else flag5=1;
                        }
                    }
                    if(!flag&&flag5)
                    {
                        puts("No");
                        flag2=1;
                        break;
                    }
                }
            }
            if(flag2)
            {
                break;
            }
        }
        //printf("flag2=%d\n",flag2);
        if(!flag2) puts("Yes");
    }
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <map>
#include <cstring>
using namespace std;
#define mk make_pair

int main(){
	map<char, string> former;
	former['A'] = "00000";
	former['B'] = "00001";
	former['C'] = "00010";
	former['D'] = "00011";
	former['E'] = "00100";
	former['F'] = "00101";
	former['G'] = "00110";
	former['H'] = "00111";
	former['I'] = "01000";
	former['J'] = "01001";
	former['K'] = "01010";
	former['L'] = "01011";
	former['M'] = "01100";
	former['N'] = "01101";
	former['O'] = "01110";
	former['P'] = "01111";
	former['Q'] = "10000";
	former['R'] = "10001";
	former['S'] = "10010";
	former['T'] = "10011";
	former['U'] = "10100";
	former['V'] = "10101";
	former['W'] = "10110";
	former['X'] = "10111";
	former['Y'] = "11000";
	former['Z'] = "11001";
	former[' '] = "11010";
	former['.'] = "11011";
	former[','] = "11100";
	former['-'] = "11101";
	former['\''] = "11110";
	former['?'] = "11111";

	map<string, char> later;
	later["101"] 		= ' ';
	later["000000"] = '\'';
	later["000011"] = ',';
	later["10010001"] = '-';
	later["010001"] = '.';
	later["000001"] = '?';
	later["100101"] = 'A';
	later["10011010"] = 'B';
	later["0101"] = 'C';
	later["0001"] = 'D';
	later["110"] = 'E';
	later["01001"] = 'F';
	later["10011011"] = 'G';
	later["010000"] = 'H';
	later["0111"] = 'I';
	later["10011000"] = 'J';
	later["0110"] = 'K';
	later["00100"] = 'L';
	later["10011001"] = 'M';
	later["10011110"] = 'N';
	later["00101"] = 'O';
	later["111"] = 'P';
	later["10011111"] = 'Q';
	later["1000"] = 'R';
	later["00110"] = 'S';
	later["00111"] = 'T';
	later["10011100"]= 'U';
	later["10011101"] = 'V';
	later["000010"] = 'W';
	later["10010010"] = 'X';
	later["10010011"] = 'Y';
	later["10010000"] = 'Z';

	string s;
	while( getline(cin, s) ){
		string ans = "";
		for( int i = 0; i < s.size(); i++ ){
			ans += former[s[i]];
		}

		s = ans;
		ans = "";
		for( int i = 0; i < s.size(); i++ ){
			for( int j = 1; i+j <= s.size(); j++ ){
				if( later.find(s.substr(i,j)) == later.end() ) continue;
				ans += later[s.substr(i,j)];
				i = i+j-1;
				break;
			}
		}
		cout << ans << endl;
	}
}

Measured memory_bytes: 1204
#include<stdio.h>
#include<math.h>

int main(void){

int n,i,x[100],y[100];
double a=0,b=0,c=0,d,e;
double max = -1000000;

scanf("%d",&n);

for(i = 0; i<n; i++){
  scanf("%d",&x[i]);
}
for(i = 0; i<n; i++){
  scanf("%d",&y[i]);
}

for(i=0;i<n;i++){
a += abs(x[i]-y[i]);
b += (x[i]-y[i])*(x[i]-y[i]);
c += abs((x[i]-y[i])*(x[i]-y[i])*(x[i]-y[i]));
if(max < abs(x[i]-y[i])) max=abs(x[i]-y[i]);
}

d=sqrt(b);
e=cbrt(c);

printf("%.6lf\n",a);
printf("%.6lf\n",d);
printf("%.6lf\n",e);
printf("%.6lf\n",max);
return 0;
}


Measured memory_bytes: 2104
import java.util.Scanner;

class Main {
    public static void main(String[] args) {
        Scanner stdIn = new Scanner(System.in);
        int a = Integer.parseInt(stdIn.next());
        int b = Integer.parseInt(stdIn.next());
        int c = Integer.parseInt(stdIn.next());

        if (a != b && b == c && c != a) {
            System.out.println("Yes");
        } else if (a != b && b != c && c == a) {
            System.out.println("Yes");
        } else if (a == b && b != c && c != a) {
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }
    }
}

Measured memory_bytes: 22996
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <string>
#include <cmath>
#include <stack>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <list>
#include <iostream>
#include <sstream>
#include <climits>
#include <cfloat>
#include <complex>

using namespace std;

int main()
{
	int n;
	while (scanf("%d", &n), ~n)
	{
		stack<char> d;
		do
		{
			d.push('0' + n % 4);
			n /= 4;
		} while (n);
		for (; !d.empty(); d.pop())
			putchar(d.top());
		putchar('\n');
	}

	return 0;
}

Measured memory_bytes: 0
// यथा चतुर्भिः कनकं परीक्ष्यते निघर्षणच्छेदनतापताडनैः।
// तथा चतुर्भिः पुरुषः परीक्ष्यते त्यागेन शीलेन गुणेन कर्मणा॥
#include <bits/stdc++.h>
using namespace std;
#define lld long long int
#define M 1000000007
#define fors(i,n) for(int i=0;i<n;++i)
#define fore(i,a,b) for(int i=a;i<=b;++i)
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define vv std::vector<int>
#define mapii std::map<int,int>
#define mpaci std::map<char,int>
#define umapii std::unordered_map<int,int>
#define umapci std::unordered_map<char,int>
#define seti std::set<int>
#define useti std::unordered_set<int>
#define qi std::queue<int>
#define qc std::queue<char>
#define sti std::stack<int>
#define stc std::stack<char>
#define endl "\n"
#define test(i) cout<<i<<endl
#define tests(i) cout<<"i: "<<i<<endl;
#define itrt int t; cin>>t; fors(i,t)
#define itr1 int t; cin>>t;
#define ff first
#define ss second
#define pb push_back
#define vmp make_pair
#define ppb pop_back
#define sorta(a,n) sort(arr,arr+n)
#define sortv(x) sort(x.begin(),x.end())
#define all(x) x.begin(),x.end() 
#define printv(v) for(auto x: v){ cout<< x << " ";}
#define pi 3.14159265358979323846
#define setprc(x) setprecision(x)
void file(){
    #ifdef LOCAL
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif
}
bool sortdesk(const pair<int,int> &a, const pair<int,int> &b){return a.ff>b.ff;}
bool sortdesv(const pair<int,int> &a, const pair<int,int> &b){return a.ss>b.ss;}
bool sortascv(const pair<int,int> &a, const pair<int,int> &b){return a.ss<b.ss;}
bool sortasck(const pair<int,int> &a, const pair<int,int> &b){return a.ff<b.ff;}
bool is_prime(int n){if(n==1){return false;}int i=2;while(i*i<=n){if(n%i==0){return false;}i+=1;}return true;}
int gcd(int a, int b){if (b == 0){return a;} return gcd(b, a % b);}
int cntdiv(int n){int cnt=0;for(int i=1;i<=sqrt(n);++i){if(n%i==0){if(n/i==i)++cnt;else{cnt = cnt + 2;}}}return cnt;}
lld posnegmod(lld x,lld mod){return (x%mod+mod)%mod;}
// cout<<fixed<<setprecision(20)
// lld fact(lld n);
// lld nCr(lld n,lld r){return fact(n) / (fact(r) * fact(n - r));}
// lld fact(lld n){ lld res = 1; for(lld i = 2; i <= n; i++){res = res * i;}return res;} 
// const int maxi = 1e6+10;
// vector<int> v[maxi];
// long long a[maxi];
// void dfs(int x,int y){
//     a[x]+=a[y];
//     for(int i:v[x]){
//         if(i!=y){
//             dfs(i,x);
//         }
//     }
// }

void test_case(){
    int a,b,c,d;
    cin>>a>>b>>c>>d;
    while(true) {
        c -= b;
        if (c <= 0) {
            cout << "Yes" << endl;
            return;
        }
        a -= d;
        if (a <= 0) {
            cout << "No" << endl;
            return;
        }
    }
}

int main(){
    fastio;
    file();
    int T=1;
    // int T;
    // cin>>T;
    for(int nr=1;nr<=T;++nr) {
        // cout<<"Case #"<<nr<<": ";
        test_case();
    }
}

Measured memory_bytes: 3672
#include<iostream>
#include<vector>
#include<string>
using namespace std;
int main(){

  string w;
  cin>>w;
  int chardata[26]={};
  for(int i=0;i<=w.length()-1;i++){
  
    if(w[i]=='a')chardata[0]++;
    else if(w[i]=='b')chardata[1]++;
    else if(w[i]=='c')chardata[2]++;
    else if(w[i]=='d')chardata[3]++;
    else if(w[i]=='e')chardata[4]++;
    else if(w[i]=='f')chardata[5]++;
    else if(w[i]=='g')chardata[6]++;
    else if(w[i]=='h')chardata[7]++;
    else if(w[i]=='i')chardata[8]++;
    else if(w[i]=='j')chardata[9]++;
    else if(w[i]=='k')chardata[10]++;
    else if(w[i]=='l')chardata[11]++;
    else if(w[i]=='m')chardata[12]++;
    else if(w[i]=='n')chardata[13]++;
    else if(w[i]=='o')chardata[14]++;
    else if(w[i]=='p')chardata[15]++;
    else if(w[i]=='q')chardata[16]++;
    else if(w[i]=='r')chardata[17]++;
    else if(w[i]=='s')chardata[18]++;
    else if(w[i]=='t')chardata[19]++;
    else if(w[i]=='u')chardata[20]++;
    else if(w[i]=='v')chardata[21]++;
    else if(w[i]=='w')chardata[22]++;
    else if(w[i]=='x')chardata[23]++;
    else if(w[i]=='y')chardata[24]++;
    else if(w[i]=='z')chardata[25]++;
  }
  bool flag=1;
  for(int i=0;i<=25;i++){
  
    if(chardata[i]%2==1){
    
      flag=0;
      break;
    }
  }
  if(flag==1)cout<<"Yes";
  else cout<<"No";
  return 0;
}

Measured memory_bytes: 3628
#include <bits/stdc++.h>
#define exrep(i, a, b) for(long long i = a; i <= b; i++)
#define rep(i,n)for(long long i=0;i<(long long)(n);i++)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> P;
typedef vector<ll> vl;
typedef vector<string> vs;
typedef vector<P> vp;
typedef vector<vector<ll> > vvl;
typedef vector<vector<P> > vvp;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
 
const ll MOD=1e9+7;
const ll INF=1e18;
const int MAX=510000;
const double pi=acos(-1);
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};

int h,w;
char f[410][410];
bool used[410][410];
ll black=0,white=0;

void dfs(int y,int x){
  used[y][x]=true;
  if(f[y][x]=='#')black++;
  else white++;
  
  rep(i,4){
    int ny=y+dy[i],nx=x+dx[i];
    if(ny<0 || h<=ny || nx<0 || w<=nx)continue;
    if(used[ny][nx])continue;
    if(f[y][x]==f[ny][nx])continue;
    dfs(ny,nx);
  }
}
  
int main(){
  cin.tie(0);
  ios::sync_with_stdio(false); 
  
  cin >> h >> w;
  rep(i,h){
    rep(j,w){
      cin >> f[i][j];
      used[i][j]=false;
    }
  }
  
  ll ans=0;
  rep(i,h){
    rep(j,w){
      if(used[i][j] && f[i][j]=='.')continue;
      black=0,white=0;
      dfs(i,j);
      ans+=black*white;
    }
  }
  
  cout << ans << endl;
  return 0;     
}


Measured memory_bytes: 8064
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
#include <queue>
#include <set>
#include <map>
using namespace std;

#define MAX(a,b) ((a)>(b)?(a):(b))
#define MIN(a,b) ((a)<(b)?(a):(b))
#define ABS(a) ((a)>(0)?(a):-(a))
#define rep(i,a,b) for(int (i)=int(a);(i)<int(b);(i)++)
#define rrep(i,a,b) for(int (i)=int(a);(i)>=int(b);(i)--)

#define put(a) cout << (a) << endl
#define puts(a) cout << (a) << " "

#define llint long long int

#define INF (long long)1e9+1
#define MOD (long long)1e9+7
#define INF64 (long long)1e18+1

#define F first
#define S second

#define Pii  pair<int,int>
#define Pll  pair<long long,long long>
#define Piii pair<int,pair<int,int>>
#define Plll pair<long long,pair<long long,long long>>

#define Vll(a,b,c)    vector<vector<long long>> (a)((b),vector<long long>((c))
#define Vlll(a,b,c,d) vector<vector<vector<long long>>> (a)((b),vector<vector<long long>>((c),vector<long long>((d)))

#define MAX_N 1000000

int main (void)
{
  //INPUT
  llint M,D;
  cin >> M >> D;

  //SOLVE
  llint ans=0;
  llint day;
  llint mon;
  llint buf;
  for(mon=1;mon<=M;mon++) {
    for(day=1;day<=D;day++) {
      if ((day%10) >= 2) {
        if ((day/10) >= 2) {
          buf = (day%10) * (day/10);
          if (mon == buf) ans++;
        }
      }
    }
  }

  //OUTPUT
  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <iostream>
#include <cassert>
#include <vector>

using namespace std;

#define rep(i, a, b) for (auto i = (a); i < (b); ++i)
#define per(i, a, b) for (auto i = (b) - 1; i >= (a); --i)
#define trav(x, v) for (auto &x : v)

#define sz(x) int((x).size())
#define eb(x...) emplace_back(x)
#define ff first
#define ss second

using ll = int64_t;

const int M = 1e9 + 7;

template<class T> bool ckmin(T& a, const T& b) { return a > b ? a = b, 1 : 0; }
template<class T> bool ckmax(T& a, const T& b) { return a < b ? a = b, 1 : 0; }

using vi = vector<int>;
using vvi = vector<vi>;

signed main() {
	ios::sync_with_stdio(false);
	cin.tie(nullptr);

	int n; cin >> n; vi f(n), s(n + 1);
	string x; cin >> x;
	f[0] = 1;
	rep(i, 0, n - 1) {
		vi g(n);
		rep(j, 0, i + 2) s[j + 1] = (s[j] + f[j]) % M;
		if (x[i] == '<')
			rep(j, 0, i + 2) g[j] = s[j];
		else
			rep(j, 0, i + 2) g[j] = (s[i + 2] - s[j]) % M;
		swap(f, g);
	}
	int ans = 0;
	trav(z, f) (ans += z) %= M;
	if (ans < 0) ans += M;
	cout << ans;
}

Measured memory_bytes: 256
#include <stdio.h>

int main(void) {
	int s[3];
	int i,j;
	int min, max, mid;
	int count;
	int a,b,c;
	
	scanf("%d %d %d", &a, &b, &c);
	
	if(a>b){i=a;max=1;}
	else {i=b;max=2;}
	if(i<c){max=3;}
	
	if(max==1){if(b>c){max=a;mid=b;min=c;} else {max=a;mid=c;min=b;}}
	if(max==2){if(a>c){max=b;mid=a;min=c;} else {max=b;mid=c;min=a;}}
	if(max==3){if(a>b){max=c;mid=a;min=b;} else {max=c;mid=b;min=a;}}
	
	count = max - mid;
	min = min + count;

	if((max-min)%2 ==0){
		count=count+((int)(max-min)/2);
	}else{
		count=count+((int)(max-min)/2)+2;	
	}
	printf("%d", count);
	
	return 0;
}


Measured memory_bytes: 128