akhauriyash/Code-Regression huggingface dataset:
// khodaya khodet komak kon
#include <bits/stdc++.h>
#define pb push_back
#define ers erase
#define ins insert
#define F first
#define S second
#define all(x) x.begin(), x.end()
#define debug(x)  cerr << #x << " = " << x << endl
#define kill(x) return cout << x, 0;
#define IOS ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#pragma GCC optimize ("Ofast")
using namespace std;

typedef long long ll;
typedef long double ld;
typedef string str;
typedef pair<ll, ll> pll;
typedef vector<ll> vl;
typedef vector<pll> vpl;

const ld Pi = 3.14159265359;
const ll MOD = 1000 * 1000 * 1000 + 7;
const ll N = 2e5 + 10;
const ll INF = 1e18;
const ll LOG = 20;

int main(){
	IOS;
	ll R, G, B, N;
	cin >> R >> G >> B >> N;
	ll ans = 0;
	for (int i = 0; i <= N; i++){
		for (int j = 0; j <= N; j++){
			ll sum = R * i + G * j;
			if (sum > N) continue;
			ll re = N - sum;
			if (re % B == 0) ans ++;
		}
	}	
	
	cout << ans;
	
	
	
	
	
	return 0;
}






/*
     ,---,           ___                 ,--,
    '  .' \        ,--.'|_             ,--.'|                             ,--,
   /  ;    '.      |  | :,'            |  | :                           ,--.'|    ,---.        ,---,
  :  :       \     :  : ' :            :  : '                 .--.--.   |  |,    '   ,'\   ,-+-. /  |
  :  |   /\   \  .;__,'  /    ,--.--.  |  ' |     ,--.--.    /  /    '  `--'_   /   /   | ,--.'|'   |
  |  :  ' ;.   : |  |   |    /       \ '  | |    /       \  |  :  /`./  ,' ,'| .   ; ,. :|   |  ,"' |
  |  |  ;/  \   \:__,'| :   .--.  .-. ||  | :   .--.  .-. | |  :  ;_    '  | | '   | |: :|   | /  | |
  '  :  | \  \ ,'  '  : |__  \__\/: . .'  : |__  \__\/: . .  \  \    `. |  | : '   | .; :|   | |  | |
  |  |  '  '--'    |  | '.'| ," .--.; ||  | '.'| ," .--.; |   `----.   \'  : |_|   :    ||   | |  |/
  |  :  :          ;  :    ;/  /  ,.  |;  :    ;/  /  ,.  |  /  /`--'  /|  | '.'\   \  / |   | |--'
  |  | ,'          |  ,   /;  :   .'   \  ,   /;  :   .'   \'--'.     / ;  :    ;`----'  |   |/
  `--''             ---`-' |  ,     .-./---`-' |  ,     .-./  `--'---'  |  ,   /         '---'
                            `--`---'            `--`---'                 ---`-'
*/




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

int main()
{
    string temp;
    int N; cin >> N;
    string name; cin >> name;

    int ans = 0;
    for (int i = 0; i < N; ++i) {
        string line; cin >> line;
        for (int k = 1; k < (int)line.size(); ++k) {
            for (int s = 0; s < k; ++s) {
                temp.clear();
                for (int j = s; j < (int)line.size(); j += k)
                    temp.push_back(line[j]);
                if (temp.find(name) != string::npos) {
                    ++ans;
                    goto next;
                }
            }
        }
next:;
    }

    cout << ans << endl;
}

Measured memory_bytes: 1212
#include <bits/stdc++.h>
#define REP(i, n) for(long long i=0; i<n; i++)
#define REPR(i, n) for(long long i=n-1; i>=0; i--)
#define FOR(i, m, n) for(long long i=m; i<=n; i++)
#define FORR(i, m, n) for(long long i=m; i>=n; i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define VSORTR(v) sort(v.rbegin(), v.rend());
#define ALL(v) (v).begin(),(v).end()
#define FIN ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);

using namespace std;
using ll = long long;
using ull = unsigned long long;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
using P = pair<ll, ll>;
const ll mod = 1e9+7;
const ll inf = 1e15;
ll power(ll a,ll b){return b?power(a*a%mod,b/2)*(b%2?a:1)%mod:1;}

ll fac[2000010], finv[2000010], inv[2000010];

void init(){
    fac[0]=fac[1]=1;
    finv[0]=finv[1]=1;
    inv[1]=1;
    for(ll i=2;i<2000010;i++){
        fac[i]=fac[i-1]*i%mod;
        inv[i]=mod-inv[mod%i]*(mod/i)%mod;
        finv[i]=finv[i-1]*inv[i]%mod;
    }
}

ll C(ll n, ll k){
  return fac[n] %mod * finv[k] %mod * finv[n-k] %mod;
}

int main(){FIN
    
    string s;cin>>s;
    ll ans;
    if(s=="SSS") ans=0;
    if(s=="SSR") ans=1;
    if(s=="SRS") ans=1;
    if(s=="RSS") ans=1;
    if(s=="RSR") ans=1;
    if(s=="SRR") ans=2;
    if(s=="RRS") ans=2;
    if(s=="RRR") ans=3;
    cout<<ans<<endl;
    return 0;
}


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

