akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;

int main() {
  int64_t a=2;
  int64_t b=1;
  int N;
  cin >> N;
  if(N==0)cout<<a;
  else if(N==1)cout<<b;
  else{
    for(int i=1;i<N;i++){
      int64_t temp=b;
      b=a+b;
      a=temp;
    }
    cout<<b;
  }
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

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

        if ((a + b) == c) {
            System.out.print("Yes");
        } else if (( a + c) == b) {
            System.out.print("Yes");
        }else if ((b + c) == a) {
            System.out.print("Yes");
        } else {
            System.out.print("No");
        }
    }
}


Measured memory_bytes: 22612
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cstring>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <bitset>
#include <numeric>
#include <utility>
#include <iomanip>
#include <algorithm>
#include <functional>
#include <unordered_map>
using namespace std;

#define REP(i, s) for (int i = 0; i < s; ++i)
#define ALL(v) (v.begin(), v.end())
#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl
#define EACH(i, s) for (__typeof__((s).begin()) i = (s).begin(); i != (s).end(); ++i)

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
template<class T1, class T2> ostream& operator << (ostream &s, pair<T1,T2> P)
{ return s << '<' << P.first << ", " << P.second << '>'; }
template<class T> ostream& operator << (ostream &s, vector<T> P)
{ for (int i = 0; i < P.size(); ++i) { if (i > 0) { s << " "; } s << P[i]; } return s; }
template<class T> ostream& operator << (ostream &s, vector<vector<T> > P)
{ for (int i = 0; i < P.size(); ++i) { s << endl << P[i]; } return s << endl; }
template<class T> ostream& operator << (ostream &s, set<T> P)
{ EACH(it, P) { s << "<" << *it << "> "; } return s << endl; }
template<class T1, class T2> ostream& operator << (ostream &s, map<T1,T2> P)
{ EACH(it, P) { s << "<" << it->first << "->" << it->second << "> "; } return s << endl; }


long long N, X;
vector<long long> L;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    
    while (cin >> N >> X) {
        L.resize(N);
        for (int i = 0; i < N; ++i) cin >> L[i];

        int res = 0;
        long long sum = 0;
        for (int i = 0; i < N; ++i) {
            if (sum <= X) ++res;
            sum += L[i];
        }
        if (sum <= X) ++res;
        cout << res << endl;
    }
}














Measured memory_bytes: 256
s= input()

chars = list(s)

s1 = ''
s2 = ''

for c in chars:

  if c in 'ACGT':
    s2 += c
  else:
    if len(s2) >= len(s1):
      s1 = s2
      s2 = ''

if len(s2) >= len(s1):
  print(len(s2))
else:
  print(len(s1))

Measured memory_bytes: 3060
#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <cmath>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <algorithm>
#include <complex>
#include <unordered_map>
#include <unordered_set>
#include <random>
#include <cassert>
using namespace std;
typedef long long int ll;
typedef pair<int, int> P;

int main()
{
	ll a, b, c;
	cin>>a>>b>>c;
	if(a+b+1>=c) cout<<c+b<<endl;
	else cout<<a+b+1+b<<endl;
	return 0;
}

Measured memory_bytes: 256
a = [int(i) for i in input().split()]

if 1 <= all(a) <= 10000:
    if a[1] < a[0]:
        a[0], a[1] = a[1], a[0]
    if a[2] < a[0]:
        a[0], a[2] = a[2], a[0]
    if a[2] < a[1]:
        a[1], a[2] = a[2], a[1]
else:
    print("error")

print(str(a[0]) + " " + str(a[1]) + " " + str(a[2]))


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

using namespace std;

#ifdef DEBUG_MODE
	#define DBG(n) n;
#else
	#define DBG(n) ;
#endif
#define REP(i,n) for(ll (i) = (0);(i) < (n);++i)
#define PB push_back
#define MP make_pair
#define FI first
#define SE second
#define SHOW1d(v,n) {for(int W = 0;W < (n);W++)cerr << v[W] << ' ';cerr << endl << endl;}
#define SHOW2d(v,i,j) {for(int aaa = 0;aaa < i;aaa++){for(int bbb = 0;bbb < j;bbb++)cerr << v[aaa][bbb] << ' ';cerr << endl;}cerr << endl;}
#define ALL(v) v.begin(),v.end()
#define Decimal fixed<<setprecision(20)
#define INF 1000000000
#define LLINF 1000000000000000000
#define MOD 1000000007

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

ll n,l,t,hoge;

ll check(ll a, ll b){
	ll d = (b - a + l) % l;
	if(t*2 >= d + l)return hoge + 2;
	if(t*2 >= d)return hoge + 1;
	return hoge;
}

int main(){
	
	cin >> n >> l >> t;
	hoge = (2 * (t / l)) % l;
	t %= l;
	
	vector<pair<ll, ll>> v;
	vector<pair<pair<ll,ll>, ll>> aft;
	
	REP(i,n){
		ll x,w;cin >> x >> w;
		ll af;
		if(w == 1){
			af = (x + t) % l;
		}
		else {
			af = (x - t + l) % l;
		}
		v.PB(MP(x, w));
		aft.PB(MP(MP(af,-w), i));
	}	
	sort(ALL(aft));

	ll cou = 0;
	for(ll i = 1;i < v.size();i++){
		if(v[0].SE == v[i].SE)continue;
		else{
			if(v[0].SE == 1){
				cou += check(v[0].FI, v[i].FI);
			}
			else{
				cou += (n - 1) * check(v[i].FI, v[0].FI);
			}
			cou %= n;
		}
	}
	
	vector<pair<ll,ll>> ans;
	REP(i,n){
		if(aft[i].SE == 0){
			REP(j,n){
				ans.PB(MP((cou+j)%n,aft[(i+j)%n].FI.FI));
			}
			break;
		}
	}
	
	sort(ALL(ans));
	
	REP(i,n){
		cout << ans[i].SE << endl;
	}
	
	
	return 0;
}

Measured memory_bytes: 8708
#include<iostream>
#include<string>
#include<array>
#include<algorithm>
#include<deque>
#include<vector>
#include<utility>
#include<set>
#include<map>
#include<list>

