akhauriyash/Code-Regression huggingface dataset:
#include<stdio.h>
 
static const int MAX = 500;
static const int INFTY = (1<<21);
 
#define NIL -1
 
int p[100];
int key[100];
int n;

int main(){
  int i, j,e,v,u,sum;
  int M[100][100];
  int l[100];
 
  scanf("%d", &n);
 
  for ( i = 0; i< n; i++ ){
    for ( j = 0; j < n; j++ ){
      scanf("%d", &e);
      M[i][j] = (e==-1)?INFTY:e;
    }
  }
  for(u=0;u<n;u++){
    key[u] =100000000;
 
    p[u] =NIL;
 
    l[u]=NIL;
  }
  key[0] = 0;
 
  while(1){
    int u=NIL;
    int v = 100000000;
    for(i=0;i<n;i++){
      if(key[i]<v && l[i]==NIL){
	v = key[i];
	u=i;
      }
    }
    if(u==NIL){
      break;
    }
    for(v=0;v<n;v++){
      if(M[u][v] < key[v] && l[v]==NIL){
	key[v] = M[u][v];
	p[v]= u;
      }
    }
    l[u]=0;
  }
  sum = 0;
  for ( i = 0; i < n; i++ ){
    if ( p[i] != -1 )
      sum += M[i][p[i]];
  }
  printf("%d\n", sum);
  
  return 0;
}

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

long int key(long int x,long int y);

int main(void) {

  long int a,b;

  while(cin >> a >> b){


    long int gcd = key(a,b);
    long int a2 = (long int)(a/gcd);
    long int b2 = (long int)(b/gcd);
    long int lcm = gcd * a2 * b2;

    printf("%ld %ld\n",gcd,lcm);
  }

  return 0;
}

long int key(long int x,long int y){

  if(y == 0){//???????????´??°???0??????????????§??¬?´???°???0
    return x;
  }else{
    return key(y, x % y);
  }
}

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

#define ll                  long long
#define ld                  long double
#define pb                  push_back
#define mp                  make_pair
#define fi                  first
#define se                  second
#define all(c)              (c).begin(),(c).end()
#define for0(i, n)          for (ll i = 0; i < n; ++i)
#define for1(i, n)          for (ll i = 1; i <= n;++i)
#define for2(i, n)          for (ll i = 1; i < n; ++i)
#define for3(i, k, n)       for (ll i = k; i < n; ++i)
#define input(a, i, n)      for (int i = 0; i < n; ++i) {cin >> a[i]; }
#define output(a, i, n)     for (int i = 0; i < n; ++i) {cout << a[i] << ' '; }
//cout.precision(12);

using namespace std;

int64_t TN = 1;

void solve()
{
    string s;
    cin >> s;
    if (s[s.size() - 1] == 's') s += "es";
    else s += "s";
    cout << s;
}

int main()
{
    //cin >> TN;
    for (int i = 0; i < TN; ++i) {
        solve();
    }
    return 0;
}


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

int main(){
    int N; cin >> N;
    vector<pair<int, int>> red, blue;

    for(int i=0; i<2*N; i++){
        int x, y; cin >> x >> y;
        if(i<N) red.push_back(make_pair(x, y));
        else blue.push_back(make_pair(x,y));
    }
    sort(red.begin(),red.end());
    sort(blue.begin(),blue.end());

    int count = 0;
    //for(auto i : red) cout << i.first << endl;
    for(int i=0; i<N; i++){
        auto r = red[N-1-i];
        //cout << " r : " << r.first << " " << r.second << endl;
        int minimum_y = INT_MAX;
        int memo;
        for(int i=0; i<blue.size(); i++){
            if(blue[i].first > r.first && blue[i].second > r.second && blue[i].second<minimum_y){
                minimum_y = blue[i].second;
                memo = i;
                //cout << blue[i].first << " " << minimum_y << endl;
            }
        }
        if(minimum_y!=INT_MAX){
            blue.erase(blue.begin()+memo);
            count++;
        }
    }
    cout << count << endl;
}


Measured memory_bytes: 256
x,y=map(int,input().split())
def xor(x):
    if x%2==1:
        return 0 if (x+1)/2 %2==0 else 1
    else:
        return (0 if (x+2)/2 %2==0 else 1)^(x+1)
print(xor(x-1)^xor(y))

Measured memory_bytes: 2940
n,m=gets.chomp.split.map(&:to_i)
u,t=1,100000
m.times{
  a=gets.chomp.split.map(&:to_i)
  u=a[0] if u<a[0]
  t=a[1] if a[1]<t
}
puts u<=t ? t-u+1 : 0


Measured memory_bytes: 1788
/*                                                                                 
	Author :- Gaurang_Kothiya
	
	Quote :- " Practice makes a man perfect. "		
*/  
 
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>  
#include <ext/pb_ds/tree_policy.hpp> 
#include <functional>
#include <bitset>
#include <cstdint>
#include <initializer_list>
 
using namespace std;
using namespace __gnu_pbds;  

#define data_set(type) tree<type,null_type,less<type>,rb_tree_tag,tree_order_statistics_node_update>
#define speed ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define ll long long int
#define ld long double
#define f(i,x,n) for(auto i=x;i<=n;i++)
#define fe(x,v)   for(auto &x :v)
#define nf(i,x,n) for(auto i=n;i>=x;i--)
#define all(a)   a.begin(),a.end()
#define rall(a)  a.rbegin(),a.rend()
#define ook(num) order_of_key(num)
#define fbo(num) find_by_order(num)
#define gcd(a,b) __gcd(a,b)
#define pub push_back
#define pob pop_back
#define puf push_front
#define pof pop_front
#define RE rend()
#define RB rbegin()
#define B begin()
#define E end()
#define acc(v, x) accumulate(all(v), x)
#define p(a,b) pair<a,b>
#define F first
#define S second
#define sz size()
#define v(x) vector<x>
#define m(a,b) map<a,b>
#define u_m(a,b) unordered_map<a,b>
#define mm(a,b) multimap<a,b>
#define s(a) set<a>
#define us(a) unordered_set<a>
#define ms(a) multiset<a>
#define maxy __LONG_LONG_MAX__
#define miny INT_MIN
#define PI 3.14159265358979323846
const ll inf= 1e9;
const ll inf64= 1e18;
const ll MOD= 1e9 +7;



void Solve()
{
	ll a;
	cin>>a;
	
	cout<< a + a*a + a*a*a ;
}
 
signed main() 
{
	speed		
	
	int q=1;
	//	cin>>q;
	
	while(q--)
	Solve();
		
	return 0;
} 

Measured memory_bytes: 3648
#include<stdio.h>
int main(void){
   int A, B, C, D, E, F, S, t = 0;
   scanf("%d %d %d %d %d", &A, &B, &C, &D, &E);
   if ( A < 0 ) t = - A * C + B * E;
   if ( A <= 0 )  t += D;
   else t = ( B - A ) * E;
   printf("%d\n", t);
   return 0;
}