int main()
{
int A;
int B;

	ios::sync_with_stdio( false );
	cin.tie( 0 );

	cin >> A;
	cin >> B;

	if( B % A == 0 )
		cout << A + B << endl;
	else
		cout << B - A << endl;

	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;;
#define ll long long
#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 FORR(i, m, n) for(int i = m;i >= n;i--)
#define INF 1<<30
#define LINF 1LL<<62
#define all(x) (x).begin(), (x).end()
const int MOD = 1000000007;
 
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef pair<int, P> PP;
typedef pair<ll, LP> LPP;

int main(){
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n; cin >> n;
  vector<ll> x(n), y(n);
  ll m ;
  REP(i,n){
      cin >> x[i] >> y[i];
  }
  REP(i,n){
      if(i==0){
          m = (abs(x[i]) + abs(y[i])) %2;
      }else{
          if((abs(x[i]) + abs(y[i])) %2 != m){
              cout << -1 << endl;
              return 0;
              break;
          }
      }
  }
  vector<ll> u(n), v(n);
  int mb=0;
  REP(i,n){
      u[i] = x[i] + y[i];
      v[i] = x[i] - y[i];
      int count=0;
      for(; (abs(u[i])>>count) != 0 || (abs(v[i])>>count) != 0; count++){
      }
      mb = max(mb, count-1);
  }
  vector<ll> arms;
  FORR(i,mb, 0){
      arms.push_back(1LL<<i);
  }
  if(m == 0){
      arms.push_back(1);
  }
  vector<bool> uway[n],vway[n];
  REP(i,n){
      REP(j,arms.size()){
          ll len = arms[j];
          if(u[i]> 0){
              uway[i].push_back(true);
              u[i]-=len;
          }else{
              uway[i].push_back(false);
              u[i]+=len;
          }
          if(v[i]> 0){
              vway[i].push_back(true);
              v[i]-=len;
          }else{
              vway[i].push_back(false);
              v[i]+=len;
          }
      }
  }
  cout << arms.size() << endl;
  REP(i,arms.size()){
      cout << arms[i];
      if(i!=arms.size()-1){
          cout << " ";
      }else{
          cout << endl;
      }
  }
  REP(i,n){
      REP(j,uway[i].size()){
          bool uw, vw;
          uw = uway[i][j];
          vw = vway[i][j];
          if(uw && vw){
              cout << 'R';
          }else if(uw && !vw){
              cout << 'U';
          }else if(!uw && vw){
              cout << 'D';
          }else{
              cout << 'L';
          }
      }
      cout << endl;
  }



}

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

A = [0] + A + [0]
S = 0
k = 0
for a in A:
    S += abs(a-k)
    k = a

for i in range(1, N+1):
    a, b, c = A[i-1], A[i], A[i+1]
    d = abs(b-a) + abs(c-b) - abs(c-a)
    print(S-d)


Measured memory_bytes: 14048
import java.util.Scanner;

public class Main{

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int param1 = sc.nextInt();
		int param2 = sc.nextInt();
		int param3 = sc.nextInt();

		String ret = "No";
		if(param1 < param2) {
			if(param2 < param3) {
				ret = "Yes";
			}
		}
		System.out.println(ret);
		sc.close();

	}

}


Measured memory_bytes: 26108
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author aajisaka
 */

#include<bits/stdc++.h>

using namespace std;

void debug_out() { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cerr << " " << to_string(H);
  debug_out(T...);
}
#ifdef LOCAL
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
#define debug(...) 42
#endif

#define SPEED ios_base::sync_with_stdio(false);cin.tie(nullptr)
#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define all(v) v.begin(), v.end()
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; }

using ll = long long;
using P = pair<ll, ll>;

constexpr double PI = 3.14159265358979323846;
mt19937_64 engine(chrono::steady_clock::now().time_since_epoch().count());

class BSortingASegment {
public:
    void solve(istream& cin, ostream& cout) {
      SPEED;
      int n, k; cin >> n >> k;
      vector<int> p(n);
      rep(i, n) {
        cin >> p[i];
      }
      int cnt = 1;
      int ans = n-k+1;
      int incr = 0;
      vector<bool> check(n);
      rep(i, n-1) {
        if (p[i] < p[i+1]) {
          cnt++;
          if (cnt>=k) {
            incr++;
            check[i+1] = true;
          }
        } else {
          cnt = 1;
        }
      }
      if (incr>=2) {
        ans -= (incr-1);
      } else {
        rep(i, n) {
          check[i] = false;
        }
      }
      set<int> st;
      rep(i, n) {
        if (i-k>=0) {
          st.erase(p[i-k]);
        }
        if (i-k >= 0) {
          int low = *st.begin();
          auto it = st.end();
          it--;
          int high = *it;
          if (i-k >= 0 && p[i-k] < low && high < p[i]) {
            if (!check[i]) ans--;
          }
        }
        st.insert(p[i]);
      }
      cout << ans << endl;
    }
};

signed main() {
  BSortingASegment solver;
  std::istream& in(std::cin);
  std::ostream& out(std::cout);
  solver.solve(in, out);
  return 0;
}

Measured memory_bytes: 11432
import bisect, collections, copy, heapq, itertools, math, string
import sys
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int, sys.stdin.readline().rstrip().split())
def LI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())

from  collections import defaultdict
def main():
    N, M = MI()
    D = defaultdict(int)
    for i in range(1, N + 1):
        D[i] = None
    for i in range(M):
        s, c = MI()
        if D[s] == None:
            D[s] = c
        elif D[s] != c:
            print(-1)
            exit()
    ans_list = []
    for i in range(1,N + 1):
        a = D[i]
        if a == None and i == 1 and N != 1:
            a = 1
        if a == None and i == 1 and N == 1:
            a = 0
        if a == None and i != 1:
            a = 0
        ans_list.append(a)
    if N != 1 and ans_list[0] == 0:
        print(-1)
        exit()
    print(''.join(map(str, ans_list)))


if __name__ == "__main__":
    main()

Measured memory_bytes: 74584
#include <iostream>
#include <alloca.h>

using namespace std;

int main()
{
    int N,A,B,C,D;
    string S;
    cin >> N >> A >> B >> C >> D >> S;

    bool result = true;
    A--; B--; C--; D--;

    if (S[C] == '#' || S[D] == '#')
    {
        result = false;
    }

    for (int chkIdx = 0; result && chkIdx < 2; chkIdx++)
    {
        int i1, i2;
        if (chkIdx == 0)
        {
            i1 = A;
            i2 = C;
        }
        else
        {
            i1 = B;
            i2 = D;
        }
        
        for (int i = i1; i < i2; i++)
        {
            if (S[i] == '#' && S[i + 1] == '#')
            {
                result = false;
                break;
            }
        }
    }

    if (result && C > D)
    {
        int i;
        for (i = B; i <= D; i++)
        {
            if (S[i - 1] == '.' && S[i] == '.' && S[i + 1] == '.')
            {
                break;
            }
        }
        if (i > D)
        {
            result = false;
        }
    }

    cout << (result ? "Yes": "No") << endl;

    return 0;
}

Measured memory_bytes: 640
#include <stdio.h>
#include <time.h>
#include <stdlib.h>

int main(void){ 
    int n,a,b;
    scanf("%d",&n);
    a = n/2;
    b = n/2 + 1;
    if (n % 2 == 0){
       printf("%d\n",a);
    }
    else{
        printf("%d\n",b);
    }
     
    
    return 0;
} 



Measured memory_bytes: 128
import sys
sys.setrecursionlimit(200002)

N, M = map(int, input().split())
G = [[] for _ in range(N)]
x = [None] * N

def fail():
    print("No")
    exit()

def dfs(s):
    global x, G
    for t, d in G[s]:
        if x[t] is None:
            x[t] = x[s] + d
            dfs(t)
        else:
            if x[t] != x[s] + d:
                fail()

for _ in range(M):
    L, R, D = map(int, input().split())
    G[L-1].append([R-1,  D])
    G[R-1].append([L-1, -D])