int main(void) {
	using namespace std;
	/*int N, A,res;
	cin >> N >> A;
	res = N * N - A;
	cout << res << endl;*/

	int a, b,c;
	cin >> a >> b;
	c = a * b;
	c = c % 2;
	if (c == 0) {
		cout << "Even" << endl;
	}
	else if(c == 1){
		cout << "Odd" << endl;
	}

	/*int A, B, a, b, c;
	cin >> A >> B;
	a = A + B;
	b = A - B;
	c = A * B;
	if (a > b && a > c) {
		cout << a << endl;
	}
	else if (b > a && b > c) {
		cout << b << endl;
	}
	else if (c > a && c > b) {
		cout << c << endl;
	}*/

	/*int K, S,res = 0;
	cin >> K >> S;
	for (int X = 0; X <= K;X++) {
		for (int Y = 0; Y <= K; Y++) {
			for (int Z = 0; Z <= K; Z++) {
				if (X + Y + Z == S) {
					res += 1;
				}

			}
		}
	}
	cout << res << endl;*/

	/*int N,a;
	cin >> N;
	set<int>s;
	for (int i = 0; i < N;i++) {
		cin >> a;
		s.insert(a);
	}
	cout << s.size() << endl;*/

	/*int N, a, res;
	vector<int>vec;
	cin >> N;
	for (int i = 0; i < N; i++) {
		cin >> a;
		vec.push_back(a);
	}
	sort(vec.begin(), vec.end());
	res = vec[vec.size() - 1] - vec[0];
	cout << res << endl;*/

	/*int Alice = 0, Bob = 0,a,N;
	deque<int>dec;
	cin >> N;
	for (int i = 0; i < N; i++) {
		cin >> a;
		dec.push_back(a);
	}
	sort(dec.rbegin(), dec.rend());
	for (int i = 0; i < N;i++) {
		if (i % 2 == 0) {
			Alice += dec[0];
			dec.pop_front();
		}
		else if (i % 2 == 1) {
			Bob += dec[0];
			dec.pop_front();
		}
	}
	cout << Alice - Bob << endl;*/
}

Measured memory_bytes: 256
n = int(input())
H = list(map(int, input().split()))
f = 0
H[0] -= 1
for i in range(n-1):
    if H[i+1] > H[i]:
        H[i+1] -= 1
for i in range(n-1):
    if H[i+1] < H[i]:
        f = 1      
            
if f == 0:
    print("Yes")
else:
    print("No")


Measured memory_bytes: 14252
#include<iostream>
using namespace std;
 
 
int main(){
    int x,y,t;
    while (1){
        cin >> x >> y;
         
        if (x > y){
            t = x, x = y, y = t;
        }
    if ( x == 0 && y == 0 )break;
    cout << x << " " << y << endl;
    }
     
    return 0;
     
}

Measured memory_bytes: 3076
#include <ctype.h>
#include <stdio.h>

#define MAX_CH 11

int
main(void)
{
	char s[MAX_CH];
	int i;

	for (i = 0; i < 3; i++) {
		scanf("%s", s);
		putchar(toupper(s[0]));
		if (i == 2)
			puts("");
	}
	return 0;
}


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

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

    for(int i = 0; i < 2; i++){
        if(a >= b){
            ans += a;
            a--;
        }
        else{
            ans += b;
            b--;
        }
    }

    cout << ans << endl;
}

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

typedef long long ll;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<long long> VL;
typedef vector<vector<long long>> VVL;
typedef pair<int,int> P;
typedef tuple<int,int,int> tpl;

#define ALL(a)  (a).begin(),(a).end()
#define SORT(c) sort((c).begin(),(c).end())
#define REVERSE(c) reverse((c).begin(),(c).end())
#define EXIST(m,v) (m).find((v)) != (m).end()
#define LB(a,x) lower_bound((a).begin(), (a).end(), x) - (a).begin()
#define UB(a,x) upper_bound((a).begin(), (a).end(), x) - (a).begin()

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define RFOR(i,a,b) for(int i=(a)-1;i>=(b);--i)
#define RREP(i,n) RFOR(i,n,0)

#define en "\n"

constexpr double EPS = 1e-9;
constexpr double PI  = 3.1415926535897932;
constexpr int INF = 2147483647;
constexpr long long LINF = 1LL<<60;
constexpr long long MOD = 1000000007; // 998244353;

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

void Main(){
    int n,s; cin >> n >> s;
    ll dp[n+1][n+1][n*n+200]; REP(i,n+1)REP(j,n+1)REP(k,n*n+200) dp[i][j][k] = 0;
    dp[0][0][0] = 1;

    REP(i,n)REP(j,i+1)REP(k,n*n+1){
        (dp[i+1][j][k+2*j] += dp[i][j][k]) %= MOD;
        (dp[i+1][j+1][k+2*(j+1)] += dp[i][j][k]) %= MOD;
        (dp[i+1][j][k+2*j] += dp[i][j][k]*j*2) %= MOD;
        if(j)
            (dp[i+1][j-1][k+2*(j-1)] += dp[i][j][k]*j*j) %= MOD;
    }

    ll ans = dp[n][0][s];
    cout << ans << en;
    return;
}

int main(void){
    cin.tie(0);cout.tie(0);ios_base::sync_with_stdio(0);cout<<fixed<<setprecision(15);
    int t=1; //cin>>t;
    REP(_,t) Main();
    return 0;
}

Measured memory_bytes: 58532
#include<iostream>
#include<functional>
#include<map>
#include<string>
#include<vector>
#include<climits>
#include<algorithm>
#include<cmath>
#include<utility>
#include<queue>
using namespace std;
int main(){
	int N, M;
	cin >> N >> M;
	int f = max(N*(N-1)/2,0);
	int s = max(M*(M-1)/2,0);
	cout << f+s  << endl;
	return 0;
}

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

int long long a[5],n;

int Vin(){
	int s;
	for(int i=0;i<3;i++){
		if((2^(3-i))*a[i]>=(2-i)*a[i+1])return (2^(3-i))*a[i];
	else return (2^(2-i))*a[i+1];
	}
}

int long long f(){
	return(n/2)*min(8*a[0],min(4*a[1],min(2*a[2],a[3])))+(n%2)*min(4*a[0],min(2*a[1],a[2]));	
}
int main(){
	cin>>a[0]>>a[1]>>a[2]>>a[3]>>n;
	cout<<f()<<endl;
}



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