Measured memory_bytes: 1860
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		try (Scanner sc = new Scanner(System.in)) {
			while (true) {
				int n = sc.nextInt();
				if (n == 0)
					break;
				int[] scores = new int[n];
				int sum = 0;
				for (int i = 0; i < scores.length; i++) {
					scores[i] = sc.nextInt();
					sum += scores[i];
				}
				double average = 0, vanance = 0;
				average = (double) sum / scores.length;
				for (int i = 0; i < scores.length; i++) {
					vanance += (scores[i] - average) * (scores[i] - average) / scores.length;
				}
				System.out.println(Math.sqrt(vanance));

			}
		}
	}

}


Measured memory_bytes: 31708
import sys
from operator import itemgetter

sys.setrecursionlimit(10 ** 6)
input = sys.stdin.readline
int1 = lambda x: int(x) - 1

def main():
    inf = 10 ** 10
    n = int(input())
    lr = [list(map(int, input().split())) for _ in range(n)]
    biggest_l = max(l for l, r in lr)
    smallest_r = min(r for l, r in lr)
    mx = max(r - l + 1 for l, r in lr) + max(smallest_r - biggest_l + 1, 0)
    ab = [[max(0, r - biggest_l + 1), max(0, smallest_r - l + 1)] for l, r in lr]
    ab.sort(key=lambda x: (x[0], -x[1]))
    # print(ab)
    min_r = 10 ** 10
    for i in range(n - 1):
        if ab[i][1] < min_r: min_r = ab[i][1]
        cur = min_r + ab[i + 1][0]
        if cur > mx: mx = cur
    print(mx)

main()


Measured memory_bytes: 52260
#include <bits/stdc++.h>
#include<math.h>
#include<queue>
#include<cstdio>
#include<set>
#include<map>
using namespace std;

int main(){
    int A,B;
    cin >> A >> B;
    double c=A*12.5;
    int c1=ceil(c);
    double d=(A+1)*12.5;
    int d1=ceil(d-1);
    int e=B*10;
    int f=(B+1)*10-1;

    if(max(c1,e)>min(d1,f)) cout << -1 << endl;
    else cout << max(c1,e) << endl;
    return 0;
}

Measured memory_bytes: 256
#pragma once
#include <sstream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <iostream>
#include <utility>
#include <set>
#include <cctype>
#include <queue>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <deque>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
void RoundUptheMean() {
	double a, b;
	cin >> a >> b;
	cout << (int)ceil((a + b) / 2) << endl;
}
int main() {

	RoundUptheMean();
	return 0;
}


Measured memory_bytes: 256
import java.io.*;
import java.math.*;
import java.util.*;
public class Main { 
 
	public static void main(String[] args) { 
		Scanner input = new Scanner(System.in);
		int START = input.nextInt();
		int GOAL = input.nextInt();
		int diff = START-GOAL;
		System.out.println(START-2*diff);
	}
}

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

using int32 = int_fast32_t;
using int64 = int_fast64_t;

const int32 INF = 1e9;
const int32 MOD = 1e9+7;
const int64 LLINF = 1e18;

#define YES(n) cout << ((n) ? "YES\n" : "NO\n"  )
#define Yes(n) cout << ((n) ? "Yes\n" : "No\n"  )
#define POSSIBLE cout << ((n) ? "POSSIBLE\n" : "IMPOSSIBLE\n"  )
#define ANS(n) cout << (n) << "\n"
#define REP(i,n) for(int64 i=0;i<(n);++i)
#define FOR(i,a,b) for(int64 i=(a);i<(b);i++)
#define FORR(i,a,b) for(int64 i=(a);i>=(b);i--)
#define ALL(obj) (obj).begin(),(obj).end()
#define pii pair<int32,int32>
#define pll pair<int64,int64>
#define pb(a) push_back(a)

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int32 n;
    cin >> n;
    n %= 10;
    if(n == 2 || n == 4 || n == 5 || n == 7 || n == 9){
        ANS("hon");
    }else if(n == 0 || n == 1 || n == 6 || n == 8){
        ANS("pon");
    }else{
        ANS("bon");
    }
    return 0;
}

Measured memory_bytes: 3640
#include<stdio.h>
#define N 1000

int main(){
  int i,j;
  int n,k,s,v[N][N];

  scanf("%d",&n);
  while(i!=n){
    scanf("%d",&i);
    scanf("%d",&k);
    for(j=0;j<k;j++){
      scanf("%d",&s);
      v[i-1][s-1]=1;
    }
  }
  for(i=0;i<n;i++){
    for(j=0;j<n;j++){
      if(v[i][j]==NULL) v[i][j]=0;
      printf("%d",v[i][j]);
      if(j!=n-1) printf(" ");
    }
    printf("\n");
  }
  return 0;
}

Measured memory_bytes: 2708
#include <bits/stdc++.h>
using namespace std;
#define ll long long
int main(void) {
    ll n; scanf("%lld",&n);
    ll ans=n;
    for (ll i=1;i*i<=n;i++) if (n%i == 0) {
        ans=min(ans, i+n/i-2);
    }
    printf("%lld\n",ans);
    return 0;
}


Measured memory_bytes: 256
#define  _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <algorithm>
#include <utility>
#include <functional>
#include <cstring>
#include <queue>
#include <stack>
#include <math.h>
#include <iterator>
#include <vector>
#include <string>
#include <set>
#include <math.h>
#include <iostream>
#include <random>
#include<map>
#include <iomanip>
#include <time.h>
#include <stdlib.h>
#include <list>
#include <typeinfo>
#include <list>
#include <set>
#include <cassert>
#include<fstream>
#include <unordered_map>
#include <cstdlib>
#include <complex>
#include <cctype>
using namespace std;
typedef string::const_iterator State;
#define Ma_PI 3.141592653589793
#define eps 0.00000001
#define LONG_INF 1e18
#define GOLD 1.61803398874989484820458
#define MAX_MOD 1000000007
#define MOD 998244353
#define seg_size 262144
#define REP(i,n) for(long long i = 0;i < n;++i)
vector<pair<int, int>> edges[200000];
int used[200000];
int visited[200000];
vector<pair<int,int>> answer_edges;
int dfs(int now) {
	visited[now] = 1;
	int cnt = 0;
	for (int q = 0; q < edges[now].size(); ++q) {
		if (used[edges[now][q].second] == 0) {
			used[edges[now][q].second] = 1;
			if (visited[edges[now][q].first] == 1) {
				answer_edges.push_back(make_pair(now, edges[now][q].first));
				cnt++;
			}
			else {
				int hoge = dfs(edges[now][q].first);
				if (hoge == 0) {//can go
					answer_edges.push_back(make_pair(now, edges[now][q].first));
					cnt++;
				}
				else {
					answer_edges.push_back(make_pair(edges[now][q].first, now));
				}
			}
		}
	}
	if (cnt%2 == 0) {
		return 0;
	}
	else {
		return 1;
	}
}
int main() {
	int n,m;
	cin >> n >> m;
	if (m % 2 == 1) {
		cout << -1 << endl;
		return 0;
	}
	REP(i, m) {
		int a, b;
		cin >> a >> b;
		a--;
		b--;
		edges[a].push_back(make_pair(b, i));
		edges[b].push_back(make_pair(a, i));
	}
	REP(i, n) {
		if (edges[i].size() % 2 == 0) {
			if (dfs(i) == 0) {
				break;
			}
			else {
				answer_edges.clear();
				REP(q, m) {
					used[q] = 0;
				}
				REP(q, n) {
					visited[q] = 0;
				}
			}
		}
	}
	if (answer_edges.size() == 0) {
		REP(i, n) {
			if (edges[i].size() % 2 == 1) {
				if (dfs(i) == 0) {
					break;
				}
				else {
					answer_edges.clear();
					REP(q, m) {
						used[q] = 0;
					}
					REP(q, n) {
						visited[q] = 0;
					}
				}
			}
		}
	}
	REP(i, answer_edges.size()) {
		cout << answer_edges[i].first+1 << " " << answer_edges[i].second+1 << endl;
	}
	return 0;
}

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