for i in range(N):
    if x[i] is None:
        x[i] = 0
        dfs(i)

print("Yes")


Measured memory_bytes: 135212
#include <iostream>
#include <algorithm>
#include <cstring>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <cmath>
#include <stack>
#include <iomanip>
#include <functional>
#include <array>
#include <memory>
#include <bitset>
#include <unordered_set>
#include <unordered_map>
#include <numeric>
#undef NDEBUG
#include <assert.h>

using namespace std;
typedef long long ll;


int n, m;
set<int> adj[(int)2e5];
bool removed[(int)2e5];
string s;

bool valid(const int u) {
	bool ok[2] = { false, false };
	for (auto &&v : adj[u])
		if (!removed[v])
			ok[s[v] - 'A'] = true;
	return ok[0] && ok[1];
}

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

	cin >> n >> m >> s;
	for (int i = 0; i < m; ++i) {
		int a, b;
		cin >> a >> b;
		--a, --b;
		adj[a].insert(b);
		adj[b].insert(a);
	}

	queue<int> q;
	for (int i = 0; i < n; ++i)
		if (!valid(i)) {
			removed[i] = true;
			q.push(i);
		}

	while (!q.empty()) {
		const int u = q.front();
		assert(removed[u]);
		q.pop();
		for (const int &v : adj[u]) {
			if (v != u) {
				adj[v].erase(u);
				if (!removed[v] && !valid(v)) {
					removed[v] = true;
					q.push(v);
				}
			}
		}
	}

	const bool ans = any_of(removed, removed + n, [](const bool x) { return x == false;  });
	cout << (ans ? "Yes" : "No") << '\n';
	return 0;
}

Measured memory_bytes: 28496
#include<stdio.h>
int main(void){

int a;
int b;

scanf("%d",&a);
scanf("%d",&b);

if (a < b){
printf("a < b\n");}
else if (a > b){
printf("a > b\n");}
else if (a == b){
printf("a == b\n");}
return 0;
}

Measured memory_bytes: 580
#include<bits/stdc++.h>
using namespace std;
const int m=405;
long long int N;
long long int dp[405][m];
long long int arr[m];
long long int pre[m];
long long int cal(long long int a,long long int b)
{
    if(a>b)
    return 0;
    else
    return pre[b]-pre[a-1];
}
long long int solve(long long int a,long long int b)
{
    if(dp[a][b]!=-1)
    return dp[a][b];
    if(a==b)
    return dp[a][b]=0;
    if(a+1==b)
    return dp[a][b]=arr[a]+arr[b];
    long long int best=1e13+5;
    for(int i=a;i<b;i++)
    best=min(best, solve(a,i)+solve(i+1,b)+cal(a,b));
    return dp[a][b]=best;
}

int main()
{
    memset(dp,-1,sizeof(dp));
    cin>>N;
    for(int i=1;i<=N;i++)
    {
        cin>>arr[i];
        pre[i]=pre[i-1]+arr[i];
    }
    long long int ans=solve(1,N);
    cout<<ans<<"\n";
}


Measured memory_bytes: 1536
n = int(input())
a = [int(i) for i in input().split()]
p = 10 ** 9 + 7

def pr(x):
    a=[]
    i=2
    while True:
        if x % i == 0:
            j=0
            while x % i == 0:
                x //= i
                j += 1
            a.append((i, j))
        if i * i > x:
            break
        i += 1
    if x != 1:
        a.append((x,1))
    return a
c = {}
for i in a:
    d = pr(i)
    for j in d:
        if j[0] in c:
            c[j[0]] = max(c[j[0]], j[1])
        else:
            c[j[0]] = j[1]

b = 1
for i in c:
    b *= pow(i, c[i], p)
    b %= p
ans = 0
for i in a:
    ans += b * pow(i, p - 2, p)
    ans %= p
print(ans)

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