int main() {
  vector<vector<int>> bingo(3, vector<int>(3));
  for (int i = 0; i < 3; i++) {
    for (int j = 0; j < 3; j++) {
      cin >> bingo[i][j];
    }
  }
  int N;
  cin >> N;
  for (int i = 0; i < N; i++) {
    int tmp;
    cin >> tmp;
    for (int j = 0; j < 3; j++) {
      for (int k = 0; k < 3; k++) {
        if (bingo[j][k] == tmp) bingo[j][k] = -1;
      }
    }
  }
  bool can = false;
  for (int i = 0; i < 3; i++) {
    int cnt = 0;
    for (int j = 0; j < 3; j++) {
      if (bingo[i][j] == -1) cnt++;
    }
    if (cnt == 3) can = true;
  }
  for (int i = 0; i < 3; i++) {
    int cnt = 0;
    for (int j = 0; j < 3; j++) {
      if (bingo[j][i] == -1) cnt++;
    }
    if (cnt == 3) can = true;
  }
  int tmp1 = 0;
  for (int i = 0; i < 3; i++) {
    if (bingo[i][i] == -1) tmp1++;
  }
  if (tmp1 == 3) can = true;
  int tmp2 = 0;
  for (int i = 0; i < 3; i++) {
    if (bingo[i][2-i] == -1) tmp2++;
  }
  if (tmp2 == 3) can = true;

  if (can) cout << "Yes";
  else cout << "No";
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
string s;
int n,k,x[100010];
int main(){
    cin>>n>>k;
    cin>>s;
    int t1=0,t2=0,ans=0;
    int tmp=0;
    for(int i=0;i<=s.size()-1;i++){
        if(s[i]=='L'){
            ans+=max(0,tmp-1);
            tmp=0;
        }
        else tmp++;
    }
    ans+=max(0,tmp-1);
    tmp=0;
    for(int i=s.size()-1;i>=0;i--){
        if(s[i]=='R'){
            ans+=max(0,tmp-1);
            tmp=0;
        }
        else tmp++;
    }
    ans+=max(0,tmp-1);
    //cout<<ans<<endl;
    for(int i=0;i<s.size()-1;i++){
        if(s[i]!=s[i+1]){
            if(s[i]=='L')t1++;
            else t2++;
        }
    }
    t1=min(t1,k);
    t2=min(t2,k);
    cout<<min(ans+t1+t2,n-1)<<endl;
    return 0;
}


Measured memory_bytes: 512
#include <bits/stdc++.h>
#define loop2(i, s, n, a) for (int i = int(s); i < int(n); i += a)
#define loop(i, s, n) loop2(i, s, n, 1)
#define rep(i, n) loop(i, 0, n)

#define pb push_back
#define all(in) in.begin(),in.end()

using ll = long long;
using ull = unsigned long long;
using namespace std;

int main(){
    int n, m; cin >> n >> m;
    int a = 1;
    int b = (m/2)*2+1;
    int c = b+1;
    int d = b+(m-(m/2))*2;
    rep(i,(m/2)) cout << a+i << " " << b-i << endl;
    rep(i,m-(m/2)) cout << c+i << " " << d-i << endl;
}

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

#define int long long
#define endl "\n"
#define REP(i,a,n) for(int i=a;i<n;++i)
#define REPR(i,a,n) for(int i=a;i>n;--i)
#define RUP(a,b) ((a+b-1)/(b))
#define ALL(v) (v).begin(),(v).end()
#define pb push_back
#define mp make_pair
#define mt make_tuple
//#define MOD 1000000007
#define INF LLONG_MAX/2

typedef long long ll;
typedef pair<int,int> Pii;
typedef tuple<int,int,int> Tiii;
typedef vector<int> Vi;
typedef vector<Vi> VVi;
typedef vector<Pii> VPii;
typedef vector<string> Vs;

template<class T> inline bool chmax(T& a,T b){if(a<b){a=b;return 1;}return 0;}
template<class T> inline bool chmin(T& a,T b){if(a>b){a=b;return 1;}return 0;}
template<class T> void YesNo(T a) {cout<<(a?"Yes":"No")<<endl;}
template<class T> void YESNO(T a) {cout<<(a?"YES":"NO")<<endl;}
void vin(Vi &v){REP(i,0,(v).size()) cin>>v[i];}
void vin(Vi &v,Vi &v2){REP(i,0,(v).size()) cin>>v[i]>>v2[i];}
void vout(Vi &v){for(int i=0;i<(v).size();i++) cout<<v[i]<<" ";cout<<endl;}
int gcd(int a,int b){return b?gcd(b,a%b):a;}
int lcm(int a,int b){return a/gcd(a,b)*b;}
void uniq(Vi &v){sort(v.begin(),v.end()); v.erase(unique(v.begin(),v.end()),v.end());}
int ctoi(char c){if(c>='0'&&c<='9'){return c-'0';}return 0;}
void accum(Vi &v){REP(i,1,(v).size()) v[i]+=v[i-1];}
bool comp(Pii a,Pii b){
    if(a.second != b.second) return a.second<b.second;
    else return a.first<b.first;
}


void solve(long long h){
    int count=0;
    while(h>0){
        h/=2;
        count++;
    }
    int ans=1,p=2;
    REP(i,0,count-1){
        ans += p;
        p*=2;
    }
    cout<<ans<<endl;
}

// Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
signed main(){
    long long H;
    scanf("%lld",&H);
    solve(H);
    return 0;
}


Measured memory_bytes: 256
import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().strip()

a = list(ns())
s = []
for i in ["+", "-"]:
    for j in ["+", "-"]:
        for k in ["+", "-"]:
            s.append(a[0] + i + a[1] + j + a[2] + k + a[3])

ans = 0
for i in range(len(s)):
    if s[i][1] == "+" and s[i][3] == "+" and s[i][5] == "+":
        ans = int(s[i][0]) + int(s[i][2]) + int(s[i][4]) + int(s[i][6])
        if ans == 7:
            print(str(s[i][0]) + "+" +str(s[i][2]) + "+" +str(s[i][4]) + "+" +str(s[i][6]) + "=7")
            break
    if s[i][1] == "+" and s[i][3] == "+" and s[i][5] == "-":
        ans = int(s[i][0]) + int(s[i][2]) + int(s[i][4]) - int(s[i][6])
        if ans == 7:
            print(str(s[i][0]) + "+" +str(s[i][2]) + "+" +str(s[i][4]) + "-" +str(s[i][6]) + "=7")
            break
    if s[i][1] == "+" and s[i][3] == "-" and s[i][5] == "+":
        ans = int(s[i][0]) + int(s[i][2]) - int(s[i][4]) + int(s[i][6])
        if ans == 7:
            print(str(s[i][0]) + "+" +str(s[i][2]) + "-" +str(s[i][4]) + "+" +str(s[i][6]) + "=7")
            break
    if s[i][1] == "+" and s[i][3] == "-" and s[i][5] == "-":
        ans = int(s[i][0]) + int(s[i][2]) - int(s[i][4]) - int(s[i][6])
        if ans == 7:
            print(str(s[i][0]) + "+" +str(s[i][2]) + "-" +str(s[i][4]) + "-" +str(s[i][6]) + "=7")
            break
    if s[i][1] == "-" and s[i][3] == "+" and s[i][5] == "+":
        ans = int(s[i][0]) - int(s[i][2]) + int(s[i][4]) + int(s[i][6])
        if ans == 7:
            print(str(s[i][0]) + "-" +str(s[i][2]) + "+" +str(s[i][4]) + "+" +str(s[i][6]) + "=7")
            break
    if s[i][1] == "-" and s[i][3] == "+" and s[i][5] == "-":
        ans = int(s[i][0]) - int(s[i][2]) + int(s[i][4]) - int(s[i][6])
        if ans == 7:
            print(str(s[i][0]) + "-" +str(s[i][2]) + "+" +str(s[i][4]) + "-" +str(s[i][6]) + "=7")
            break
    if s[i][1] == "-" and s[i][3] == "-" and s[i][5] == "+":
        ans = int(s[i][0]) - int(s[i][2]) - int(s[i][4]) + int(s[i][6])
        if ans == 7:
            print(str(s[i][0]) + "-" +str(s[i][2]) + "-" +str(s[i][4]) + "+" +str(s[i][6]) + "=7")
            break
    if s[i][1] == "-" and s[i][3] == "-" and s[i][5] == "-":
        ans = int(s[i][0]) - int(s[i][2]) - int(s[i][4]) - int(s[i][6])
        if ans == 7:
            print(str(s[i][0]) + "-" +str(s[i][2]) + "-" +str(s[i][4]) + "-" +str(s[i][6]) + "=7")
            break


Measured memory_bytes: 3320
<?php

fscanf(STDIN, '%d', $n);
for ($i = 1; $i <= $n; $i++) {
	fscanf(STDIN, '%d %d', $x, $y);
	$chart_points[$i] = ['x' => $x, 'y' => $y];
}

function dfs($ranged_n, $array="") {
	$result = [];
	if (count($ranged_n) == 0) {
		$result[] = $array;
	} else {
		foreach ($ranged_n as $key => $val) {
			$_array = $array . $val;
			$_ranged_n = $ranged_n;
			unset($_ranged_n[$key]);
			$pre_result = dfs($_ranged_n, $_array);
			$result = array_merge($result, $pre_result);
		}
	}
	return $result;
}

$ranged_n = range(1, $n);
$pattern_s = dfs($ranged_n);
$distance = 0;

foreach ($pattern_s as $pattern) {
	$splited_pattern = str_split($pattern);
    $i = 0;
    while ($i < $n - 1) {
        $flg = $splited_pattern[$i];
        $flg2 = $splited_pattern[$i+1];
        $distance += sqrt(pow(($chart_points[$flg]['x']-$chart_points[$flg2]['x']), 2) + pow(($chart_points[$flg]['y']-$chart_points[$flg2]['y']), 2));
        $i++;
    }
}
echo $distance / count($pattern_s);

Measured memory_bytes: 10744
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<bitset>
#include<set>
#include<map>
#include<stack>
#include<queue>
#include<deque>
#include<list>
#include<iomanip>
#include<cmath>
#include<cstring>
#include<functional>
#include<cstdio>
#include<cstdlib>
using namespace std;

#define repr(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define rep(i, n) repr(i, 0, n)
#define INF 2e9
#define MOD 1000000007
//#define MOD 998244353
#define LINF (long long)4e18
#define jck 3.141592

const double EPS = 1e-10;

using ll = long long;
using Pi = pair<int,int>;
using Pl = pair<ll,ll>;



int main(){
    ll a,b,x; cin >> a >> b >> x;
    ll ans = 0;
    if(a == 0){
        ans = b/x+1;
    }
    else{
        ans = b/x+1-((a-1)/x+1);
    }
    cout << ans << endl;
}


Measured memory_bytes: 256
#!/usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, random, itertools, math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def LI_(): return list(map(lambda x: int(x)-1, input().split()))
def II(): return int(input())
def IF(): return float(input())
def LS(): return list(map(list, input().split()))
def S(): return list(input().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = 1e10

#solve
def solve():
    n, z, w = LI()
    a = LI()
    if n == 1:
        print(abs(a[0] - w))
    else:
        print(max(abs(a[-1] - w), abs(a[-2] - a[-1])))
    return


#main
if __name__ == '__main__':
    solve()


Measured memory_bytes: 39152
#include <stdio.h>

int main(void)
{
	int inputNum;
	int sec;
	int minute;
	int hour;

	scanf("%d", &inputNum);

	if(sec < 0 || 86400 <= sec){
		return -1;
	}

	//???
	hour = inputNum / 3600;

	//???
	minute = (inputNum % 3600) / 60;

	//?§?
	sec = inputNum % 60;

	printf("%d:%d:%d\n", hour, minute, sec);

	return 0;

}

Measured memory_bytes: 592
#include <iostream>
#include <string>

int main(){
   std::string S, T;
   std::cin >> S >> T;
   int N = S.size();
   bool flag = false;
   for (int i=0; i<N; i++){
      if (S != T){
         S = S.at(N-1) + S;
         S.pop_back();
      } else{
         flag = true;
      }
   }
   if (flag)
      std::cout << "Yes" << std::endl;
   else
      std::cout << "No" << std::endl;
}



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

namespace ConsoleApp11
{
    class Class45
    {
        static void Main()
        {
            var I = Console.ReadLine().Split().Select(long.Parse).ToArray();
            var N = I[0];
            var K = I[1];
            var a = new int[N];
            var b = new int[N];
            SortedDictionary<int, long> Table = new SortedDictionary<int, long>();
            for(int i = 0; i < N; i++)
            {
                var read = Console.ReadLine().Split().Select(int.Parse).ToArray();
                if (Table.ContainsKey(read[0]))
                {
                    Table[read[0]] += read[1];
                }
                else
                {
                    Table[read[0]] = read[1];
                }
            }
            long sum = 0;
            foreach(int i in Table.Keys)
            {
                sum += Table[i];
                if (sum < K)
                    continue;
                else
                {
                    Console.WriteLine(i);
                    return;
                }
            }
        }
    }
}


Measured memory_bytes: 21056
package main

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

var sc = bufio.NewScanner(os.Stdin)
var out = bufio.NewWriter(os.Stdout)

func next() string {
	sc.Scan()
	return sc.Text()
}

func main() {
	buf := make([]byte, 1024*1024)
	sc.Buffer(buf, bufio.MaxScanTokenSize)
	defer out.Flush()

	n, _ := strconv.Atoi(next())
	switch n % 10 {
	case 2, 4, 5, 7, 9:
		fmt.Fprintln(out, "hon")
	case 3:
		fmt.Fprintln(out, "bon")
	default:
		fmt.Fprintln(out, "pon")
	}
}


Measured memory_bytes: 1792
#include<iostream>
#include<cstdio>
#include<cmath>
using namespace std;
int fr[200010],s[200010]={1};
int find(int x)
{
	if(fr[x]==x) return x;
	else return fr[x]=find(fr[x]);
}
int main()
{
	int n,m;
	scanf("%d%d",&n,&m);
	for(int i=1;i<=n;i++){
	fr[i]=i;s[i]=1;}
	for(int i=1;i<=m;i++){
		int x,y;
		scanf("%d%d",&x,&y);
		int kx=find(x),ky=find(y);
		if(kx!=ky){
			fr[ky]=kx;
			s[kx]+=s[ky];
		}
	}
	int ans=0;
	for(int i=1;i<=n;i++){
		if(fr[i]==i)
		  ans=max(ans,s[i]);
	}
	printf("%d\n",ans);
}

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

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

    if (x<a) puts("0");
    else puts("10");
    return 0;
}


Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define mp make_pair
#define pb push_back
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=(int)(n);i++)