const int maxn = 200010;
int n, ans[maxn];
bool mark[maxn];
vector<int> G[maxn], V[2];

int main() {
    scanf("%d", &n);
    for (int i = 1, u, v; i < n; i++) {
        scanf("%d %d", &u, &v);
        G[u].push_back(v), G[v].push_back(u);
    }
    function<void(int, int, int)> dfs = [&](int v, int fa, int d) {
        V[d].push_back(v);
        for (int u : G[v]) if (u ^ fa) dfs(u, v, d ^ 1);
    };
    dfs(1, 0, 0);
    if (V[0].size() > V[1].size()) swap(V[0], V[1]);
    if (V[0].size() <= n / 3) {
        for (int i = 0; i < V[0].size(); i++) {
            ans[V[0][i]] = (i + 1) * 3, mark[(i + 1) * 3] = 1;
        }
    } else {
        int t = min((n + 2) / 3, (int)V[0].size());
        for (int i = 0; i < t; i++) {
            ans[V[0][i]] = i * 3 + 1, mark[i * 3 + 1] = 1;
        }
        for (int i = t; i < V[0].size(); i++) {
            ans[V[0][i]] = (i - t + 1) * 3, mark[(i - t + 1) * 3] = 1;
        }
    }
    int cur = 1;
    for (int i = 1; i <= n; i++) if (!ans[i]) {
        while (mark[cur]) cur++;
        ans[i] = cur, mark[cur] = 1;
    }
    for (int i = 1; i <= n; i++) {
        printf("%d ", ans[i]);
    }
    return 0;
}

Measured memory_bytes: 21748
package main

import (
	"fmt"
	// "math"
)

func main() {
	var s string
	fmt.Scan(&s)

	w := [3]string{
		"Sunny",
		"Cloudy",
		"Rainy"}

	// if s == "Sunny" {
	// 	fmt.Println("Cloudy")
	// } else if s == "Cloudy" {
	// 	fmt.Println("Rainy")
	// } else if s == "Rainy" {
	// 	fmt.Println("Sunny")
	// }

	var ans string
	switch s {
	case w[0]:
		ans = w[1]
	case w[1]:
		ans = w[2]
	default:
		ans = w[0]
	}
	fmt.Println(ans)
}


Measured memory_bytes: 512
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>

struct sp
{
	std::string str;
	int score;
	int index;
};

int main()
{
	int n;
	std::cin >> n;

	std::vector<sp> sps(n);
	for (int i = 0; i < n; i++) {
		std::cin >> sps[i].str >> sps[i].score;
		sps[i].index = i + 1;
	}

	std::sort(sps.begin(), sps.end(), [](sp a, sp b)
	{
		if (a.str < b.str)
			return true;
		else if (a.str == b.str) {
			return a.score > b.score;
		}
		else {
			return false;
		}
	});

	for (auto& s : sps) {
		std::cout << s.index << std::endl;
	}
}

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

int main()
{
	int n,m;
	cin>>n>>m;
	int kali=1;
	for (int i=1;i<=m;i++)
	 kali*=2;
	int ans=((1900*m)+(100*(n-m)))*(kali);
	cout<<ans<<"\n";
}

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

using namespace std;
using ll = long long;

int gcd(int a, int b) { return (b == 0) ? a : gcd(b, a % b); }

#define CIN(T, x) T x; cin >> x;
#define CINS(T, x, N) vector<T> x(N); for(int i = 0; i < (N); i++) { cin >> x[i]; }
#define SHOW(x) for(int i = 0; i < x.size(); i++) { cout << x[i] << " "; } cout << "\n";
#define SHOW2(x) for(int j = 0; j < x.size(); j++) { SHOW(x[j]); } cout << "\n";


int main() {

    CIN(int, N);
    CIN(int, Y);
    //   X + Y +Z = N
    // 10X +5Y +Z = Y / 1000
    // => 5Y+9Z = 10N - Y/1000

    int sum = 10 * N - Y / 1000;
    for (int i = 0; i <= sum; i++) {

        int tempY = sum - 9 * i;
        int x, y, z;
        z = i;
        y = tempY / 5;
        x = N - y - z;

        if (x >= 0 && tempY >= 0 && tempY % 5 == 0) {
            cout << x << " " << y << " " << z << "\n";
            return 0;
        }
    }

    cout << "-1 -1 -1" << "\n";
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define endl "\n"
#define fo(i,s,e) for( i=s;i<e;i++)
#define rfo(i,s,e) for(i=s;i>e;i--)
#define LL long long int
const LL MOD=1e9+7;
#define pb push_back
#define pob pop_back()
#define sp " "
#define ff first
#define ss second
//            When something is important enough, you do it even if the odds are not in your favor.

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);cout.tie(NULL);
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif
    // code goes here
    LL t=1;//cin>>t;
    while(t--){
      LL n,i;cin>>n;
      LL a[n],b[n];
      fo(i,0,n) cin>>a[i];
      fo(i,0,n) cin>>b[i];
      reverse(b,b+n);
      LL l=-1,r=-1;
      fo(i,0,n){
        if(a[i]==b[i]){
          if(l==-1) l=i;
          r=i;
        }
      }
      bool f=0;
      if(l!=-1){
        LL x=r-l+1,y=a[l];
        LL p=l;
        fo(i,0,l){
          if(x==0) break;
          if(a[i]!=y&&b[i]!=y){
            swap(b[i],b[p]);
            p++;x--;
          }
        }
        fo(i,r+1,n){
          if(x==0) break;
          if(a[i]!=y&&b[i]!=y){
            x--;
            swap(b[i],b[p]);
            p++;
          }
        }
        if(x>0) f=1;
      }
      if(f) cout<<"No";
      else{
        cout<<"Yes"<<endl;
        fo(i,0,n) cout<<b[i]<<sp;
      }
    }
    return 0;
}