int main(void){
  ll N, M, K;
  cin >> N >> M >> K;
  REP(i, N + 1) REP(j, M + 1) {
    if (i * M + j * N - 2 * i * j == K) {
      cout << "Yes" << endl;
      return 0;
    }
  }
  cout << "No" << endl;
  return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
#include <string.h>
int main(){
  int N,i,j,a=0,b=0,c=0,d=0,m=0,ans=0;
  scanf("%d",&N);
  char s[N][11];
  for(i=0;i<N;i++)scanf("%s",s[i]);
  for(i=0;i<N;i++){
    m=strlen(s[i]);
    if(s[i][0]=='B'){
      b++;
      if(s[i][m-1]=='A')c++;
    }
    if(s[i][m-1]=='A')a++;
    for(j=0;j<9;j++){
      if(s[i][j]=='A'&&s[i][j+1]=='B')ans++;
    }
  }
  if(a<b)d=a;
  else d=b;
  if(a==b&&b==c&&c!=0)d--;
  ans += d;
  printf("%d\n",ans);
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
using namespace std;
int minCostBU(int n,int a[]){
    int dp[100005]={0};
    dp[1]=abs(a[1]-a[0]);
    for(int i=2;i<n;i++){
        dp[i]=min( abs(a[i]-a[i-1])+dp[i-1],abs(a[i]-a[i-2])+dp[i-2]);
    }
    return dp[n-1];
}
int main() {
    int n;cin>>n;
    int a[100005],dp[100005]={0};
    for(int i=0;i<n;i++){
        cin>>a[i];
    }
    cout<<minCostBU(n,a);

}


Measured memory_bytes: 1024
#include<bits/stdc++.h>
typedef long long ll;
using namespace std;
int INF = 1LL << 30;
int MOD = 1e9+7;
int H,W,K;
int play(vector<string> S,int h,int w){
    int sum = 0,turn = 0,sub;
    S[h][w] = '0';
    /*              
    for(auto ss:S){
        cout << ss << endl;
    }cout << endl;
                  */
    do{
        //下にずらす
        for(int j = 0;j < W;j++){
            //累積
            vector<int> accum(H);
            accum[H-1] = S[H-1][j] == '0';
            for(int i = H-2;i >= 0;i--){
                accum[i] = accum[i+1] + (S[i][j] == '0');
            }
            //ずらす
            for(int i = H-2;i >= 0;i--){
                if(S[i][j] == '0')continue;
                S[i+accum[i]][j] = S[i][j];
            }
            //0埋め
            for(int i = 0;i < accum[0];i++){
                S[i][j] = '0';
            }
        }
        /*              
        for(auto ss:S){
            cout << ss << endl;

        }cout << endl;
                      */
        //連結確認
        sub = 0;
        for(int i = 0;i < H;i++){
            int cnt = 1,ind = 0;
            for(int j = 1;j <= W;j++){
                if(S[i][j] != S[i][ind]){
                    if(S[i][ind] != '0' && cnt >= K){
//                        cout << i << ":" << j << " " << cnt << endl;
                        sub += cnt * (S[i][ind] - '0');
                        for(int k = 0;k < cnt;k++){
                            S[i][j-k-1] = '0';
                        }
                    }
                    cnt = 0;
                    ind = j;
                }
                cnt++;
            }
        }
        /*              
        for(auto ss:S){
            cout << ss << endl;
        }cout << endl;
                      */
        sum += (sub << turn);
        turn++;
    }while(sub);

    return sum;
}
main(){
    cin >> H >> W >> K;
    vector<string> S(H);
    for(int i = 0;i < H;i++)cin >> S[i];
    //cout << endl;
    //cout << play(S,3,2) << endl;
    int maxi = 0;
    for(int i = 1;i < H;i++){
        for(int j = 0;j < W;j++){
            maxi = max(maxi, play(S,i,j));
        }
    }
    cout << maxi << endl;
}

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

int main() {
    long long N;
    cin >> N;
    long double sqrtN = sqrt(double(N));
    long long n = floor(sqrtN);
    long long  ans1 = 0;
    long long  ans2 = 0;
    for (long long  i = n; n > 0; --i){
        if ( N % i == 0 ){
            ans1 = i;
            ans2 = N/ans1;
            break;
        }
    }
    cout << ans1 + ans2 - 2 << endl;
    return 0;
}


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

int main(){
  int n,a[101],x[101],b=0;
  cin>>n;
  for(int i=0;i<n;i++){
    cin>>a[i];
    if(a[i]%2!=0)x[i]=0;
    else if(a[i]%3==0||a[i]%5==0)
        x[i]=0;
    else x[i]=1;
    b+=x[i];
  }
  if(b==0)cout<<"APPROVED"<<endl;
  else cout<<"DENIED"<<endl;
}

Measured memory_bytes: 256
N, A = map(int, input().split())
X = list(map(int, input().split()))
Xmax = 50
for i in range(N):
  X[i] -= A
  
dp = [[0] * (2*N*Xmax +1) for i in range(N+1)]
#dp[i][j] : i枚目までで、和がj-N*Xmaxである通り数。
# initialize
dp[0][N*Xmax] = 1

for i in range(N):
  for j in range(2*N*Xmax +1):
    dp[i+1][j] = dp[i][j]
    if 0 <= j-X[i] and j-X[i] <= 2*N*Xmax:
      dp[i+1][j] += dp[i][j-X[i]]

#print(dp[N])
print(dp[N][N*Xmax]-1)

Measured memory_bytes: 5616
w,h,n=map(int,input().split())
xm,xM,ym,yM=0,w,0,h
xya=[[int(i) for i in input().split()] for i in range(n)]
for i in range(n):
    x,y,a=xya[i][0],xya[i][1],xya[i][2]
    if a==1 and xm<x:
        xm=x
    elif a==2 and xM>x:
        xM=x
    elif a==3 and ym<y:
        ym=y
    elif a==4 and yM>y:
        yM=y
if ym>=yM or xm>=xM:
    print(0)
else:
    print((xM-xm)*(yM-ym))

Measured memory_bytes: 3064
#include "bits/stdc++.h"
#pragma GCC optimize "03"
using namespace std;

#define int long long int
#define double long double
#define pb push_back
#define pii pair<int,int>
#define fi first
#define se second
#define rep(i,a,b) for (int i = a; i < b; ++i)
#define IOS ios::sync_with_stdio(false); cin.tie(NULL);
#ifndef LOCAL
#define dbg(...) ;
#define endl '\n'
#endif

const int inf = 1e15;
const int MOD = 1e9 + 7;
const int N = 2e5 + 5;



signed main(){
    IOS;
    int n;
    cin >> n;
    for (int i = 1; i <= n; i++) {
        int c = 0;
        for (int j = 1; j < sqrt(i); j++) {
            for (int k = 1; k*k + j*j + k*j < i; k++) {
                for (int l = 1; k*k + j*j + l*l + k*j + j*l + l*k <= i; l++) {
                    if (k*k + j*j + l*l + k*j + j*l + l*k == i) c++;
                }
            }
        }
        cout << c << endl;
    }
    return 0;
}

Measured memory_bytes: 3588
#include <bits/stdc++.h>
#define arep(a,i,n) for(int i=(a);i<(n);i++)
#define rep(i,n) for(int i=0;i<(n);i++)
#define cinf(x,n) for(int i=0;i<(n);i++)cin>>x[i];
#define coutf(x,n) for(int i=0;i<(n);i++)cout<<x[i]<<endl;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;

using namespace std;

class STACK{
private:
	string s;
public:
	/*STACK(string ss){
		s = ss;
	}*/

	void push(char num){
		s+=num;
	}

	void pop(){
		if(!s.empty())
			s.pop_back();
	}

	bool isempty(){
		if(s.length()==0)
			return true;
		else
			return false;
	}

	int size(){
		return s.length();
	}

	void list(){
		cout << s << endl;
	}
};

int main(){
	STACK data;
	string s;
	cin >> s;
	rep(i,s.length()){
		if(s[i]=='0')
			data.push('0');
		else if(s[i]=='1')
			data.push('1');
		else if(s[i]=='B')
			data.pop();
		}
	data.list();
}

Measured memory_bytes: 3608
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(ll i = 0, i##_len = (n); i < i##_len; ++i)
#define rep2(i, x, n) for(ll i = x, i##_len = (n); i < i##_len; ++i)
#define all(n) begin(n), end(n)
using ll = long long;
using P = pair<ll, ll>;
using vi = vector<int>;
using vl = vector<ll>;
using vs = vector<string>;
using vc = vector<char>;
using vb = vector<bool>;
using vd = vector<double>;
vi dir = {-1, 0, 1, 0, -1, -1, 1, 1, -1};

int main() {
  string s;
  cin >> s;
  ll n = s.size(), ans = 1e9;
  rep(i, n - 2) {
    ll k = stoi(s.substr(i, 3));
    ans = min(ans, abs(753 - k));
  }
  cout << ans << endl;
}

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

#define rep(i,n) for(int i=0;i<(n);++i)
#define reps(i,n) for(int i=1;i<=(n);++i)
#define repr(i,n) for(int i=(n);i>=0;--i)
#define int long long
#define itn int
#define pb push_back
#define m_p make_pair
#define m_t meke_tuple
#define p_p(a,b) pb(m_p(a,b))
#define all(a) a.begin(),a.end()
#define SORT(a) sort(all(a))
#define RSORT(a) sort(all(a));reverse(all(a))
#define UNIQUE(a) a.erase(unique(all(a)),a.end())
#define SZ(a) (ll)(a.size())
#define ENDL cout<<endl
#define debg(a) cout<<#a<<" "<<a<<endl;
#define call(a) for(auto i:a)cout<<i<<" ";cout<<endl
#define show(a) rep(ghf,SZ(a)){rep(kjh,SZ(a[ghf])){cout<<(a[ghf][kjh]<10?" ":"")<<a[ghf][kjh]<<" ";}ENDL;}
#define out(a) cout<<(a)<<endl
#define fi first
#define se second
#define Vec vector
#define P pair
typedef long long ll;
typedef string str;
typedef vector<ll> V;
typedef pair<ll,ll> Pi;
typedef vector<Pi> VP;
const long long INF = 1LL<<60;
const long long MOD = 1e9+7;
int gcd(int a,int b){if(b==0)return a;return gcd(b,a%b);}
int lcm(int a,int b){return a/gcd(a,b)*b;}
int max(int a,int b){if(a>b)return a; return b;}
int min(int a,int b){if(a>b)return b; return a;}
void Yes(){cout<<"Yes"<<endl;}
void No(){cout<<"No"<<endl;}
void YN(bool b){cout<<(b?"Yes":"No")<<endl;}
template<class T>bool chmax(T &a,const T &b){if(a<b){a=b;return true;}return false;}
template<class T>bool chmin(T &a,const T &b){if(a>b){a=b;return true;}return false;}

signed main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n,m;
  cin>>n>>m;
  VP query(m);
  rep(i,m)cin>>query[i].se>>query[i].fi;
  SORT(query);
  set<ll> removed;
  removed.insert(INF);
  rep(i,m){
    //call(removed);
    int key=*lower_bound(all(removed),query[i].se);
    //debg(key);
    if(!(key<query[i].fi)){
      removed.insert(query[i].fi-1);
    }
  }
  out(SZ(removed)-1);  
  
  
  return 0;
}



Measured memory_bytes: 1792
#include <stdio.h>
int a, b;
int main() {
	scanf("%d%d", &a, &b);
	for (int i = 0; i < 1010; i++) {
		if (i * 8 / 100 == a && i * 10 / 100 == b) {
			printf("%d\n", i);
			return 0;
		}
	}
	printf("-1\n");
}

Measured memory_bytes: 128
#include <iostream>
#include <iomanip>
#include <vector>
#include <cmath>
#include <algorithm>
#include <iomanip>
#include <cstring>
#define rep(i, N) for (int i = 0; i < (int)N; i++)
using namespace std;
typedef long long ll;
const ll LLINF = 9223372036854775807;
const int MOD = 1000000007;

int main() {
  string s; cin >> s;
  int a_pos=0, z_pos=s.length()-1;

  while(s[a_pos]!='A') a_pos++;
  while(s[z_pos]!='Z') z_pos--;
  int result = z_pos - a_pos + 1;

  cout << result << endl;
  return 0;
}

Measured memory_bytes: 640
#include <stdio.h>

main(){
  
  int x,y,z;
  
  scanf("%d%d",&x,&y);
  
  while(1){
    z=x%y;
    if(z==0) break;
    x = y;
    y = z;
    
  }
  printf("%d\n",y);
  return 0;
}

Measured memory_bytes: 592
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;
using System.IO;

static class Program
{
    private static string Read() { return Console.ReadLine(); }
    private static int ReadInt() { return int.Parse(Read()); }
    private static long ReadLong() { return long.Parse(Read()); }
    private static double ReadDouble() { return double.Parse(Read()); }
    private static int[] ReadInts() { return Array.ConvertAll(Read().Split(), int.Parse); }
    private static long[] ReadLongs() { return Array.ConvertAll(Read().Split(), long.Parse); }
    private static double[] ReadDoubles() { return Array.ConvertAll(Read().Split(), double.Parse); }

    static int Solve(int N, long[] A)
    {
        long sum = 0;
        long[] sums = new long[N];
        for (int i = 0; i < N; ++i)
        {
            sums[i] = sum + A[i];
            sum += A[i];
        }
        for (int i = 1; i < N; ++i)
        {
            if (sums[N - i - 1] * 2 < A[N - i]) { return i; }
        }
        return N;
    }
    static void Main(string[] args)
    {
        int N = ReadInt();
        var A = ReadLongs();
        Console.WriteLine(Solve(N, A.OrderBy(a => a).ToArray()));
    }
}


Measured memory_bytes: 27612
from collections import defaultdict
N = int(input())
A = list(map(int, input().split()))

d = defaultdict(int)

for i in A:
    d[i] += 1

ans = 0
for key in d:
    tmp = d[key]
    if tmp > key:
        ans += tmp - key
    elif tmp < key:
        ans += tmp
print(ans)


Measured memory_bytes: 22280
#include <bits/stdc++.h>
#define ll long long
#define double long double
#define rep(i,n) for(int i=0;i<(n);i++)
#define REP(i,n) for(int i=1;i<=(n);i++)
#define mod (ll)(1e9+7)
#define inf (ll)(3e18+7)
#define pi (double) acos(-1)
#define P pair<int,int>
#define PiP pair<int,pair<int,int>>
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
using namespace std;

int main() {
    ll n, a, b;
    cin >> n >> a >> b;
    vector<ll> x(n);
    rep(i, n)cin >> x[i];
    ll ans = 0;
    rep(i, n-1){
        ans += min(b, a * (x[i+1]-x[i]));
    }
    cout << ans << endl;
}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(false); cin.tie(0);
#define FOR(i,s,n) for(int i = s; i < (n); i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(n) (n).begin(), (n).end()
#define RALL(n) (n).rbegin(), (n).rend()
#define ATYN(n) cout << ( (n) ? "Yes":"No") << endl;
#define CFYN(n) cout << ( (n) ? "YES":"NO") << endl;
using ll = long long;
using ull = unsigned long long;
using pii = pair<int,int>;

int main(void)
{
    IOS
    int a, b;
    cin >> a >> b;
    if (a % 3 == 0 || b % 3 == 0 || (a+b) % 3 == 0) {
        cout << "Possible" << endl;
    } else {
        cout << "Impossible" << endl;
    }

    return 0;
}

Measured memory_bytes: 256
//#define _CRT_SECURE_NO_WARNINGS
#include "bits/stdc++.h"

#define rep(i,n) for(ll (i)=0;(i)<(ll)(n);(i)++)
#define all(x) (x).begin(),(x).end()
#define MOD 1000000007LL
#define INF (1LL<<60LL)
//#define int long long
#define MAX_N (100001)
#define int long long
typedef long long ll;

using namespace std;



signed main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	int n, a, b; cin >> n >> a >> b;
	if (a == 0) {
		cout << "0" << endl;
		exit(0);
	}
	int k = n / (a + b);
	int ans = 0;
	ans += k * a;
	ans += min(n % (a + b), a);
	cout << ans << endl;

}

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

#define endl '\n'
#define ALL(a)  (a).begin(),(a).end()
#define ALLR(a)  (a).rbegin(),(a).rend()
#define spa << " " <<
#define test cout<<"test"<<endl;
#define fi first
#define se second
#define MP make_pair
#define PB push_back
#define EB emplace_back
#define rep(i,n,m) for(ll i = (n); i < (ll)(m); i++)
#define rrep(i,n,m) for(ll i = (m) - 1; i >= (ll)(n); i--)
using ll = long long;
using ld = long double;
const ll MOD = 1e9+7;
//const ll MOD = 998244353;
const ll INF = 1e18;
using P = pair<ll, ll>;
template<typename T>
void chmin(T &a,T b){if(a>b)a=b;}
template<typename T>
void chmax(T &a,T b){if(a<b)a=b;}
void pmod(ll &a,ll b){a=(a+b)%MOD;}
void pmod(ll &a,ll b,ll c){a=(b+c)%MOD;}
void qmod(ll &a,ll b){a=(a*b)%MOD;}
void qmod(ll &a,ll b,ll c){a=(b*c)%MOD;}
ll median(ll a,ll b, ll c){return a+b+c-max({a,b,c})-min({a,b,c});}
void ans1(bool x){if(x) cout<<"Yes"<<endl;else cout<<"No"<<endl;}
void ans2(bool x){if(x) cout<<"YES"<<endl;else cout<<"NO"<<endl;}
void ans3(bool x){if(x) cout<<"Yay!"<<endl;else cout<<":("<<endl;}
template<typename T1,typename T2>
void ans(bool x,T1 y,T2 z){if(x)cout<<y<<endl;else cout<<z<<endl;}  
template<typename T>
void debug(vector<vector<T>>&v,ll h,ll w){for(ll i=0;i<h;i++)
{cout<<v[i][0];for(ll j=1;j<w;j++)cout spa v[i][j];cout<<endl;}};
void debug(vector<string>&v,ll h,ll w){for(ll i=0;i<h;i++)
{for(ll j=0;j<w;j++)cout<<v[i][j];cout<<endl;}};
template<typename T>
void debug(vector<T>&v,ll n){if(n!=0)cout<<v[0];
for(ll i=1;i<n;i++)cout spa v[i];cout<<endl;};
template<typename T>
vector<vector<T>>vec(ll x, ll y, T w){
  vector<vector<T>>v(x,vector<T>(y,w));return v;}
ll gcd(ll x,ll y){ll r;while(y!=0&&(r=x%y)!=0){x=y;y=r;}return y==0?x:y;}
vector<ll>dx={1,0,-1,0,1,1,-1,-1};
vector<ll>dy={0,1,0,-1,1,-1,1,-1};
template<typename T>
vector<T> make_v(size_t a,T b){return vector<T>(a,b);}
template<typename... Ts>
auto make_v(size_t a,Ts... ts){
  return vector<decltype(make_v(ts...))>(a,make_v(ts...));
}
ostream &operator<<(ostream &os, pair<ll, ll>&p){
  return os << p.first << " " << p.second;
}  
int main(){
  cin.tie(nullptr);
  ios_base::sync_with_stdio(false);
  //cout<<fixed<<setprecision(10);
  ll res=0,buf=0;
  bool judge = true;
  string s;cin>>s;
  ll n=s.size();
  rep(i,0,n/2){
    if(s[i]!=s[n-1-i])res++;
  }
  cout<<res<<endl;
  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>

using namespace std;

int main(){
    int n;
    int d;
    cin >> n >> d;
    vector<int> x(n);
    vector<int> y(n);
    for(int i = 0; i < n; i++){
        cin >> x[i] >> y[i];
    }
    double root = 0;
    int count = 0;
    for(int i = 0; i < n; i++){
        double power = pow(x[i], 2) + pow(y[i], 2);
        root = sqrt(pow(x[i], 2) + pow(y[i], 2));
        //cout << root << endl;
        
        if(root <= d){
            count++;
        }
    }
    cout << count << endl;
    return 0;
}

Measured memory_bytes: 4836
<?php
	fscanf(STDIN,"%s",$str);
	$len = strlen($str);
    
    if($str != strrev($str)){
        echo "No";
        return ;
    }
 
    $str1 = $str; 
    $len1 = (($len - 1) / 2);
    $str1 = substr($str1, 0,$len1);

    if($str1 != strrev($str1)){
        echo "No";
        return;
    }
      
    $str2 = $str; 
    $len2 = (($len + 3) / 2);
    $str2 = substr($str2, $len2 - 1,$len);

    if($str2 != strrev($str2)){
        echo "No";
      	return;
    }
	echo "Yes";

Measured memory_bytes: 3700
#include "bits/stdc++.h"
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
const int MOD = 1e9+7, MAX = 1e9, larg = 1e5, INF = -1e9;
long long A,B,C,D,E,F,G,H,I,J,K,L,N,M,O,P,Q,R,S,T,U,V,W,X,Y,Z;
long long max_value = INF, max_index = -1;
long long min_value = MAX, min_index = -1;
long long sum = 0;

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

int main() {
    cin >> A >> B;
    if(A > 9 || B > 9) cout << -1;
    else cout << A*B;
}


Measured memory_bytes: 256
#include <map>
#include <vector>
#include <algorithm>
#include <cstdio>
#include <stdio.h>
#include <stdlib.h>
#include <cstring>
#include <math.h>
#include <iostream>
#include <queue>
#include <set>
#define ll long long
#define sf(a) scanf("%lld",&a)
#define pf(b) printf("%lld",b)
#define sp printf(" ")
#define nw printf("\n")
#define mp make_pair
#define pi pair<ll,ll>
#define f first
#define s second
#define pb push_back
#define sor(v) sort(v.begin(),v.end())
#define rev(v) reverse(v.begin(),v.end())
#define fast ios_base::sync_with_stdio(false)
using namespace std;

ll val[10000002];
int main()
{
 ll n,ans=0;
 sf(n);
 for(ll i=1;i<=n;i++)
 {
 	for(ll j=i+i;j<=n;j+=i)
 		val[j]++;
 }
 for(ll i=1;i<=n;i++)
 	ans+=(val[i]+1)*i;
 pf(ans);
}


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

int main(){
	int N, ans = 0;
	cin >> N;
	int V[N], C[N];
	for(int i = 0; i < N; i++)
		cin >> V[i];
	for(int i = 0; i < N; i++)
		cin >> C[i];
	for(int i = 0; i < N; i++)
		ans += max(0,V[i]-C[i]);
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
#include <cassert>

#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>

// C++
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
//#include <boost/foreach.hpp>
//#include <boost/range/algorithm.hpp>
#define rep(i,j,k) for(int i=(int)j;i<(int)k;i++)
#define ll long long
#define Sort(v) sort(all(v))
#define INF 1000000000
#define END return 0
#define pb push_back
#define se second
#define fi first
#define pb push_back
#define all(v) (v).begin() , (v).end()
#define MP make_pair
#define MOD 1000000007LL
using namespace std;
int day[12]={31,28,31,30,31,30,31,31,30,31,30,31};

int main (){
    int n;
    cin>>n;
    vector<int> v;
    rep(i,0,n){
        int cmd;
        cin>>cmd;
        if(cmd==0){
            int x;cin>>x;v.pb(x);
        }else if(cmd==1){
            int p;cin>>p;cout<<v[p]<<endl;
        }else {
            v.erase(v.end()-1);
        }
    }
}



/*

*/


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

#define debug(x) cerr << x << " = "(x) << endl;
#define ll long long
#define rep(i,x,y) for(int i=x;i<y;i++)
#define rel(i,x,y) for(int i=x-1;i>=y;i--)
#define all(x) x.begin(),x.end()

int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    int n; cin >> n;
    vector<ll> a(n);
    set<int> s;
    int cnt=0;
    rep(i,0,n){
        cin >> a[i];
        s.insert(a[i]);
    }
    sort(all(a));
    int locate = 10000000;
    bool ok = false;
    bool used[n] = {};
    rep(i,0,n){
        if(locate != a[i]){
            locate = a[i];
            ok = false;
        }
        else{
            if(!ok){
                cnt++;
                used[i-1] = true;
                ok = true;
            }
            cnt++;
            used[i] = true;
            //cout << cnt <<endl;
        }
    }
    bool box[1000010] = {};
    for(auto x : s){
        int ts = 2 * x;
        while(1000010>ts){
            box[ts] = true;
            ts += x;
        }
    }
    rep(i,0,n){
        if(used[i]) continue;
        if(box[a[i]]) cnt++;
    }
    cout << n - cnt << endl;
}

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

int main(){
  
  int N, M;
  cin >> N >> M;
  
  vector<int> A(N);
  int all_vote = 0;
  for(int i=0;i<N;i++){
    cin >> A[i];
    all_vote += A[i];
  }
  
  sort(A.begin(), A.end());
  reverse(A.begin(), A.end());
  
  bool can_select = 1;
  
  for(int i=0;i<M;i++){
    if(A[i]<(all_vote*0.25/M)){
      can_select = 0;
      break;
    }
  }
  
  if(can_select){
    cout << "Yes" << endl;
  }else{
    cout << "No" << endl;
  }
}


Measured memory_bytes: 256
//#include <bits/stdc++.h>
#include <iostream>
#include <cstdio>
#include <vector>
#include <queue>
#include <map>
#include <cstring>
#include <string>
#include <math.h>
#include <algorithm>
#define rep(i, n) for(int i = 0; i < (int)n; i++)
#define repp(i, m, n) for(int i = m; i < (int)n; i++)
#define reps(i, n) for(int i = 1; i <= (int)n; i++)
#define pb push_back
const int    INF = 100000000;
const double EPS = 1e-10;
const int    MOD = 1000000007;
using namespace std;
typedef long long ll;
typedef pair<int, int> pai;
typedef pair<ll,ll> pal;



int main()
{
	int n;
	cin >> n;
	if(n==3)
	{
		cout << "2 5 63" << endl;
	}
	else if(n%2==0)
	{
		int m=min(n-2, 5000);
		rep(i, m) cout << 3*(2*i+1) << ' ';
		if(n-m==2) cout << "2 4" << endl;
		else
		{
			cout << "15000 30000";
			reps(i, (n-m)/2-1) cout << ' ' << 15000-2*i << ' ' << 15000+2*i;
			cout << endl;
		}
	}
	else
	{
		int m=min(n-3, 5000);
		rep(i, m) cout << 3*(2*i+1) << ' ';
		cout << "15000";
		reps(i, (n-m)/2) cout << ' ' << 15000-2*i << ' ' << 15000+2*i;
		cout << endl;
	}
	return 0;
}

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


int main() {
    
    int a, b, c;
    scanf("%d %d %d", &a, &b, &c);
    int minimumOfTwoNums;
    
    if(a <= b) {
        if(b <= c) {
            minimumOfTwoNums = a + b;
        } else {
            minimumOfTwoNums = a + c;
        }
    } else {
        if(a <= c) {
            minimumOfTwoNums = a + b;
        } else {
            minimumOfTwoNums = b + c;
        }
    }
    
    printf("%d", minimumOfTwoNums);
    
    return 0;
}



Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main(void){
    int n,x;
    cin >>n>>x;
    int s=0,a=1000;
    for(int i=0;i<n;i++){
        int m;
        cin >>m;
        s+=m;
        a=min(a,m);
    }
    cout <<n+(x-s)/a<<endl;
    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<cmath>
#include<string>
#include<utility>
#include<vector>
#include<array>

using namespace std;


int main(){
    string S ,T ,buff;
    cin >> S >> T;
    int len=S.length();
    buff=T.substr(0,len);
    if(buff==S ){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }
    return 0;
}


Measured memory_bytes: 3040
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <limits>
#include <stack>
#include <queue>
#include <map> 
using namespace std;

#define LL long long
#define MOD (1000000007)


//129
int main() {
	LL N, M;

	scanf("%lld %lld", &N, &M);

	static LL dp[100010];
	memset(dp, 0, sizeof(dp));

	for (int i = 0; i < M; i++) {
		LL a;
		scanf("%lld", &a);

		dp[a] = -1;
	}

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

		if (dp[i - 1] > 0) {
			dp[i] += dp[i - 1]; //1step
		}
		
		if (i > 1 && dp[i - 2] > 0) {
			dp[i] += dp[i - 2]; //2step
		}

		dp[i] = dp[i] % MOD;
	}

	printf("%lld\n", dp[N]);

}


//128
/*
int main() {
	LL N, M;

	scanf("%lld %lld", &N, &M);

	unsigned int relation[11]; //index->switch No.
	memset(relation, 0, sizeof(relation));

	for (int i = 1; i <= M; i++) {
		LL k;
		scanf("%lld", &k);

		for (int j = 1; j <= k; j++) {
			unsigned int s;
			scanf("%d", &s);

			relation[s] |= (1 << (i - 1));
		}
	}

	unsigned int P = 0;
	for (int i = 1; i <= M; i++) {
		unsigned p;
		scanf("%d", &p);

		if (p > 0) {
			P |= (1 << (i - 1));
		}
	}

	LL result = 0;

	for (unsigned int pattern = 0; pattern < (unsigned int)pow(2, N); pattern++) {
		unsigned int on_off = 0; //bit��0�Ȃ�_��

		for (int i = 1; i <= N; i++) {
			if (((1 << (i - 1)) & pattern) != 0) {
				on_off ^= relation[i];
			}
		}

		on_off ^= P;

		if (on_off == 0) {
			result++;
		}
	}

	printf("%lld\n", result);

}
*/

//127
/*
int main() {
	LL N, M;

	scanf("%lld %lld", &N, &M);

	LL pass_count[100010];
	memset(pass_count, 0, sizeof(pass_count));

	for (int i = 1; i <= M; i++) {
		LL L, R;

		scanf("%lld %lld", &L, &R);

		pass_count[L]++;
		pass_count[R + 1]--;
	}

	LL result = 0;
	for (int i = 1; i <= N; i++) {
		pass_count[i] += pass_count[i - 1];
		if (pass_count[i] == M) {
			result++;
		}
	}

	printf("%lld\n", result);

	return 0;
}
*/


//126
/*
int main() {
	LL N, K;

	cin >> N >> K;

	static double dp[200100];
	memset(dp, 0, sizeof(dp));

	for (int i = 1; i <= N; i++) {
		dp[i] = 1.0 / (double)N;
	}

	for (LL i = 1; i < K; i++) {
		dp[i * 2] += dp[i] * 0.5;
	}

	double result = 0;

	for (LL i = K; i < 200100; i++) {
		result += dp[i];
	}

	printf("%0.11f\n", result);

	return 0;
}
*/

Measured memory_bytes: 1024
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayDeque;
import java.util.Deque;

import static java.lang.Integer.parseInt;

/**
 * Simple Calculator
 */
public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String line;

		Deque<Character> ops = new ArrayDeque<>();
		Deque<Integer> nums = new ArrayDeque<>();

		while ((line = br.readLine()) != null && !line.isEmpty()) {

			if (line.equals("=")) {
				System.out.println(nums.pop());
				break;
			}

			switch (line.charAt(0)) {
				case '+':
				case '-':
				case '*':
				case '/':
					ops.offer(line.charAt(0));
					break;
				default:
					if (ops.size() > 0) {
						char op = ops.pop();
						int num1 = nums.pop();
						int num2 = parseInt(line);
						switch (op) {
							case '+':
								num1 += num2;
								break;
							case '-':
								num1 -= num2;
								break;
							case '*':
								num1 *= num2;
								break;
							case '/':
								num1 /= num2;
								break;
						}
						nums.offer(num1);
					} else {
						nums.offer(parseInt(line));
					}
			}
		}
	} //end main
}