int main(){
  ios::sync_with_stdio(false);
  cin.tie(0);
  int N;
  cin >> N;
  int a[N];
  int b[N];
  rep(i,N){
    cin >> a[i];
    b[i]=0;
  }
  vector<int>ans;
  for(int i=N-1; i>=0;i--){
    int tmp=i+1;
    int j=2;
    b[i]=a[tmp-1];
    tmp+=i+1;
    while(tmp<=N){      
      b[i]^=b[tmp-1];            
      tmp+=i+1;
    }
    if(b[i]==1) ans.pb(i+1);
  }/*  for(int i=0; i<N; i++){
    int tmp=i+1;
    int j=2;
    b[i]=a[tmp-1];
    tmp*=((double)j)/((double)j-1);
    j++;
    while(tmp<=N){
      a[tmp-1]^=b[i];
      tmp*=((double)j)/((double)j-1);
      j++;
    }
    }*/
    /*  vector<int > ans;
  rep(i,N){
    //    cout << b[i] << endl;
    if(b[i]==1) ans.pb(i+1);
    }*/
  cout << ans.size() << endl;
  if(ans.size()>0){
    rep(i,ans.size()){
      cout << ans[i] << endl;      
    }
  }
  return 0;
    

}


Measured memory_bytes: 3192
from collections import deque