Measured memory_bytes: 6752
N = gets.to_i
ss = N.times.map { gets.chomp.split("").sort.join("") }
count = 0

hash = {}
ss.map { |e|
  if hash[e].nil?
    hash[e] = 1
  else
    hash[e] += 1
  end
}

count = 0
hash.each do |key, value|
  if value > 1
    count += (value * (value-1))/2
  end
end
puts count


Measured memory_bytes: 33404
#include<iostream>
#include<stdio.h>
#include<vector>
#include<cmath>
#include<queue>
#include<string.h>
#include<map>
#include<set>
#include<algorithm>
#define ll long long
#define pi pair < ll,ll >
#define mp(a,b) make_pair(a,b)
#define rep(i,a,b) for(int i = a;i < b;i++)
#define N 300004
#define INF 1e9+7

using namespace std;

ll n,k,ar[N],dp[N];

ll abso(ll x)
{
    if(x<0)
        return -x;
    return x;
}

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

    cin >> n;

    rep(i,0,n)
    {
        cin >> ar[i];
    }

    dp[0] = 0;
    dp[1] = abso(ar[1]-ar[0]);

    rep(i,2,n)
        dp[i] = min(dp[i-1]+abso(ar[i]-ar[i-1]),dp[i-2]+abso(ar[i]-ar[i-2]));

    cout << dp[n-1];

    return 0;
}


Measured memory_bytes: 3072
#include <stdio.h>          // printf(), putchar(), scanf()
#include <stdlib.h>         // qsort()
#include <stdbool.h>

#define MAX_N 10

typedef struct rank_tbl
{
	char name[21];
	int seq;
	int score;
} rank_t;

int
cmp_func(const void *l_, const void *r_)
{
	const rank_t *l = (const rank_t*) l_;
	const rank_t *r = (const rank_t*) r_;

	if (l->score < r->score)
		return 1;

	if (l->score > r->score)
		return -1;

	if (l->seq < r->seq)
		return -1;

	if (l->seq > r->seq)
		return 1;

	return 0;
}

int
main(int argc, char **argv)
{
	rank_t rank[MAX_N];

	bool f = false;
	while (true)
	{
		int n;
		scanf("%d", &n);
		if (n == 0)
			break;

		for (int i = 0; i < n; ++i)
		{
			int w, d;
			scanf("%s%d%*d%d", rank[i].name, &w, &d);

			rank[i].seq = i;
			rank[i].score = 3 * w + d;
		}

		qsort(rank, n, sizeof(rank_t), cmp_func);

		if (f)
			putchar('\n');

		for (int i = 0; i < n; ++i)
			printf("%s,%d\n", rank[i].name, rank[i].score);

		f = true;
	}

	return 0;
}

Measured memory_bytes: 1728
parseInput input = map read $ words input :: [Int]

solve a b | even (a * b) = "No"
          | odd a && even b = "No"
          | even a && odd b = "No"
          | otherwise = "Yes"

main = do
    input <- getLine
    let [a, b] = parseInput input
    putStrLn (solve a b)


Measured memory_bytes: 508
import           Control.Monad
import           Data.Maybe

main :: IO ()
main = do
  n <- readLn
  replicateM_ n $ getLine >>= printResult . solve . map read . words
  where
    printResult True  = putStrLn "YES"
    printResult False = putStrLn "NO"

solve :: [Int] -> Bool
solve = isJust . foldM f (0, 0)
  where
    f (l, r) i
      | l < i     = Just (i, r)
      | r < i     = Just (l, i)
      | otherwise = Nothing

Measured memory_bytes: 3988
#include <stdio.h>
#define N 100
int main(){
  int a[N];
  int x,i,j,minj,c=0,d;
  scanf("%d",&x);
  for(i=0;i<x;i++){
    scanf("%d",&a[i]);
  }
  for(i=0;i<x;i++){
    minj=i;
    for(j=i;j<x;j++){
      if(a[j]<a[minj]){
	minj=j;
      }
    }
    if(a[i]!=a[minj]){
      d=a[i];
      a[i]=a[minj];
      a[minj]=d;
      c++;
    }
  }
  for(i=0;i<x-1;i++){
    printf("%d ",a[i]);
  }
  printf("%d\n%d\n",a[i],c);
  return 0;
}


Measured memory_bytes: 2144
#include<bits/stdc++.h>
#pragma warning(disable:4996)
using namespace std;
using ll = long long;
const int dx[4] = { 1,0,-1,0 }, dy[4] = { 0,1,0,-1 };
ll a[100000];
//ll sum[100000];
int main() {
	ll N, M;
	scanf("%lld %lld", &N, &M);
	vector<ll>sum(N + 1,0);
	for (int i = 0; i < N; i++) {
		scanf("%lld", &a[i]);
	}
	for (int i = 0; i < N; i++) {
		sum[i + 1] = (sum[i] + a[i])%M;
	}
	map<ll, ll>u_mp;
	for (int i = 0; i < N + 1; i++) {
		u_mp[sum[i]]++;
	}
	ll ans = 0;
	for (auto e : u_mp) {
		ans += e.second*(e.second - 1) / 2;
	}
	cout << ans << endl;
}


Measured memory_bytes: 5760
#include<stdio.h>
int main(void){
	int a,b,c,i,kosuu ;
	kosuu=0 ;
	scanf("%d %d %d",&a,&b,&c) ;
	for(i=a ;i<=b ;i++){
		if(c%i==0){
			kosuu++ ;
		}
	}
	printf("%d\n",kosuu) ;
	return 0 ;
}

Measured memory_bytes: 596
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n,ml;
	float a[50],mi=1001;
	cin>>n;
	for(int t=0;t<n;t++)
	{
		cin>>a[t];
	}
	sort(a,a+n);
	for(int t=1;t<n;t++)
	{
		a[t]=(a[t-1]+a[t])/2;
		//cout<<b[t]<<" ";
	}
	cout<<a[n-1];
	return 0;
} 

Measured memory_bytes: 256
N = int(input())
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
import math