Measured memory_bytes: 24456
#[allow(unused_imports)]
use std::cmp::{min,max};
#[allow(unused_imports)]
use std::collections::{BTreeMap,BTreeSet};
#[allow(unused_imports)]
use std::ops::*;
#[allow(unused_imports)]
use std::collections::BinaryHeap;

#[allow(unused_macros)]
macro_rules! tf {
    ($c:expr, $t:expr, $f:expr) => {{
        if $c { $t } else { $f }
    }};
}

fn main() {
    let (n,k) = {
        let xs = read_vec_i64();
        (xs[0] as usize, xs[1] as usize)
    };
    let xs = read_vec_i64();
    let inf = 1i64 << 50;
    let mut res = inf;
    for i in 0..n-k+1 {
        let left = xs[i];
        let right = xs[i + k - 1];
        let t1 = (left - 0).abs() + (left - right).abs();
        let t2 = (right - 0).abs() + (right - left).abs();
        res = min(res, min(t1, t2));
    }
    println!("{}", res);
}

#[allow(dead_code)]
fn read_line() -> String {
    let mut ret = String::new();
    std::io::stdin().read_line(&mut ret).ok();
    ret.pop();
    //ret.pop();
    return ret;
}

#[allow(dead_code)]
fn read_i64() -> i64 {
    let ss = read_line();
    return ss.parse::<i64>().unwrap();
}