N = int(input())
A = list(map(int, input().split()))

check = [0] * N

for i in reversed(range(1, N + 1)):
    x = i
    total = 0
    while x <= N:
        total += check[x - 1]
        x += i
    if total % 2 != A[i - 1]:
        check[i - 1] = 1

M = sum(check)
ans = deque()

for index, value in enumerate(check):
    if value == 1:
        ans.append(index + 1)

print(M)
if M > 0:
    print(*ans)


Measured memory_bytes: 14484
using System;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using System.Text;
using static System.Console;
using static System.Math;


namespace AtCodeeeer
{
    class AtCOOOOOOOOOOOder
    { 
        static void Main(string[] args)
        {
            int N = int.Parse(ReadLine());
            int[] ts = ReadLine().Split(' ').Select(int.Parse).ToArray();
            int m = int.Parse(ReadLine());

            for (int i = 0; i < m; i++)
            {
                var ls = new List<int>();
                ls.AddRange(ts);
                int[] s = ReadLine().Split(' ').Select(int.Parse).ToArray();
                ls[s[0]-1] = s[1];
                WriteLine(ls.Sum());
            }
        }
    }
}


Measured memory_bytes: 13396
import java.util.*;
import java.io.*;

class Main {

    public static void main(String[] args) {

	Scanner stdin = new Scanner(System.in);

	while ( stdin.hasNextLine() ) {

	    final String[] input = stdin.nextLine().split(",");
	    final double weight = Double.parseDouble( input[1] );
	    final double height = Double.parseDouble( input[2] );
	    if ( weight / ( height * height ) >= 25 ) {
		System.out.println( input[0] );
	    }	    
	}
	
    }
    
}