if N%min(A,B,C,D,E) ==0:
  print(5 + N//min(A,B,C,D,E)-1)
else:
  print(5+N//min(A,B,C,D,E))

Measured memory_bytes: 3064
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Ccs
{
    class Program
    {
        static void Main( string[] args ) {
            var n = Int64.Parse( Console.ReadLine() );

            var lim = Math.Sqrt( n ) + 1;

            Int64 ans = n;
            for( Int64 i = 1; i < lim; ++i)
            {
                if (n % i != 0)
                    continue;

                var a = g( i );
                var b = g( n / i );
                var t = Math.Max( a, b );
                //Console.WriteLine( ""+a+" "+b+" "+t );
                ans = Math.Min( ans, t );

            }

            Console.WriteLine( ans );
        }

        static Int64 g( Int64 x) {
            return 
                (Int64)(
                    Math.Floor(  Math.Log10( x ) )
                    ) + 1;
        }
    }
}


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

#define NIL -1
#define MAX 500000

typedef struct{
  int parent;
  int left;
  int right;
  int key;
}node;

void insert(int);
void inorder(int);
void preorder(int);

int root=-1;
node T[MAX];

int main(){
  int n, num,  i;
  char command[10];

  scanf("%d", &n);

  for( i=0 ; i<n ; i++ ){
    T[i].parent = NIL;
    T[i].left = NIL;
    T[i].right = NIL;
  }
    
  for( i=0 ; i<n ; i++ ){
    scanf("%s",command);
    
    if(strcmp(command, "insert") == 0){
      scanf("%d",&T[i].key);
      insert(i);
    }
    else if(strcmp(command, "print") == 0){
      inorder(0);
      printf("\n");
      preorder(0);
      printf("\n");
    }
  }

  return 0;
}

void insert(int z){
  int x = root;
  int y = NIL;
  
  while(x != NIL){
    y = x;
    
    if(T[z].key < T[x].key){
      x = T[x].left;
    }
    else{
      x = T[x].right;
    }
  }
  T[z].parent = y;

  //T???????????´???
  if(y == NIL){
    root = z;
  }
  else if(T[z].key < T[y].key){
    T[y].left = z;
  }
  else{
    T[y].right = z;
  }
}

void inorder(int x){
  if(x != NIL){
    inorder(T[x].left);
    printf(" %d", T[x].key);
    inorder(T[x].right);
  }
}

void preorder(int x){
  if(x != NIL){
    printf(" %d", T[x].key);
    preorder(T[x].left);
    preorder(T[x].right);
  }
}

Measured memory_bytes: 8416
#include <bits/stdc++.h>
#define PB push_back
#define MP make_pair
#define F first
#define S second
#define SZ(x) ((int)(x).size())
#define ALL(x) (x).begin(),(x).end()
#ifdef _DEBUG_
	#define debug(...) printf(__VA_ARGS__)
#else
	#define debug(...) (void)0
#endif
using namespace std;
typedef long long ll;
typedef pair<int,int> PII;
typedef vector<int> VI;

int main() {
	int H, W, d;
	cin >> H >> W >> d;
	if (d % 2 == 1) {
		for (int i = 0; i < H; i++) {
			for (int j = 0; j < W; j++)
				putchar((i + j) % 2 == 1 ? 'R' : 'B');
			puts("");
		}
	}
	else {
		for (int i = 0; i < H; i++) {
			for (int j = 0; j < W; j++) {
				int x = (i + j) % (2 * d);
				int y = (i - j + H + W) % (2 * d);
				x /= d;
				y /= d;
				if (x == 0) {
					if (y == 0) putchar('R');
					else putchar('B');
				}
				else {
					if (y == 0) putchar('G');
					else putchar('Y');
				}
			}
			puts("");
		}
	}
	return 0;
}


Measured memory_bytes: 512
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Stack;
public class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in));
	        String[] strArray = bufferedReader.readLine().split(" ");
	        Stack<Integer> stack = new Stack<Integer>();
	         
	        for(int i = 0; i < strArray.length ; i++){
	            char input = strArray[i].charAt(0);
	            if(Character.isDigit(input)){
	            	// ??°????????´?????????push???????????????
	                stack.push(Integer.parseInt(strArray[i]));
	            }
	            else {
	                int tmp = 0; 
	                switch (input) {
					case '+':
						tmp = stack.pop() + stack.pop();
						break;
					case '-':
						tmp = - (stack.pop() - stack.pop());
						break;
					case '*':
						tmp = stack.pop() * stack.pop();
						break;
					default:
						break;
					}
	                // ????????§?¨??????????????????????push???????????????
	                stack.push(tmp);
	            }
	        }
	         
	        System.out.println(stack.pop());
	    }
	 
	}

Measured memory_bytes: 24340
/* To Kaise Hain Aaplog*/

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define deb(x) cout << #x << "=" << x << endl
#define deb2(x, y) cout << #x << "=" << x << "," << #y << "=" << y << endl
#define all(x) (x).begin(), (x).end()

void shuru_krte_hai_bina_kisi_bakchodi_ke()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif // ONLINE_JUDGE
}
const ll m = 998244353;
const int sizze = 2 * (1e5) + 10;

vector<int> v[1001];
bool mycompare(pair<int, int> p1, pair<int, int> p2)
{
    if (p1.first != p2.first)
    {
        return p1.first > p2.first;
    }
    else
    {
        return v[p1.second].size() < v[p2.second].size();
    }
}
int main()
{
    //shuru_krte_hai_bina_kisi_bakchodi_ke();

    /* long long yaad se daal de har jagah*/

    ll a;
    cin>>a;
    cout<<((a)+(a*a)+(a*a*a));
    return 0;
}

Measured memory_bytes: 3616
#include<iostream>
#include<string>
using namespace std;
int main(){
    string s;
    cin >> s;
    int k;
    cin >> k;
    for(int i=0; i<k; i++){
        if(s[i]=='1'){
        }else{
            cout << s[i] << endl;
            return 0;
        }
    }
    cout << "1" << endl;
    return 0;
}



Measured memory_bytes: 3640
# -*- coding: utf-8 -*-
# C - Otoshidama
import sys

N, Y = map(int, input().split())

for x in range(N+1):
    for y in range(N+1):
        z = N - x - y
        if z < 0 or z > N - x - y:
            continue
        Z = Y - x*10000 - y*5000
        if Z < 0:
            continue
        if Z == z*1000:
            print("{} {} {}".format(x, y, z))
            sys.exit()

print("-1 -1 -1")


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

int main() {
    int a,b;
    cin>>a>>b;
    if (a<=8&&b<=8) cout<<"Yay!"<<endl;
    else cout<<":("<<endl;
}


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


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

  int res1,res2,res3,max;

  res1=a+b;
  res2=a-b;
  res3=a*b;

  max=res1;
  if(max<res2){
    max=res2;
  }
  if(max<res3){
    max=res3;
  }

  cout << max << "\n";

  return 0;
  


}

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

int n, k, q, pnt[100001];

int main(){ 
	cin >> n >> k >> q;
	for(int i = 0; i < q; i++){
		int ply;
		cin >> ply;
		pnt[ply]++;
	}
	for(int i = 1; i <= n; i++) cout << ((k - q + pnt[i] > 0) ? "Yes\n" : "No\n");
	return 0;
}



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

using namespace std;

const int N = 200000 + 10;

int a[N];

int main()
{
	long long res;
	int n, i;
	cin>>n;
	for (i=0; i<n; i++) cin>>a[i];
	sort(a, a + n);
	res = a[n-1];
	if (n % 2 == 0) for (i=n-2; i>=n/2; i--) res += a[i] * 2;
	else 
	{
		for (i=n-2; i>=n/2+1; i--) res += a[i] * 2;
		res += a[n/2];
	}
	cout<<res<<endl;
	return 0;
}

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