#[allow(dead_code)]
fn read_vec_i64() -> Vec<i64> {
    let mut res = vec![];
    let ss = read_line();
    for ts in ss.split_whitespace() {
        let x = ts.parse::<i64>().unwrap();
        res.push(x);
    }
    return res;
}

use std::fmt::Display;
#[allow(dead_code)]
fn write_vec<T: Display>(xs: &Vec<T>) {
    if xs.len() == 0 {
        println!("");
        return;
    }
    print!("{}", xs[0]);
    for i in 1..xs.len() {
        print!(" {}", xs[i]);
    }
    println!("");
}


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

int N,M,K;
int E[100],A[100];
int v[4];

double dp[51][5000];
void solve(){


    dp[0][0]=1.0;
    for(int i=0;i<N;i++){
        for(int j=N-1;j>=i;j--){
            for(int k=0;k<=i*100;k++){
                //if(dp[j][k]<(1e-9))continue;
                for(int l=0;l<M;l++){
                    int toval=k;
                    int topos=min(N,j+v[l]);
                    if(E[topos]==1)topos=min(N,topos+A[topos]);
                    else if(E[topos]==2)toval+=A[topos];
                    else if(E[topos]==3)toval=max(0,toval-A[topos]);
                    dp[topos][toval]+=dp[j][k]/M;
                }
                dp[j][k]=0;
            }

        }
    }

    double sum=0;
    for(int i=0;i<5000;i++)sum+=dp[N][i]*i;
    cout<<(int)sum<<endl;
}

bool input(){
    for(int i=0;i<51;i++){
        for(int j=0;j<5000;j++)dp[i][j]=0;
        E[i]=A[i]=0;
    }

    cin>>M>>N>>K;
    if(M==0&&N==0&&K==0)return false;
    for(int i=0;i<M;i++)cin>>v[i];
    for(int i=0;i<K;i++){
        int n,e,a;
        cin>>n>>e>>a;
        E[n]=e;
        A[n]=a;
    }
    return true;
}

int main(){
    while(input())solve();
    return 0;
}

Measured memory_bytes: 3152