Measured memory_bytes: 17148
{-# LANGUAGE BangPatterns      #-}
{-# LANGUAGE OverloadedStrings #-}

import           Control.Applicative
import           Control.Monad
import qualified Data.ByteString.Char8 as B
import           Debug.Trace

import           Data.Sequence         (Seq (..), ViewL (..), ViewR (..), (<|),
                                        (><), (|>))
import qualified Data.Sequence         as S

readInt' :: B.ByteString -> Int
readInt' bs | Just (n, _) <- B.readInt bs = n

insert :: a -> Seq a -> Seq a
insert = (<|)

delete :: Eq a => a -> Seq a -> Seq a
delete x s =
    case S.viewl r of
        EmptyL -> s
        x :< xs -> l >< xs
  where
    (l, r) = S.breakl (== x) s

deleteFirst :: Seq a -> Seq a
deleteFirst s =
    case S.viewl s of
        x :< xs -> xs

deleteLast :: Seq a -> Seq a
deleteLast s =
    case S.viewr s of
        xs :> x -> xs

make :: [(B.ByteString, Int)] -> Seq Int
make xs = go S.empty xs
  where
    go !seq [] = seq
    go !seq ((com,n):cs)
        | com == "insert" = go (insert n seq) cs
        | com == "delete" = go (delete n seq) cs
        | com == "deleteFirst" = go (deleteFirst seq) cs
        | com == "deleteLast"  = go (deleteLast seq) cs

print' :: Seq Int -> IO ()
print' s =
    case S.viewl s of
        EmptyL -> putStrLn ""
        a :< s' -> putStr (show a) >> go s'
  where
    go s =
        case S.viewl s of
            EmptyL -> putStrLn ""
            a :< s' -> putStr (" " ++ show a) >> go s'

main :: IO ()
main = do
    B.getLine
    let f xs =
            case xs of
                [a]    -> (a, 0)
                [a, b] -> (a, readInt' b)
    xs <- fmap (f . B.words) . B.lines <$> B.getContents
    print' $ make xs



Measured memory_bytes: 190148
N = int(input())
A = []
for i in range(N):
    a = int(input())
    A.append(a)

B = sorted(A)
maxA = B[-1]
maxA2 = B[-2]


for i in range(N):
    if A[i] == maxA:
        print(maxA2)
    else:
        print(maxA)

Measured memory_bytes: 70104
x, k, d = map(int, input().split())
x = abs(x)
if x//d >= k:
	print(x - d*k)
elif ((x//d) ^ k) & 1:
	print(min(x%d+d, abs(x%d-d)))
else:
	print(min(x%d, abs(x%d - 2*d)))

Measured memory_bytes: 9164
let d = stdin.ReadLine() |> int
let c = stdin.ReadLine().Split() |> Array.map int
let s = [|1..d|] |> Array.map (fun _ -> stdin.ReadLine().Split() |> Array.map int)

let rec f i (lastli:int[]) vli =
    if i = d then vli
    else
        let diffli = Array.zip c s.[i] |> Array.mapi (fun id (x,y) -> y - x * (id+1 - lastli.[id]))
        let max = diffli |> Array.max
        let maxi = diffli |> Array.findIndex (fun x -> x = max)
        Array.set lastli maxi (i+1)
        Array.append vli [|maxi+1|] |> f (i+1) lastli

f 0 ([|1..26|] |> Array.map (fun _ -> 0)) [||]
|> Array.map stdout.WriteLine
|> ignore

Measured memory_bytes: 30132
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0; i < n; i++)
using namespace std;
using ll = long long;

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N;
  cin >> N;
  int t = 0;
  int x = 0;
  int y = 0;
  bool flag = true;
  for(int i = 0; i < N; i++) {
    int at, ax, ay;
    cin >> at >> ax >> ay;
    int d = abs(x - ax) + abs(y - ay);
    int dt = at - t;
    if(d <= dt && (d - dt) % 2 == 0) {
      t = at;
      x = ax;
      y = ay;
    } else {
      flag = false;
    }
  }
  if(flag) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h> 
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define int long long
#define ld double
#define fi first
#define se second
#define pb push_back
#define pii pair<int,int>
#define sz(x) ((long long)x.size())
#define all(x) (x).begin(), (x).end()
const int MOD =1e9+7;
#define oset(x) tree<x, null_type, less<x>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
int mpow(int a,int b,int p=MOD){a=a%p;int res=1;while(b>0){if(b&1)res=(res*a)%p;a=(a*a)%p;b=b>>1LL;}return res%p;}
const int N=2*1e5+2,M=201;

void solve()
{
	int n,x;
	cin>>n>>x;
	n=2*n-1;
	if(x==1||(x==n))
	{
		cout<<"No\n";
	}		
	else{
		set<int> s;
		for(int i=1;i<=n;i++) s.insert(i);
		int ans[n+1]={0};
		if(x!=2)
		{
			// cout<<"*";
			int pos=n/2;
			ans[pos]=x-1;
			pos++;
			ans[pos]=x;
			pos++;
			ans[pos]=x+1;
			pos++;
			ans[pos]=x-2;
			s.erase(x-1);
			s.erase(x);
			s.erase(x+1);
			s.erase(x-2);
			for(int i=1;i<=n;i++)
			{
				if(ans[i]==0)
				{
					ans[i]=*s.begin();
					s.erase(ans[i]);
				}
			}
		}
		else{
			int pos=n/2;
			ans[pos]=x+1;
			pos++;
			ans[pos]=x;
			pos++;
			ans[pos]=x-1;
			pos++;
			ans[pos]=x+2;
			s.erase(x+1);
			s.erase(x);
			s.erase(x-1);
			s.erase(x+2);
			for(int i=1;i<=n;i++)
			{
				if(ans[i]==0)
				{
					ans[i]=*s.begin();
					s.erase(ans[i]);
				}
			}
		}
		cout<<"Yes\n";
		for(int i=1;i<=n;i++) cout<<ans[i]<<"\n";
	}
}
// 
int32_t main(){
	ios_base::sync_with_stdio(false);cin.tie(NULL);
	#ifdef LOCAL
	freopen("input.txt", "r", stdin);
	#endif
	int t=1;
	// cin>>t;
	while(t--)
		solve();
} 

Measured memory_bytes: 12416
import java.util.Scanner;

public class Main{
    public static void main(String[]args){
       Scanner sc=new Scanner(System.in);
		int i=1,n=sc.nextInt();
		while(i<=n){
			int x=i;
			if(x%3==0){
				System.out.printf(" %d",i);
			}else{
				while(x>=1){
					if(x%10==3){
						System.out.printf(" %d",i);
						break;
					}
					x/=10;
				}
			}
			i++;
		}
		System.out.printf("\n");
    }
}


Measured memory_bytes: 38324
n,m = map(int,input().split())
mat = list()
vec = list()
ans = [0 for _ in range(n)]
for _ in range(n):
    mat.append(list(map(int,input().split())))
for _ in range(m):
    vec.append(int(input()))

for i in range(n):
    for j in range(m):
        ans[i] += mat[i][j]*vec[j]

for k in ans :
    print(k)

Measured memory_bytes: 8000
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (int)(n); i++)
#define REP(i,n) for (int i = 1; i < (int)(n); i++)
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define vout(x) rep(i,x.size()) cout << x[i] << " "
template<class T> bool chmin(T &a, T b) {if(a>b) {a=b;return 1;}return 0;}
template<class T> bool chmax(T &a, T b) {if(a<b) {a=b;return 1;}return 0;}
using namespace std;
using vint = vector<int>;
using vvint = vector<vector<int>>;
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
using P = pair<int,int>;
const int inf = 1e9;
const ll inf_l = 1e18;
const int MAX = 1e5;

ll dis(vll &s, vll &t, ll st) {
    int index_r = lower_bound(all(s),st)-s.begin();
    int index_l = index_r - 1;
    int index_rr = lower_bound(all(t),s[index_r])-t.begin();
    int index_rl = index_rr - 1;
    int index_lr = upper_bound(all(t),s[index_l])-t.begin();
    int index_ll = index_lr - 1;
    ll dis_ll = (st-s[index_l])+(s[index_l]-t[index_ll]);
    ll dis_lr = (st-s[index_l])+(t[index_lr]-s[index_l]);
    ll dis_rr = (s[index_r]-st)+(s[index_r]-t[index_rl]);
    ll dis_rl = (s[index_r]-st)+(t[index_rr]-s[index_r]);
    return min({dis_ll,dis_lr,dis_rr,dis_rl});
}

int main() {
    int a, b, q; cin >> a >> b >> q;
    vll s(a+2);
    s[0] = -inf_l;
    REP(i,a+1) cin >> s[i];
    s[a+1] = inf_l;
    vll t(b+2);
    t[0] = -inf_l;
    REP(i,b+1) cin >> t[i];
    t[b+1] = inf_l;
    rep(i,q) {
        ll x; cin >> x;
        cout << min(dis(s,t,x),dis(t,s,x)) << endl;
    }
    return 0;
}

Measured memory_bytes: 2944
#include <bits/stdc++.h>
#define ll long long

using namespace std;

int n, k;
ll kamenje[100010];
ll dp[100010];

ll cena(int i, int j)
{
	return dp[i]+abs(kamenje[i]-kamenje[j]);
}

ll najmanjihK(int i)
{
	ll minc=cena(i-1,i);
	for(int j=i-2;i-j<=k && j>0;j--)
		minc=min(minc,cena(j,i));
	return minc;
}

int main()
{
	ios::sync_with_stdio(false);	
	cin.tie(0);
	
	cin>>n>>k;
	for(int i=1;i<=n;i++)
		cin>>kamenje[i];

	dp[0]=0;
	dp[1]=0;
	for(int i=2;i<=n;i++)
		dp[i]=najmanjihK(i);
	cout<<dp[n];
	return 0;
}


Measured memory_bytes: 1792
import sys
input = lambda: sys.stdin.readline().rstrip()
from math import floor,ceil,sqrt,factorial,log
from heapq import heapify, heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from decimal import Decimal
inf = float('inf')
mod = 1000000007

n = list(input())

if n[-1] == '2' or n[-1] == '4' or n[-1] == '5' or n[-1] == '7' or n[-1] == '9':
    print('hon')
elif n[-1] == '0' or n[-1] == '1' or n[-1] == '6' or n[-1] == '8':
    print('pon')
elif n[-1] == '3':
    print('bon')

Measured memory_bytes: 70904
//AtCoder ABC072 C - Together
#include <bits/stdc++.h>
using namespace std;
using ll=int64_t;

int main() {
    ll N;
    cin>>N;
    vector<ll> atbl(N);
    for(auto&& a:atbl){
        cin>>a;
    }    
    unordered_map<ll,ll> mp;
    for(const auto& a:atbl){
        mp[a]++;
        mp[a-1]++;
        mp[a+1]++;
    }
    ll ans=0;
    for(const auto&m: mp){
        ans=max<ll>(ans,m.second);
    }
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 5028
#include <iostream>
using namespace std;
 
long long slov[26], sol;
string s;
 
int main(){
	
  cin >> s;
 
  for (int i = 0; i < s.length(); i++)
    slov[s[i]-'a']++;
    
  sol = ((long long)s.length()*(long long)(s.length()+1))/2;
 
  for (int i = 0; i < 26; i++)
  	if(slov[i]>0)
    	sol -= ((long long)slov[i]*(long long)(slov[i]+1)) / 2;
  
 
  cout << sol+1;
  
  return 0;
  
  
}

Measured memory_bytes: 640
import java.util.Scanner;
import java.math.*;
public class Main {
	
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		//int a = sc.nextInt();
		// スペース区切りの整数の入力
		//int b = sc.nextInt();
		//int c = sc.nextInt();
		// 文字列の入力
		//String s = sc.next();
		//1文字ずつ
		//s.atChar(i);
		// 出力
		//System.out.println("");
		int count=0;
		int N=sc.nextInt();
		int[] a = new int[N];
		for(int i=0;i<N;i++){
			a[i]= sc.nextInt();
		}
		
		for(int i=0;i<N;i++){
			while(a[i]%2==0){
				count++;
				a[i]/=2;
			}
		}
		
		System.out.println(count);
	}
}

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

int gcd(int x, int y){return y?gcd(y,x%y):x;}

int card[1000];
int tree[2048][2];
void treeinit(){
	for(int i=0;i<1010;i++)tree[1024+i][1]=i;
}
void update(int pos){
	if(1024<=pos){
		update(pos/2);
	}
	if(1<=pos && pos<1024){
		int a=pos*2,b=pos*2+1;
		if(tree[b][0]==0){
			tree[pos][0]=tree[a][0];
			tree[pos][1]=tree[a][1];
		}
		else if(tree[a][0]==0){
			tree[pos][0]=tree[b][0];
			tree[pos][1]=tree[b][1];
		}
		else if(tree[a][0]>tree[b][0]){
			tree[pos][0]=tree[b][0];
			tree[pos][1]=tree[b][1];
		}
		else{
			tree[pos][0]=tree[a][0];
			tree[pos][1]=tree[a][1];
		}
		update(pos/2);
	}
}



int main(){
	treeinit();
	
	for(int m,n;cin>>m>>n,m;){
		int ans=0;
		for(int i=0;i<1000;i++)card[i]=0;
		for(int i=0;i<m;i++)cin>>card[i];
		for(int i=0;i<n;i++)cin>>card[500+i];
		vector<int>V[1000];
		for(int i=0;i<m;i++){
			for(int j=0;j<n;j++){
				if(gcd(card[i],card[500+j])==1)continue;
				V[i].push_back(500+j);
				V[500+j].push_back(i);
			}
		}
		for(int i=0;i<1000;i++){
			tree[1024+i][0]=V[i].size();
			update(1024+i);
		}
		while(tree[1][0]){
			int pos=tree[1][1];
			int tmpos=-1;
			int tmp=9999;
			for(int i=0;i<V[pos].size();i++){
				int t=tree[1024+V[pos][i]][0];
				if(t==0)continue;
				if(t<tmp){
					tmp=t;
					tmpos=V[pos][i];
				}
			}
			//cout<<pos<<"("<<card[pos]<<") "<<tmpos<<"("<<card[tmpos]<<") "<<endl;
			ans++;
			for(int i=0;i<V[pos].size();i++){
				if(tree[1024+V[pos][i]][0]==0)continue;
				tree[1024+V[pos][i]][0]--;
				update(1024+V[pos][i]);
			}
			for(int i=0;i<V[tmpos].size();i++){
				if(tree[1024+V[tmpos][i]][0]==0)continue;
				tree[1024+V[tmpos][i]][0]--;
				update(1024+V[tmpos][i]);
			}
			tree[1024+pos][0]=0;
			update(1024+pos);
			tree[1024+tmpos][0]=0;
			update(1024+tmpos);
			
		}
		
		cout<<ans<<endl;
	}
	
	return 0;
}


Measured memory_bytes: 2696
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <cmath>
#include <algorithm>
#include <functional>
#include <queue>
using namespace std;

int main() {
	string S;
	cin >> S;
	if (S[2] == S[3] && S[4] == S[5]) cout << "Yes" << endl;
	else cout << "No" << endl;
	return 0;
}

Measured memory_bytes: 256
# T:0 A:1 G:2 C:3 

N = int(input())
dp = [[[[0] * 4 for i in range(4)] for j in range(4)] for k in range(N+1)]
dp[0][0][0][0] = 1
mod = 10 ** 9 + 7
for n in range(N):
  for i in range(4):
    for j in range(4):
      for k in range(4):
        for NEXT in range(4):
          if j == 1 and k == 2 and NEXT == 3:
            continue
          if j == 1 and k == 3 and NEXT == 2:
            continue
          if j == 2 and k == 1 and NEXT == 3:
            continue
          if i == 1 and j == 2 and NEXT == 3:
            continue
          if i == 1 and k == 2 and NEXT == 3:
            continue
          dp[n+1][j][k][NEXT] += dp[n][i][j][k]
          dp[n+1][j][k][NEXT] %= mod
          
ans = 0
for i in dp[N]:
  for j in i:
    for k in j:
      ans += k
ans %= mod
print(ans)
          

Measured memory_bytes: 46704
from collections import deque

N, M = map(int, input().split())
G = [[] for _ in range(N)]
for i in range(M):
  A, B = map(int, input().split())
  G[A-1].append(B-1)
  G[B-1].append(A-1)

seen = [0 for _ in range(N)]
seen[0] = 1
shirube = [-1 for _ in range(N-1)]

stack = deque([0])
while stack:
  now = stack.popleft()
  for i in G[now]:
    if seen[i] == 0:
      seen[i] = 1
      stack.append(i)
      shirube[i-1] = now
    
for i in range(N):
  if seen[i] == 0:
    print('No')
    exit()
    
print('Yes')
for j in range(N-1):
  print(shirube[j]+1)


Measured memory_bytes: 35004
#include <bits/stdc++.h>
#include<string.h>
using namespace std;
#define FAST ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define Max(x,y,z) max(x,max(y,z))
#define Min(x,y,z) min(x,min(y,z))
#define fr(i,s,e) for(i=s;i<e;i++)
#define rf(i,s,e) for(i=s-1;i>=e;i--)
#define pb push_back
#define eb emblace_back
#define mp make_pair
#define ff first
#define ss second
//#define int   long long
#define ll   long long
#define trace1(x)                cerr<<#x<<": "<<x<<endl
#define trace2(x, y)             cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define trace3(x, y, z)          cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
#define trace4(a, b, c, d)       cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl
#define trace5(a, b, c, d, e)    cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<endl
#define trace6(a, b, c, d, e, f) cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<" | "<<#f<<": "<<f<<endl
#define vl vector<long long>
#define inf (1LL<<61)
#define vi vector<int>
#define vii vector< vector<int> >
#define vll vector< vector<long long> >
#define vpi vector< pair<int,int> >
#define vpl vector< pair<ll,ll> >
#define viii vector< vector<vector<int> > >
typedef pair<pair<int, int>,int> P;
#define cd complex<double>
#define PI 4*atan(1)
#define mod %1000000007
#define pi 3.14159265358979323846//20 decimals
#define ld long double

int main()
{
	FAST;
	ll n, d, a, i, j, k;
	cin >> n >> d >> a;
	pair <ll, ll> p[n];
	fr(i,0,n)
		cin >> p[i].ff >> p[i].ss;
	sort(p, p+n);
	vector <pair <ll, ll> > vec;
	ll st = 0;
	ll ans = 0;
	ll done = 0;
	j = 0;
	fr(i,0,n)
	{
		fr(j, st, vec.size())
		{
			if(vec[j].ff < p[i].ff)
				done -= vec[j].ss;
			else
				break;
		}
		st = j;
		if(done < p[i].ss)
		{
			ll cl = (p[i].ss - done)/a;
			if((p[i].ss - done) % a != 0)
				cl++;
			ans += cl;
			vec.pb(mp(p[i].ff + 2*d, cl*a));
			done += cl*a;
		}
	}
	cout << ans;
}


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

int table[2][4][4] = {
{ {1,2,3,4} , {2,1,4,3} , {3,4,1,2} , {4,3,2,1} } ,
{ {1,1,1,1} , {1,-1,1,-1} , {1,-1,-1,1} , {1,1,-1,-1} }
} ;

main(){
	int n ;
	while( cin >> n , n ){
		int p[4] , q[4] ;
		for( int i=0 ; i<n ; i++ ){
			for( int j=0 ; j<4 ; j++ ) cin >> p[j] ;
			for( int j=0 ; j<4 ; j++ ) cin >> q[j] ;
			
			int ans[4] = {} ;
			for( int j=0 ; j<4 ; j++ ){
				for( int k=0 ; k<4 ; k++ ){
					ans[table[0][j][k]-1] += p[j] * q[k] * table[1][j][k] ;
				}
			}
			for( int j=0 ; j<4 ; j++ ){
				cout << ans[j] ;
				if( j != 3 ) cout << " " ;
			}
			cout << endl ;
		}
	}
}

Measured memory_bytes: 1164
import java.util.*;
public class Main{
    static Scanner kbd = new Scanner(System.in);
    public static void main(String[] args){
	int n = kbd.nextInt();
	while(n>0){
	    int a = kbd.nextInt();
	    int b = kbd.nextInt();
	    int c = kbd.nextInt();
	    
	    a = a*a;
	    b = b*b;
	    c = c*c;
	    
	    if(a==b+c || b==a+c || c==a+b)
		System.out.println("YES");
	    else
		System.out.println("NO");
	    n--;
	}
    }
}

	    

Measured memory_bytes: 23376
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <iomanip>
using namespace std;
typedef long long ll;
template<typename T> using min_priority_queue = priority_queue<T, vector<T>, greater<T>>;

#define EPS (1e-7)
#define INF (1e15)
#define PI (acos(-1))
#define MOD 1000000007

#define REP(i,n) for(int i=0;i<n;i++)
#define REPS(i,f,n) for(int i=(f);i<(n);i++)
#define EACH(it,v) for(__typeof((v).begin()) it=(v).begin();it!=(v).end();it++)

#define dump(x)  cout << #x << " = " << (x) << endl;
#define debug(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
#define arrdump(n,a) for(int i=0;i<n;i++) {cout<<((i>0)? " ":"")<<a[i];}cout<<"\n";


typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef pair<int, P> PP;
typedef pair<ll, LP> LPP;

int dy4[]={0, 0, 1, -1};
int dx4[]={1, -1, 0, 0};
int dx8[]={0, 0, 1, -1, 1, 1, -1, -1};
int dy8[]={1, -1, 0, 0, 1, -1, -1, 1};

// https://atcoder.jp/contests/abc103/tasks/abc103_d

int main() {
    int N, M; cin >> N >> M;
    P ab[M];
    REP(i, M) {
        int a, b; cin >> a >> b;
        ab[i] = {b, a};
    }
    sort(ab, ab+M);

    int now = 0;
    int cnt = 0;
    REP(i, M) {
        int l = ab[i].second;
        int r = ab[i].first;

        if (l >= now) {
            cnt++;
            now = r;
        }
    }

    cout << cnt << "\n";

    return 0;
}

Measured memory_bytes: 1024
import java.util.Scanner;

public class Main {
    public static void main(String[] args){
        Scanner scanner = new Scanner(System.in);
        int time=scanner.nextInt();
        int h,m,s;
        s=time%60;
        time/=60;
        m=time%60;
        h=time/60;
        System.out.println(h+":"+m+":"+s);
    }
}



Measured memory_bytes: 26176
#include <bits/stdc++.h>
#define mp make_pair
using namespace std;

int x[51],y[51],n;

int ans;
int p,q;

set<pair<int,int>>s;
map<pair<int,int>,int>vis;

int solve(){
	int res=0;
	vis.clear();
	pair<int,int> v;
	for (int i=1;i<=n;++i){
		v=mp(x[i]-p,y[i]-q);
		vis[v]++;
	}
	if ((!p)&&(!q)) return s.size();
	for (int i=1;i<=n;++i){
		v=mp(x[i],y[i]);
		if (vis[v]) vis[v]=0;
	}
	for (int i=1;i<=n;++i){
		v=mp(x[i]-p,y[i]-q);
		res+=vis[v];
	}
	return res;
}

int main(){
	cin>>n;
	ans=n;
	for (int i=1;i<=n;++i)
	cin>>x[i]>>y[i],
	s.insert(mp(x[i],y[i]));

	for (int i=1;i<=n;++i)
		for (int j=1;j<=n;++j){
			p=x[i]-x[j],q=y[i]-y[j];
			ans=min(ans,solve());
		}

	cout<<ans<<endl;	
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for(int(i)=0;i<(n);i++)
typedef long long ll;

int main(){
  ll a,b,n,t;cin>>a>>b>>n;
  t=min(n,b-1);
  cout<<(a*t/b)-a*(t/b);
}

Measured memory_bytes: 3544
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author anand.oza
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        AFerrisWheel solver = new AFerrisWheel();
        solver.solve(1, in, out);
        out.close();
    }

    static class AFerrisWheel {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int a = in.nextInt(), b = in.nextInt();

            int answer = a >= 13 ? b : a >= 6 ? b / 2 : 0;
            out.println(answer);
        }

    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }
}



Measured memory_bytes: 21460