#define ff              first
#define ss              second
#define int             long long int
#define pb              push_back
#define mp12            make_pair
#define pii             pair<int,int>
#define vi              vector<int>
#define mii             map<int,int>
#define pq1             priority_queue<int>
#define pqr1            priority_queue<int,vi,greater<int> >
#define setbits(x)      __builtin_popcountll(x)
#define zerobits(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 FIO(){
    #ifndef SHAILESH
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif
}

int modInv(int a,int b,int m){int res=1;a=a%m;while(b>0){if(b&1){res=(res*a)%m;}a=(a*a)%m;b=b>>1;}return res;}


void solve(){
    int n,k;
    cin>>n>>k;
    int a[n];
    int dp[n+1];
    for(int i=0;i<n;i++) cin>>a[i];
    dp[0]=0;
	dp[1]=abs(a[1]-a[0]);
	for(int i=2;i<n;i++){
		int ans=INT_MAX;
		for(int j=1;j<=k;j++){
			if((i-j)>=0)
				ans=min(ans,abs(a[i]-a[i-j])+dp[i-j]);
			dp[i]=ans;
		}
	}
	cout<<dp[n-1];
	// for(int i=0;i<n;i++) cout<<dp[i]<<" ";
}

int32_t main()
{
    //FIO();
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    
    solve();


    return 0;
}

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

int main() 
{
	int a,ss;
	cin>>a;
	for(int i=1;i<=a;i++)
	{
		if(i<10 || i>99 && i<1000 || i>9999 && i<100000)ss++;
	}
	cout<<ss;
	return 0;
}

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

struct node{
  struct node *right;
  struct node *left;
  struct node *parent;
  int key;
};
typedef struct node * Node;

#define NIL NULL

Node root;

Node treeMinimum(Node x){
  while(x->left != NIL){
    x = x->left;
  }
  return x;
}

Node treeMaximum(Node x){
  while(x->right != NIL){
    x = x->right;
  }
  return x;
}

Node treeSearch(Node x, int k){
  while(x != NIL && k != x->key){
    if(k < x->key) x = x->left;
    else x = x->right;
  }
  return x;

}

Node treeSuccessor(Node x){
  Node y;
  if(x->right != NIL) return treeMinimum(x->right);

  y = x->parent;
  while(y != NIL && x == y->right){
    x = y;
    y = y->parent;
  }
  return y;
}

void treeDelete(Node z){
  Node y; // node to be deleted
  Node x; // child of y

  if(z->left == NIL || z->right == NIL) y = z;
  else y = treeSuccessor(z);

  if(y->left != NIL) x = y->left;
  else x = y->right;

  if(x != NIL) x->parent = y->parent;

  if(y->parent == NIL) root = x;
  else if(y == y->parent->left) y->parent->left = x;
  else y->parent->right = x;

  if(y != z) z->key = y->key;
  }

void insert(int k){
  Node y = NIL;
  Node x = root;
  Node z;

  z = malloc(sizeof(struct node));
  z->key = k;
  z->left = NIL;
  z->right = NIL;

  while(x != NIL){
    y = x;
    if(z->key < x->key) x = x->left;
    else x = x->right;
  }
  z->parent = y;

  if(y == NIL) root = z;
  else if(z->key < y->key) y->left = z;
  else y->right = z;
}

void inorder(Node u){
  if(u == NIL) return;
  inorder(u->left);
  printf(" %d",u->key);
  inorder(u->right);
}

void preorder(Node u){
  if(u == NIL) return;
  printf(" %d",u->key);
  preorder(u->left);
  preorder(u->right);
}


int main(){
  int n, i, x;
  char com[20];
  scanf("%d", &n);

  for ( i = 0; i < n; i++ ){
    scanf("%s", com);
    if ( com[0] == 'f' ){
      scanf("%d", &x);
      Node t = treeSearch(root, x);
      if ( t != NIL ) printf("yes\n");
      else printf("no\n");
    } else if ( com[0] == 'i' ){
      scanf("%d", &x);
      insert(x);
    } else if ( com[0] == 'p' ){
      inorder(root);
      printf("\n");
      preorder(root);
      printf("\n");
    } else if ( com[0] == 'd' ){
      scanf("%d", &x);
      treeDelete(treeSearch(root, x));
    }
    else if(strcmp(com,"print")){
      inorder(root);
      printf("\n");
      preorder(root);
      printf("\n");
    }
  }

  return 0;
}



Measured memory_bytes: 20520
import java.util.*;
import java.util.function.*;
public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int[] A = new int[N];
    int[][] x = new int[N][];
    int[][] y = new int[N][];
    for (int i = 0; i < N; i++) {
      A[i] = sc.nextInt();
      x[i] = new int[A[i]];
      y[i] = new int[A[i]];
      for (int j = 0; j < A[i]; j++) {
        x[i][j] = sc.nextInt();
        y[i][j] = sc.nextInt();
      }
    }
    sc.close();

    int ans = 0;
    for (int n = 1; n < (int) Math.pow(2 , N); n++) {
      int[] ns = new int[N];
      for (int i = 0; i < N; i++)
        ns[i] = (n & (int) Math.pow(2 , i)) == 0 ? 0 : 1;
      
      boolean h = true;
      for (int i = 0; h && i < N; i++)
        if (ns[i] != 0)
          for (int j = 0; h && j < x[i].length; j++)
            if (y[i][j] != ns[x[i][j] - 1]) h = false;
      if (!h) continue;

      int a = 0;
      for (int i = 0; i < N; i++) a+= ns[i];
      ans = Math.max(ans, a);
    }
    System.out.println(ans);
  }
}


Measured memory_bytes: 26836
//Moh_K_Imar .......
//24/08/2020  ... 5,30 .
//Ya Rab....
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using ld=long double;
int main(){
    ll a,b,c;
    cin>>a>>b>>c;
    if(a==b&&a!=c)cout<<"Yes"<<endl;
    else if(a==c&&a!=b)cout<<"Yes"<<endl;
    else if(b==c&&b!=a)cout<<"Yes"<<endl;
    else cout<<"No"<<endl;

    return 0;
}



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

using namespace std;

typedef long long LL;
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ii> vii;

#define INF 100000000

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

	string stones;
	cin >> stones;
	int W = 0, R = 0;
	for (int i = 0; i < stones.size(); i++)
		if (stones[i] == 'W')
			W++;
		else
			R++;

	int Rwrong = 0, Wwrong = 0;
	for (int i = 0; i < stones.size(); i++)
		if (i < R && stones[i] == 'W')
			Rwrong++;
		else if (i >= R && stones[i] == 'R')
			Wwrong++;
	cout << Rwrong + Wwrong - min(Rwrong, Wwrong) << endl;
}



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

int lcs(string X,string Y){
  int c[1001][1001];
  int m = X.size();
  int n = Y.size();
  int maxl = 0;
  X = ' ' + X;
  Y = ' ' + Y;
  for(int i=0;i<=m;i++) c[i][0]=0;
  for(int j=1;j<=n;j++) c[0][j]=0;
  for(int i=1;i<=m;i++){
    for(int j=1;j<=n;j++){
      if(X[i]==Y[j]) c[i][j]=c[i-1][j-1]+1;
      else c[i][j]=max(c[i-1][j],c[i][j-1]);
      maxl=max(maxl,c[i][j]);
    }
  }
  return maxl;
}

int main(){
  int q;cin>>q;
  while(q--){
    string a,b;cin>>a>>b;
    cout<<lcs(a,b)<<endl;
  }
  return 0;
}



Measured memory_bytes: 7052
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
const int INF = 1e9;
const int MOD = INF+7;
const ll LINF = 1e18;
#define rep(i,N) for(int (i)=0;(i)<(N);++(i))
#define rrep(i,N) for(int (i)=(N-1);(i)>0;--i)
#define FOR(i,j,N) for(int (i)=(j);(i)<(N);++(i))
#define put(n) cout<<(n)<<endl;
#define all(v) v.begin(),v.end()
#define MP make_pair
#define pb(n) push_back(n)


int main(){
    int N,A,B;
    cin >> N >> A >> B;
    cout << min(A,B) << " " << max(min(A,B) - (N - max(A,B)),0)<< endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
const long long INF = 1e7 + 1;
const long long MOD = 1000000007;
const long double PI = 3.1415926;
#define FOR(i,r,n) for(ll i = (ll)(r); i < (ll)(n); i++)
#define RFOR(i,r,n) for(ll i=(ll)(n-1);i>=r;i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define ALL(x) x.begin(),x.end()
#define RALL(x) x.rbegin(),x.rend()
typedef long long int ll;
typedef vector<ll> vi;
typedef vector < pair<ll, ll > > vp;
typedef vector <string> vs;
typedef vector <char> vc;
typedef list <ll> lst;

ll n, m, k, ans = 0, sum = 0, cnt = 0;
string s;
char c;

#define Endl endl


/*--------------------template--------------------*/


int main() {
    cin >> n >> m;
    cout << n*n - m << endl;
}

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

using namespace std;

typedef pair<int,int> ii;
#define ll long long
#define pb push_back
#define mp make_pair
#define ff first
#define ss second

ll mod = 1000000007;

int main(){
	int n;
	scanf("%d",&n);
	int ans = 100;
	for(int i = 0; i < n; i++){
		int x;
		scanf("%d",&x);
		int qtd = 0;
		while(x % 2 == 0){
			qtd++;
			x /= 2;
		}
		ans = min(ans, qtd);
	}
	printf("%d\n",ans );
}


Measured memory_bytes: 256
import java.util.Scanner;

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

		while(scan.hasNext()){
			w = scan.next();
			char ch[] = w.toCharArray();
			
			for(int i = 0; i < ch.length; i++){
				if(ch[i] == '@'){
					n = Integer.parseInt("" + ch[i + 1]);
					for(int j = 0; j < n; j++){
						System.out.print(ch[i + 2]);
					}
					i += 2;
				}else System.out.print(ch[i]);
			}
			System.out.println();
		}
	}
}

Measured memory_bytes: 26108
import java.util.*

fun main(args: Array<String>) {
    val scanner = Scanner(System.`in`)
    val n = scanner.nextInt()
    val a = Array(n, {0})
    val b = mutableListOf<Int>()
    val sum = Array(n, {0})
    var count = 0
    for(i in 0..n-1){
        a[i] = scanner.nextInt()
    }
    var index = n
    for(i in 0..n-1){
        if(sum[index-1] % 2 !== a[index-1]){
          b.add(index)
          count++
            var j=1
            while(j*j <= index){
                if(index%j === 0){
                    sum[j-1]++
                    if(j != index / j) sum[index/j-1]++
                }
                j++
            }
        }
        //else b[n-1-i] = 0
        index--
    }
    println(count)
    for(i in 0..b.size-1){
        print("${b[i]} ")
    }
}

Measured memory_bytes: 76436
#include<bits/stdc++.h>
	#define int long long
	#define rep(i,m,n) for(int i=m;i<n;i++)
	#define repr(i,n,m) for(int i=n;i>=m ;i--)
	#define mod 1000000007
	#define float long double
	#define pb push_back
	#define mp make_pair
	#define print(v) for(int i=0;i<v.size();i++) cout<<v[i]<<" ";cout<<endl
	using namespace std;
	 
	bool sortbysec(const pair<int,int> &a, 
	              const pair<int,int> &b) 
	{ 
	    return (a.second < b.second); 
	}
	bool sortinrev(const pair<int,int> &a,  
	               const pair<int,int> &b) 
	{ 
	       return (a.first > b.first); 
	}
	void swap(int *a,int *b)
	{
		int t=*a;
		*a=*b;
		*b=t;
	}
	void solve()
	{
		string s;
		cin>>s;
		if(s[2]==s[3]&&s[4]==s[5])
			cout<<"Yes";
		else
			cout<<"No";
	}
	signed main()
	{ 
		  
	   int t=1; 	
	   //cin>>t;
	   while(t--)
	   {
	      solve();
	      cout<<"\n";
	   }
	   cerr<<"time taken : "<<(float)clock()/CLOCKS_PER_SEC<<" secs"<<endl;
	  return 0;
	 }		

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

int main(){
  int i,data[31];
  for(i = 0;i < 31; i++){
    data[i]=0;
  }

  for(int i = 0; i < 28; i++){
    int number;
    cin >> number;
    data[number]=1;
  }

  for(i = 1; i <=30; i++){
    if(data[i]==0)cout << i << endl;
  }
  return 0;
}

Measured memory_bytes: 1160
import java.util.Scanner;
import java.util.Arrays;
public class Main{
	public static void main(String[] args){
		Scanner sc=new Scanner(System.in);
		int t = sc.nextInt();
		int y = sc.nextInt();
		int[] a = new int[y];
		int[] b = new int[y-1];
		for(int i = 0; i<y; i++){
			int x = sc.nextInt();
			a[i]=x;
		}
		if(t>=y){
			System.out.println(0);
			return;
		}
		Arrays.sort(a);
		int e = a[y-1]-a[0];
		for(int i = 0; i<y-1; i++){
			b[i]=Math.abs(a[i+1]-a[i]);
		}
		Arrays.sort(b);
		for(int i = 0; i<t-1; i++){
			e-=b[y-2-i];
		}
		System.out.println(e);
	}
}

Measured memory_bytes: 50388
#include<bits/stdc++.h>
using namespace std;
int main(){
    int n;
    cin>>n;
    double prob[n+1];
    double dp[n+1][n+1];
    for(int i=1;i<=n;i++){
        cin>>prob[i];
        dp[0][i] = 0.0;
    }
    dp[0][0] = 1.0;
    for(int i=1;i<=n;i++){
        for(int j=0;j<=i;j++){
            if(j==0){
                dp[i][j] = dp[i-1][j]*(1.0-prob[i]);
            }
            else{
                dp[i][j] = dp[i-1][j-1]*prob[i] + dp[i-1][j]*(1.0-prob[i]);
            }
        }
    }
    double ans = 0.0;
    for(int j=n/2+1;j<=n;j++){
        ans += dp[n][j];
    }
    cout<<fixed<<setprecision(9)<<ans;
    return 0;
}


Measured memory_bytes: 70400
s = input()
t = input()
if not set(t) <= set(s):
  print(-1)
else:
  a = 0
  seq = s
  for k in t: 
    p = seq.find(k) + 1
    if p == 0:
      p = s.find(k) + 1
      a += len(seq)
      seq = s
    a += p
    seq = seq[p:]
  print(a)

Measured memory_bytes: 3444
s, t = input(), input()
ans = "Yes"
dct = {i:set() for i in t}
for i in range(len(s)): dct[t[i]].add(s[i])
for i in dct.items():
    if len(i[1])>1:ans="No"
dct = {i:set() for i in s}
for i in range(len(s)): dct[s[i]].add(t[i])
for i in dct.items():
    if len(i[1])>1:ans="No"
print(ans)

Measured memory_bytes: 3632
#include<cstdio>
typedef struct{
  int j;
  int o;
  int i;
} P;
char maze[1024][1024];
P x[1024][1024];
P solve(int x1, int y1, int x2, int y2){
  P p;
  p.j = x[x2][y2].j - x[x1 - 1][y2].j - x[x2][y1 - 1].j + x[x1 - 1][y1 - 1].j;
  p.o = x[x2][y2].o - x[x1 - 1][y2].o - x[x2][y1 - 1].o + x[x1 - 1][y1 - 1].o;
  p.i = x[x2][y2].i - x[x1 - 1][y2].i - x[x2][y1 - 1].i + x[x1 - 1][y1 - 1].i;
  return p;
}
int main(void){
  int m, n, k;
  int a, b, c, d;
  P p;

  scanf("%d %d %d", &m, &n, &k);
  for(int i = 0;i < m; i++) scanf("%s", maze[i]);

  for(int i = 0;i < m; i++){
    for(int j = 0;j < n; j++){
      p = solve(1, 1, i + 1, j);
      x[i + 1][j + 1].j = p.j; x[i + 1][j + 1].o = p.o; x[i + 1][j + 1].i = p.i;      p = solve(1, 1, i, j + 1);
      x[i + 1][j + 1].j += p.j; x[i + 1][j + 1].o += p.o; x[i + 1][j + 1].i += p.i;
      p = solve(1, 1, i, j);
      x[i + 1][j + 1].j -= p.j; x[i + 1][j + 1].o -= p.o; x[i + 1][j + 1].i -= p.i;
      if(maze[i][j] == 'J') x[i + 1][j + 1].j++;
      if(maze[i][j] == 'O') x[i + 1][j + 1].o++;
      if(maze[i][j] == 'I') x[i + 1][j + 1].i++;
    }
  }

  for(int i = 0;i < k; i++){
    scanf("%d %d %d %d", &a, &b, &c, &d);
    p = solve(a, b, c, d);
    printf("%d %d %d\n", p.j, p.o, p.i);
  }
}


Measured memory_bytes: 14300
#include <bits/stdc++.h>
#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define rep1(i, n) for (ll i = 1; i <= (n); ++i)
#define rrep(i, n) for (ll i = (n - 1); i >= 0; --i)
#define ALL(obj) (obj).begin(), (obj).end()
#define pb push_back
#define to_s to_string
#define len(v) (ll)v.size()
#define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end())
#define print(x) cout << (x) << '\n'
#define debug(x) cout << #x << ": " << (x) << '\n'
using namespace std;
using ll = long long;
typedef pair<ll, ll> P;
ll MOD = 1e9 + 7;
ll devc(ll x, ll y) { return 1 + (x - 1) / y; }

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(0);
    cout << fixed << setprecision(20);

    int N;
    cin >> N;
    int a, b;
    cin >> a >> b;
    int x = 0, y = abs(a - b);
    int h, tpy, tpb;

    rep(i, N - 2){
        cin >> h;
        tpy = y;

        y = min(x + abs(h - a), y + abs(h - b));
        x = tpy;

        tpb = b;
        b = h;
        a = tpb;
    }

    print(y);

    return 0;
}

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

using namespace std;

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

int main(void)
{
  int n;
  cin >> n;
  vec<int> h(n);
  rep(i, n) cin >> h[i];

  int count = 0;
  rep(i, 100) {
    int prev = 0;
    rep(j, n) {
      if (h[j] == 100 - i) {
        h[j]--;
        if (!prev) {
          prev = 1;
          count++;
        }
      } else {
        prev = 0;
      }
    }
  }
  cout << count << endl;
  return 0;
}


Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

class Program
{
    static void Main(string[] args)
    {
        var n = int.Parse(Console.ReadLine());
        var d = Array.ConvertAll(Console.ReadLine().Split(), int.Parse);

        var ans = 0L;
        for (int i = 0; i < n - 1; i++)
        {
            for (int j = i + 1; j < n; j++)
            {
                ans += d[i] * d[j];
            }
        }

        Console.WriteLine(ans);
    }
}


Measured memory_bytes: 11220
#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") << '\n';
#define CFYN(n) cout << ( (n) ? "YES":"NO") << '\n';
#define OUT(n) cout << (n) << '\n';
using ll = long long;
using ull = unsigned long long;
using pii = pair<int,int>;
using pll = pair<ll,ll>;


int main(void)
{
    IOS
    int n;
    cin >> n;
    string ans;

    ll n2 = n;
    ll i = 0, d = 2;
    while(n2 != 0) {
        ll d2 = d/2;
        if (n2 % d != 0) {
            ans.push_back('1');
            if (i % 2 == 0) n2 -= d2;
            else n2 += d2;
        } else {
            ans.push_back('0');
        }
        i++; d *=2;
    }

    reverse(ALL(ans));
    if (ans.size() == 0) ans.push_back('0');
    cout << ans << '\n';

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define TASK "task"
/// 2020.08.22

using namespace std;

void rwFile() {
    freopen(TASK ".in", "r", stdin);
    freopen(TASK ".out", "w", stdout);
}

void solveA() {
    int n, x, t; cin >> n >> x >> t;
    cout << (n + x - 1) / x * t;
}

int main()
{
    ios_base::sync_with_stdio(0); cin.tie(nullptr); cout.tie(nullptr);
    //rwFile();
    solveA();
}


Measured memory_bytes: 3608
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics.Contracts;
using System.Linq;
 
public class Test152_a
{
        
        /// <summary>
        /// テスト環境の動作確認用
        /// </summary>
        public static void Main()
        {
            string[] ss = Console.ReadLine().Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
 
            int N = int.Parse(ss[0]);
            int M = int.Parse(ss[1]);
            // Yes, そうでない場合は No
            if (N == M)
            {
                Console.WriteLine("Yes");
            }
            else
            {
                Console.WriteLine("No");
            }
 
        }
}

Measured memory_bytes: 13140