akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <vector>
#include <list>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <tuple>
#include <cstring>
#include <functional>
using namespace std;
typedef long long ll;
typedef pair<long long, long long> P;
#define rep(i, n) for(long long i=0; i<n; i++)
#define reps(i, s, e) for(long long i=s; i<e; i++)
#define repr(i, n) for(long long i=n-1; i>=0; i--)
#define reprs(i, s, e) for(long long i=e-1; i>=s; i--)

ll r, s, p;

char winning_hand(char hand_enemy){
    if(hand_enemy == 'r'){
        return 'p';
    }
    else if(hand_enemy == 's'){
        return 'r';
    }
    else if(hand_enemy == 'p'){
        return 's';
    }
    else{
        return '-';
    }
}

ll calc_score(char hand_myself){
    switch(hand_myself){
    case 'r':
        return r;
    case 's':
        return s;
    case 'p':
        return p;
    default:
        return 0;
    }
}

int main(){

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

    ll n, k; cin >> n >> k;
    cin >> r >> s >> p;
    string str_enemy; cin >> str_enemy;
    string str_myself;

    ll score = 0;

    rep(i, k){
        str_myself.push_back(winning_hand(str_enemy[i]));
        score += calc_score(str_myself[i]);
    }

    reps(i, k, n){
        char hand_cand = winning_hand(str_enemy[i]);
        if(hand_cand != str_myself[i - k]){
            str_myself.push_back(hand_cand);
            score += calc_score(str_myself[i]);
        }
        else{
            str_myself.push_back('-');
        }
    }

    cout << score << endl;

    return 0;
}

Measured memory_bytes: 640
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int N = scan.nextInt();
		int M = scan.nextInt();
		String S = scan.next();
		String T = scan.next();
		scan.close();
		if(S.charAt(0) != T.charAt(0)) {
			System.out.println(-1);
			System.exit(0);
		}
		if(N == M) {
			if(S.equals(T)) {
				System.out.println(N);
			}else {
				System.out.println(-1);
			}
			System.exit(0);
		}
		long l = lcm((long)N, (long)M);
		long g = gcd((long)N, (long)M);
		if(g == 1) {
			System.out.println(l);
			System.exit(0);
		}
		int L = (int)l;
		Map<Integer, Integer> map1 = new HashMap<Integer, Integer>();
		Map<Integer, Integer> map2 = new HashMap<Integer, Integer>();
		for(int i = 1; i < N; i++) {
			int t = i * (L / N) + 1;
			map1.put(t, i);
		}
		for(int i = 1; i < M; i++) {
			int t = i * (L / M) + 1;
			map2.put(t, i);
		}


		for(int k : map1.keySet()) {
			if(map2.containsKey(k)) {
				int t1 = map1.get(k);
				int t2 = map2.get(k);
				if(S.charAt(t1) != T.charAt(t2)) {
					System.out.println(-1);
					System.exit(0);
				}
			}
		}

		System.out.println(L);


	}
	static long gcd(long m, long n) {
	    if(m < n) return gcd(n, m);
	    if(n == 0) return m;
	    return gcd(n, m % n);
	}
	static long lcm(long m, long n) {
		return m * n / gcd(m, n);
	}
}

Measured memory_bytes: 51388
#pragma GCC optimize("Ofast")
#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
#include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define flash ios_base::sync_with_stdio(false);     cin.tie(NULL);
#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
#define all(v) v.begin(),v.end()
#define f first
#define s second



using namespace std;



int main()
{
  flash
  ll r;
  cin>>r;
  // cout<<setprecision(20);
   long double pi =(double)(6.28318530717958623200/2);
   //cout<<pi<<"\n";
  double circ=(double) 2*pi*r;
  printf("%.21f", circ);
  //6.28318530717958623200


}


Measured memory_bytes: 3784
/*
ID: Aman Raj
LANG: C++
TASK: subset
*/
#include<iostream>
#include <stdio.h>
//#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
#include<math.h>
typedef  long long int ll;
#include <bits/stdc++.h>
#include <vector>
#include <set>
#include <map>
#include <string>
#include <cstdio>
#include <cstdlib>
#include <climits>
#include <utility>
#include <algorithm>
#include <cmath>
#include <queue>
#include <stack>
#include <iomanip>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
//setbase - cout << setbase (16); cout << 100 << endl; Prints 64
//setfill -   cout << setfill ('x') << setw (5); cout << 77 << endl; prints xxx77
//setprecision - cout << setprecision (14) << f << endl; Prints x.xxxx
//cout.precision(x)  cout<<fixed<<val;  // prints x digits after decimal in val

using namespace std;
using namespace __gnu_pbds;

#define f(i,a,b) for(i=a;i<b;i++)
#define rep(i,n) f(i,0,n)
#define fd(i,a,b) for(i=a;i>=b;i--)
#define pb push_back
#define mp make_pair
#define vi vector< int >
#define vl vector< ll >
#define ss second
#define ff first
//#define ll long long
#define pii pair< int,int >
#define pll pair< ll,ll >
#define sz(a) a.size()
#define inf (1000*1000*1000+5)
#define all(a) a.begin(),a.end()
#define tri pair<int,pii>
#define vii vector<pii>
#define vll vector<pll>
#define viii vector<tri>
#define mod (1000*1000*1000+7)
#define pqueue priority_queue< int >
#define pdqueue priority_queue< int,vi ,greater< int > >
//#define flush fflush(stdout)
#define primeDEN 727999983
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
#include <fstream>
// find_by_order()  // order_of_key
typedef tree<
	int,
	null_type,
	less<int>,
	rb_tree_tag,
	tree_order_statistics_node_update>
	ordered_set;
  //# define mod 1e9+7
  vector<vector<ll> > dp;
  vector<vector<ll> > v;
  void dfs(ll root,ll parent)
  {   //if(v[root].size()==1){dp[root][0]=dp[root][1]=1;return ;  }

      for(auto x:v[root])
      {
          if(x!=parent){dfs(x,root);
           dp[root][0]*=((dp[x][0]+dp[x][1])%mod);
           dp[root][1]*=(dp[x][0]%mod);
           if(dp[root][0]>=mod)dp[root][0]%=mod;
            if(dp[root][1]>=mod)dp[root][1]%=mod;

              }
      }


  }

int main()
 {

   ifstream fin("tcase.txt");
    ofstream fout("subset.out");
   ll n;cin>>n;
     dp.resize(n+1,vector<ll> (2,1));
             v.resize(n+1);
            for(ll i=0;i<n-1;i++)
            {
                ll x,y;cin>>x>>y;
                v[x].push_back(y);v[y].push_back(x);
            }
            dfs(1,-1);

            cout<<(dp[1][0]+dp[1][1])%mod;

}


Measured memory_bytes: 18176
#include<iostream>
#include<cstring>
using namespace std;
int main(){
	string s;
	cin>>s;
	int l=s.size();
	int i=0;
	for(i=0;i<l;i++){
		if(s[i]==s[i+1]){
			cout<<i+1<<" "<<i+2<<endl;
			return 0;
		}else if(s[i]==s[i+2]){
			cout<<i+1<<" "<<i+3<<endl;
			return 0;
		}
	}
	cout<<"-1"<<" "<<"-1"<<endl;
	return 0;
} 


Measured memory_bytes: 512
#include<stdio.h>
#include<math.h>
main(){
    double a,b,C;
    double rC,c2jou,c;
    double s,l,h;
    double pi = 3.14159265;
 
    scanf("%lf %lf %lf",&a,&b,&C);
 
    rC = C * 2 * pi / 360.0;
    s = 0.5 * a * b * sin(rC);
    c2jou = a * a + b * b - 2 * a * b * cos(rC);
    c = sqrt(c2jou);
    l = a + b + c;
    h = 2 * s / a;
 
    printf("%f\n%f\n%f\n",s,l,h);
    return 0;
}


Measured memory_bytes: 2044
#include <bits/stdc++.h>
using namespace std;
#define int int64_t
#define double long double
#define all(v) (v).begin(),(v).end()
#define vi vector<int>
#define vvi vector<vi>
#define pii pair<int,int>
#define vii vector<pii>
const int MOD=1e9+7;
const int INF=1e18;

int n,m;
vi adj[200005];
bool vis[200005];


int dfs(int a){
    vis[a]=1;
    int ans=1;
    for(int ch:adj[a]){
        if(vis[ch])continue;
        ans+=dfs(ch);
    }
    return ans;
}

signed main(){
    ios_base::sync_with_stdio(0);cin.tie(0);
    //freopen("in.txt","r",stdin);freopen("out.txt","w",stdout);
    cin>>n>>m;
    for(int i=1;i<=m;i++){
        int a,b;cin>>a>>b;
        adj[a].push_back(b);
        adj[b].push_back(a);
    }
    int ans=0;
    for(int i=1;i<=n;i++){
        if(!vis[i]){
            ans=max(ans,dfs(i));
        }
    }
    cout<<ans;
}

Measured memory_bytes: 24080
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

bool valid(const vector<int>& v){
	int minDist = v[0];
	int minNum = 0;
	while(minNum < v.size() && v[0] == v[minNum]) ++minNum;
	if(minNum > 2) return false;
	int idx = 0;
	while(idx < v.size() && v[idx] == v[0]) ++idx;
	if(idx == v.size()) return minDist == 1;
	int prevDist = minDist;
	while(idx < v.size()){
		int curDist = v[idx];
		if(curDist != prevDist + 1) return false;
		if(curDist > 2 * minDist - (minNum == 2 ? 1 : 0)) return false;
		int curNum = 0;
		while(idx + curNum < v.size() && v[idx] == v[idx+curNum]) ++curNum;
		if(curNum == 1) return false;
		prevDist = curDist;
		idx += curNum;
	}
	return true;
}

int main(){
	int N;
	while(cin >> N){
		vector<int> a(N);
		for(auto& t : a) cin >> t;
		sort(a.begin(), a.end());
		cout << (valid(a) ? "Possible" : "Impossible") << endl;;
	}
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N(0);
  cin >> N;
 
  const int n1 = static_cast<int>(N / 1000.0);
  const int n2 = static_cast<int>( (N % 1000) / 100.0 );
  const int n3 = static_cast<int>( (N % 100) / 10.0 );
  const int n4 = N % 10;
  
  if( (n1 == n2 && n2 == n3) || (n2 == n3 && n3 == n4) )
  {
  	cout << "Yes" << endl;
  }
  else
  {
    cout << "No" << endl;
  }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define pb          emplace_back
#define ll          long long
#define fi          first
#define se          second
#define mp          make_pair
#define int         int64_t

using namespace std;

const int N = int(2e5) + 7;
const int logN = 18;
typedef pair<int, int> pii;

vector<int> st;
int n, a[N], l[N], r[N], rmq[N][logN + 1], lg[N];

int GetMax(int l, int r) {
    int k = lg[r - l + 1];
    return max(rmq[l][k], rmq[r - (1 << k) + 1][k]);
}

int Get1(int _l, int _r, int val) {
    int low = _l, high = _r, mid;
    while(low <= high) {
        mid = (low + high) >> 1;
        if(GetMax(mid, _r) > val) low = mid + 1;
        else high = mid - 1;
    }
    if(high == _r && _r < 0) return 0;
    return _r + 1 - high;
}

int Get2(int _l, int _r, int val) {
    int low = _l, high = _r, mid;
    while(low <= high) {
        mid = (low + high) >> 1;
        if(GetMax(_l, mid) > val) high = mid - 1;
        else low = mid + 1;
    }
    if(low == _l && _l > n + 1) return 0;
    return low - _l + 1;
}

int32_t main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0), cout.tie(0);
    #define Task        "test"
    if(fopen(Task".inp", "r")) {
        freopen(Task".inp", "r", stdin);
        freopen(Task".out", "w", stdout);
    }
    cin >> n;
    for(int i = 1; i <= n; ++i) {
        cin >> a[i]; rmq[i][0] = a[i];
        if((1 << (lg[i - 1] + 1)) == i) lg[i] = lg[i - 1] + 1;
        else lg[i] = lg[i - 1];
    }
    for(int j = 1; j <= logN; ++j) {
        for(int i = 1; i <= n; ++i) {
            rmq[i][j] = max(rmq[i][j - 1], rmq[min(i + (1 << (j - 1)), n)][j - 1]);
        }
    }
    for(int i = 1; i <= n; ++i) {
        while(st.size() && a[st.back()] <= a[i]) st.pop_back();
        if(st.size()) l[i] = st.back();
        else l[i] = 0;
        st.pb(i);
    } st.clear();
    for(int i = n; i >= 1; --i) {
        while(st.size() && a[st.back()] <= a[i]) st.pop_back();
        if(st.size()) r[i] = st.back();
        else r[i] = n + 1;
        st.pb(i);
    }
    ll res = 0;
    for(int i = 1; i <= n; ++i) {
        //cout << Get1(1, l[i] - 1, a[i]) * (r[i] - i) << ' ' << Get2(r[i] + 1, n, a[i]) * (i - l[i]) << '\n';
        res += (Get1(1, l[i] - 1, a[i]) * (r[i] - i) + Get2(r[i] + 1, n, a[i]) * (i - l[i])) * a[i];
    }
    cout << res;
}


Measured memory_bytes: 22400
#include <bits/stdc++.h>
using namespace std;
  
// #define int long long
#define pb push_back
  
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<vector<int> > vii;
 
template <class X> void print(X Target){ cout << Target << '\n'; }

signed main()
{
  ios::sync_with_stdio(false);
  int b, r, g, c, s, t;

  while (cin >> b >> r >> g >> c >> s >> t, b || r || g || c || s || t){
    int ans = b * 15 + r * 15 + b * 13 * 5 + r * 13 * 3 + g * 7 + c * 2 + 100;
    print(ans - (t - b * 5 - r * 3 - s) * 3);
  }

  return (0);
}

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

vector<int>ans;
vector<vector<P>>d;
void dfs(int x,int y,int z){
  int co=1;
  rep(i,d[x].size()){
    int k=d[x][i].first;
    int v=d[x][i].second;
    if(k!=z){
      if(co==y){
        co++;
      }
      ans[v]=co;
      dfs(k,co,x);
      co++;
    }
  }
}
    
int main() {
  int n;
  cin>>n;
  vector<int>a(n-1),b(n-1);
  d.resize(n);
  ans=vector<int>(n-1);
  rep(i,n-1) {
    cin>>a.at(i)>>b.at(i);
    a.at(i)--;b.at(i)--;
    d[a.at(i)].push_back(P(b.at(i),i));
    d[b.at(i)].push_back(P(a.at(i),i));
  }
  int s=0;
  rep(i,n){
    int si=d[i].size();
    s=max(s,si);
  }
  cout<<s<<endl;
  dfs(0,-1,-1);
  rep(i,n-1){
    cout<<ans[i]<<endl;
  }
}

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

#include <cassert>
using namespace std;

const int INF = 1e9;

inline bool IsAny(const pair<int, int>& p) {
    return p.first == INF && p.second == INF;
}

inline pair<int, int> GetAny() {
    return make_pair(INF, INF);
}

inline bool Merge(pair<int, int> lhs, pair<int, int> rhs, pair<int, int>& result) {
    if (IsAny(lhs)) {
        result = rhs;
        return true;
    }
    if (IsAny(rhs)) {
        result = lhs;
        return true;
    }
    if ((abs(lhs.first) & 1) != (abs(rhs.first) & 1)) {
        return false;
    }
    result.first = max(lhs.first, rhs.first);
    result.second = min(lhs.second, rhs.second);
    if (result.first > result.second) {
        return false;
    }
    return true;
}

inline pair<int, int> Extend(pair<int, int> p) {
    if (IsAny(p)) {
        return p;
    }
    --p.first;
    ++p.second;
    return p;
}

int n;
vector<vector<int>> g;

vector<int> values;

vector<pair<int, int>> possible;

bool BuildPossible(int v, int pr) {
    possible[v].first = possible[v].second = values[v];
    for (int u : g[v]) {
        if (u == pr) {
            continue;
        }
        if (!BuildPossible(u, v)) {
            return false;
        }
        if (!Merge(possible[v], Extend(possible[u]), possible[v])) {
            return false;
        }
    }
    return true;
}

vector<int> result;

void BuildResult(int v, int pr, const pair<int, int>& up) {
    pair<int, int> cur;
    bool ok = Merge(possible[v], up, cur);
    assert(ok);
    result[v] = cur.first;
    cur.second = cur.first;
    cur = Extend(cur);
    for (int u : g[v]) {
        if (u != pr) {
            BuildResult(u, v, cur);
        }
    }
}

int main() {
    // freopen("input.txt", "r", stdin);

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

    cin >> n;
    g.resize(n);
    for (int i = 0; i + 1 < n; ++i) {
        int v1, v2;
        cin >> v1 >> v2;
        --v1;
        --v2;
        g[v1].push_back(v2);
        g[v2].push_back(v1);
    }

    int k;
    cin >> k;
    values.assign(n, INF);
    for (int i = 0; i < k; ++i) {
        int value;
        int pos;
        cin >> pos >> value;
        --pos;
        values[pos] = value;
    }

    possible.resize(n);
    if (!BuildPossible(0, -1)) {
        cout << "No" << endl;
        return 0;
    }

    cout << "Yes" << endl;
    result.resize(n);
    BuildResult(0, -1, GetAny());
    for (int i = 0; i < n; ++i) {
        cout << result[i] << '\n';
    }
    cout.flush();

    return 0;
}


Measured memory_bytes: 14336
#include<bits/stdc++.h>
using namespace std;
int main(){
  int n;
  cin>>n;
  int count=0;
  int a[55555]={};
  for(int i=1;i<55555;i++){
    if(i%10!=1){continue;}
    int sum=0;
    for(int j=1;j<55555;j++){
      if(i%j==0){
	sum++;
      }
    }
    if(sum==2){
      a[i]=i;
      count++;
    }
    if(count==n){break;}
  }
  count=0;
  for(int i=1;i<55555;i++){
    if(a[i]==0){
      continue;
    }
    count++;
    cout<<a[i];
    if(count!=n){
      cout<<" ";
    }
    if(count==n){
      break;
    }
  }
  cout<<endl;
  return 0;
}


Measured memory_bytes: 512
import java.util.Scanner;

public class Main{

	public static void main (String [] args) {

		Scanner sc = new Scanner (System.in);

		int N = sc.nextInt();
		int nowCount = 0;
		int maximum = 0;
		int nowPlace = sc.nextInt();

		for (int index=1; index<N; index++) {
			int nextPlace = sc.nextInt();
			if (nowPlace>=nextPlace) {
				nowCount++;
			} else {
				if (nowCount>maximum) {
					maximum=nowCount;
				}
				nowCount = 0;
			}
			nowPlace = nextPlace;
		}
		if (nowCount>maximum) {
			maximum=nowCount;
		}

		System.out.println(maximum);
	}
}

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

int main()
{
    std::string s,ss;
    std::cin >> s;
    for(int i = 0; i < (int)s.size(); i++){
        if(!(i & 1))ss.push_back(s[i]);
    }
    std::cout << ss << std::endl;
}

Measured memory_bytes: 512
use std::io::*;
use std::str::*;
use std::collections::HashSet;
 
fn read<T: FromStr>() -> Option<T> {
    let stdin = stdin();
    let s = stdin
        .bytes()
        .map(|c| c.unwrap() as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect::<String>();
    s.parse::<T>().ok()
}
 
fn main() {
    let n: usize = read().unwrap();
    // let mut a: Vec<i64> = Vec::new();
    let mut set:HashSet<i32> = HashSet::new();
 
    for i in 0..n {
        set.insert(read().unwrap());
    }
    println!("{}", set.len());
}

Measured memory_bytes: 4352
#include<stdio.h>

int main(){
    int n;
    scanf("%d", &n);
    int t[n][n];
    int a[n], flags[n];
    for(int i=0; i<n; i++){
        for(int j=0; j<n-1; j++){
            scanf("%d", &t[i][j]);
            t[i][j]--;
        }
        a[i] = 0;
        flags[i] = 0;
    }

    int flag = 0, day = 0;
    while(1){
        /*for(int i=0; i<n; i++){
            printf("%d:", t[i][a[i]]);
            printf("%d ", a[i]);
        }
        printf("\n");*/
        for(int i=0; i<n; i++){
            if(a[i] < n-1){
                //printf("%d:%d , ", t[i][a[i]], t[ t[i][a[i]] ][ a[ t[i][a[i]] ] ]);
                if(flags[i] == 0 && flags[ t[i][a[i]] ] == 0 && i == t[ t[i][a[i]] ][ a[ t[i][a[i]] ] ]){
                    flags[i]++;
                    flags[t[i][a[i]]]++;
                    a[t[i][a[i]]]++;
                    a[i]++;
                    flag = 1;
                }
            }
        }
        /*for(int i=0; i<n; i++){
            printf("%d ", flags[i]);
        }
        printf("\n");*/
        if(flag == 1){
            day++;
            flag = 0;
        }else{
            break;
        }
        for(int i=0; i<n; i++){
            flags[i] = 0;
        }
    }
    flag = 1;
    for(int i=0; i<n; i++){
        if(a[i] < n-1){
            flag = 0;
        }
    }
    if(flag == 0){
        printf("-1");
    }else{
        printf("%d", day);
    }

    return 0;
}

Measured memory_bytes: 4096
using System;
using System.Linq;

namespace ExaWizA {
    class Program {
        static void Main(string[] args) {
            var input = Console.ReadLine().Split(' ').Select(int.Parse).ToList();
            input.Sort();
            if (input[0] == input[1] && input[0] == input[2]) Console.WriteLine("Yes");
            else Console.WriteLine("No");
        }
    }
}

Measured memory_bytes: 11220
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <cmath>
#include <set>
#include <sstream>
#include <bitset>
#include <stack>
#include <cstdlib>
#include <utility> //pair

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

typedef long long ll;

using namespace std;

int main() {
    
    char a,b,c,d;
    
    cin >> a >> b >> c >>d;
    
    int ans=0;
    if(a=='+'){
        ans++;
    }else{
        ans--;
    }
    if(b=='+'){
        ans++;
    }else{
        ans--;
    }if(c=='+'){
        ans++;
    }else{
        ans--;
    }if(d=='+'){
        ans++;
    }else{
        ans--;
    }
    
    cout << ans << endl;
    return 0;
}


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

//#define int long long
typedef long long ll;

typedef unsigned long long ul;
typedef unsigned int ui;
const ll mod = 1000000007;
const ll INF = mod * mod;
const int INF_N = 1e+9;
typedef pair<int, int> P;
#define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
#define all(v) (v).begin(),(v).end()
typedef pair<ll, ll> LP;
typedef long double ld;
typedef pair<ld, ld> LDP;
const ld eps = 1e-12;
const ld pi = acos(-1.0);
//typedef vector<vector<ll>> mat;
typedef vector<int> vec;

//繰り返し二乗法
ll mod_pow(ll a, ll n, ll m) {
	ll res = 1;
	while (n) {
		if (n & 1)res = res * a%m;
		a = a * a%m; n >>= 1;
	}
	return res;
}

struct modint {
	ll n;
	modint() :n(0) { ; }
	modint(ll m) :n(m) {
		if (n >= mod)n %= mod;
		else if (n < 0)n = (n%mod + mod) % mod;
	}
	operator int() { return n; }
};
bool operator==(modint a, modint b) { return a.n == b.n; }
modint operator+=(modint &a, modint b) { a.n += b.n; if (a.n >= mod)a.n -= mod; return a; }
modint operator-=(modint &a, modint b) { a.n -= b.n; if (a.n < 0)a.n += mod; return a; }
modint operator*=(modint &a, modint b) { a.n = ((ll)a.n*b.n) % mod; return a; }
modint operator+(modint a, modint b) { return a += b; }
modint operator-(modint a, modint b) { return a -= b; }
modint operator*(modint a, modint b) { return a *= b; }
modint operator^(modint a, int n) {
	if (n == 0)return modint(1);
	modint res = (a*a) ^ (n / 2);
	if (n % 2)res = res * a;
	return res;
}

//逆元(Eucledean algorithm)
ll inv(ll a, ll p) {
	return (a == 1 ? 1 : (1 - p * inv(p%a, a)) / a + p);
}
modint operator/(modint a, modint b) { return a * modint(inv(b, mod)); }

const int max_n = 1 << 18;
modint fact[max_n], factinv[max_n];
void init_f() {
	fact[0] = modint(1);
	for (int i = 0; i < max_n - 1; i++) {
		fact[i + 1] = fact[i] * modint(i + 1);
	}
	factinv[max_n - 1] = modint(1) / fact[max_n - 1];
	for (int i = max_n - 2; i >= 0; i--) {
		factinv[i] = factinv[i + 1] * modint(i + 1);
	}
}
modint comb(int a, int b) {
	if (a < 0 || b < 0 || a < b)return 0;
	return fact[a] * factinv[b] * factinv[a - b];
}
using mP = pair<modint, modint>;

int dx[4] = { 0,1,0,-1 };
int dy[4] = { 1,0,-1,0 };




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

signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  //cout << fixed << setprecision(10);
  //init_f();
  //init();
  //int t; cin >> t; rep(i, t)solve();
  solve();
//   stop
    return 0;
}


Measured memory_bytes: 4352
#include<bits/stdc++.h>
using namespace std;
#define ll long long
const int INF = 0x3f3f3f3f;
const ll inf = 0x3f3f3f3f3f3f3f3f;
const int N = 1e6 + 10;
ll prime[N];     //记录质数
bool is_prime[N];
int vis[N];      //记录最小质因子
int euler_sieve(int n) {
	int cnt = 0;
	for (int i = 2; i <= n; i++) {
		if (!vis[i]) { vis[i] = i; prime[cnt++] = i; is_prime[i] = true; }    //vis[]记录x的最小质因子
		for (int j = 0; j < cnt; j++) {
			if (i*prime[j] > n)  break;
			vis[i*prime[j]] = prime[j];              //vis[]记录x的最小质因子
			if (i%prime[j] == 0)
				break;
		}
	}
	return cnt;
}
ll n, ans;
vector<int>vc;
int main() {
	cin >> n;
	for (int i = 0; i < 100; i++)vc.push_back((1 + i)*i / 2);
	int p = euler_sieve(1000001);
	for (int i = 0; i < p&&prime[i] * prime[i] <= n; i++) {
		if (n%prime[i])continue;
		int cnt = 0;
		while (n%prime[i] == 0) {
			n /= prime[i];
			cnt++;
		}
		ans += upper_bound(vc.begin(), vc.end(), cnt) - vc.begin() - 1;
	}
	if (n != 1)ans++;
	printf("%lld\n", ans);
	return 0;
}

Measured memory_bytes: 9304
#include <bits/stdc++.h>
using namespace std;
///@Tanvir
#define int         long long
#define pb          push_back
#define pii         pair<int,int>
#define vi          vector<int>
#define vii         vector<pii>
#define mi          map<int,int>
#define mii         map<pii,int>
#define all(a)      (a).begin(),(a).end()
#define x           first
#define y           second
#define sz(x)       (int)x.size()
#define endl        '\n'
#define hell        1000000007

#define rep(i,a,b)  for(int i=a;i<b;i++)

#define N 100005


int cnt[N];

void solve()
{
    int n;
    cin>>n;
    int a[n];
    int sum = 0;
    for(int i=0; i<n; i++){
        cin>>a[n];
        cnt[a[n]]++;
        sum += a[n];
    }
    int q;
    cin>>q;

    for(int i=0; i<q; i++){
        int b, c;
        cin>>b>>c;
        //cout<<"b,c="<<b<<" "<<c<<"\n";

        cnt[c] += cnt[b];


        sum = sum + (c-b)*cnt[b];

        cnt[b] = 0;

        cout<<sum<<"\n";


    }


}


signed main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int t=1;
    ///cin>>t;
    rep(i,1,t+1){
        ///cout<<"Case #"<<i<<": ";
        solve();
    }
    return 0;
}
/*
6
5 8 9 12 4 8
3
8 5
4 9
9 5


*/


Measured memory_bytes: 4396
s = int(input())

def calc_next(x):
  if x % 2 == 0:
    return x // 2
  else:
    return 3 * x + 1

a = [s]
n = 1

while True:
  a.append(calc_next(a[n-1]))
  for i in range(n):
    if a[i] == a[n]:
      print(n+1)
      exit(0)
  n += 1


Measured memory_bytes: 3060
#include<bits/stdc++.h>
#include <math.h>
using namespace std;
#define rep(i,n) for(ll i=0;i<n;i++)
#define repl(i,l,r) for(ll i=(l);i<(r);i++)
#define per(i,n) for(ll i=n-1;i>=0;i--)
#define lper(i,r,l) for(ll i=r-1;i>=l;i--)
#define fi first
#define se second
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define CST(x) cout<<fixed<<setprecision(x)
using ll=long long;
using vl=vector<ll>;
using vvl=vector<vector<ll>>;
using pl=pair<ll,ll>;
const ll MOD=1000000007;
const ll MOD9=998244353;
const int inf=1e9;
const ll INF=4e18;
const ll dy[4]={1,0,-1,0};
const ll dx[4]={0,-1,0,1};
int main() {
  int N;
  int L;
  cin >>N>>L;
  
  vector<int>vec(N);
  rep(i,N) {
vec.at(i)=abs(L+i);
  }
  vector<int> vect(N);
  rep(i,N) {
vect.at(i)=L+i;
  }
  
  sort(all(vec));
  int sum=0;
  rep(i,N) {
sum +=vect.at(i);
  }
  
  int check=0;
  int x=vec.at(0);
 
  
  rep(i,N) {
  if(x==vect.at(i)) {
    check++;
  }
  }
  
  if(check>0)  {
    int a=sum-x;
    cout<<a<< endl;
    
  }
else {
  int b=sum+x;
cout <<b<< endl;
  
  
}
}
  
 

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

int main() {
    while (1) {
        int H, W;
        cin >> H >> W;
        if (!(H)) break;
        
        for (int i = 0; i < H; i++) {
            for (int j = 0; j < W; j++) {
                if (!(i % 2)) {
                    if (!(j % 2)) {
                        cout << '#';
                    } else {
                        cout << '.';
                    }
                } else {
                    if (!(j % 2)) {
                        cout << '.';
                    } else {
                        cout << '#';
                    }
                }
                if (j == (W - 1)) cout << endl;
            }
            if (i == (H - 1)) cout << endl;
        }
    }
}


Measured memory_bytes: 3092
#-*-coding:utf-8-*-

def main():
    while True:
        height,width=map(int,input().split())
        if height==0 and width ==0:
            break
        for i in range(height):
            sharp=""
            for j in range(width):
                if i==0 or i==height-1 or j==0 or j==width-1:
                    sharp+="#"
                else:
                    sharp+="."
            print(sharp)
        print("")

if __name__=="__main__":
    main()


Measured memory_bytes: 5616
import java.util.Scanner;
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int N = Integer.parseInt(sc.next());
    String S = sc.next();  
    int cnt = 1;
    char tmp = S.charAt(0);
    for(int i=1;i<S.length();i++){
        if(S.charAt(i)!=tmp){
            cnt++;
        }
        tmp = S.charAt(i);
    }
    System.out.print(cnt);
    return;
  }
}



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

#define ll long long
#define pb push_back
#define pf push_front
#define mp make_pair
#define endl "\n" 
#define all(c) c.begin(),c.end()
#define present(c,element) (c.find(element)!=c.end())
#define cpresent(c,element) (find(c,element)!=c.end())
typedef vector<int> vi;
typedef vector<ll> vll;
ll mod=1e9+7;


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

int test=1;
//cin>>test;
while(test--)
{

	string s;
	cin>>s;
	if(s=="ABC")
		cout<<"ARC\n";
	else cout<<"ABC\n";


	
}
return 0;
}









Measured memory_bytes: 3604
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef double db;
int main(){
    int a,b,c,d;
    cin>>a>>b>>c>>d;
    while(a>=0&&c>=0){
        if(a>0) c-=b;
        if(c>0) a-=d;
    }
    if(a>0) cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
} 

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

int main(){
	int n,k;
	cin >> n >> k;
	int x[n];
	int left=0, right=0;
	bool flag = true;
	for(int i=0;i<n;i++) {
		cin >> x[i];
	}
	int mintime=1e9;
	for(int l=0;l<=n-k;l++){
		int r=l+k-1;
		int time=min(abs(x[l])+abs(x[r]-x[l]), abs(x[r])+abs(x[r]-x[l]));
		mintime=min(mintime, time);
	}
	cout << mintime << endl;

}


Measured memory_bytes: 640
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define repr(i, n) for (int i = (n); i >= 0; --i)
#define FOR(i, m, n) for (int i = (m); i < (n); ++i)
#define FORR(i, m, n) for (int i = (m); i >= (n); --i)
#define equals(a, b) (fabs((a) - (b)) < EPS)
using namespace std;
typedef long long ll;
const ll mod = 1000000007;
const ll mod2 = 998244353;
const ll INF = 1e18;
const long double EPS = 1e-10;

int main() {
  int n;
  cin >> n;
  vector<pair<int, int>> t[15];
  rep(i, n) {
    int a;
    cin >> a;
    t[i].resize(a);
    rep(j, a) {
      cin >> t[i][j].first >> t[i][j].second;
    }
  }

  int ans = 0;
  rep(i, (1 << n)) {
    int m = i, res = 0;
    bool flag = true;
    vector<int> p(n, 0);
    rep(j, n) {
      if (m & 1) {
        p[j] = 1;
        res++;
      }
      m >>= 1;
    }

    rep(j, n) {
      if (!p[j]) continue;
      rep(k, t[j].size()) {
        int x = t[j][k].first, y = t[j][k].second;
        if (p[x - 1] != y) flag = false;
      }
    }

    if (flag) ans = max(ans, res);
  }
  cout << ans << endl;
  
  return 0;
}

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

using namespace std;

typedef long long ll;

#define MOD 1000000007

struct UnionFind {
  vector<int> par;
  vector<int> sz;
  UnionFind(int n) { init(n); }

  void init(int n) {
    par.resize(n);
    sz.resize(n);
    for (int i = 0; i < n; ++i) {
      par[i] = i;
      sz[i] = 1;
    }
  }

  int find(int x) {
    if (par[x] == x) {
      return x;
    } else {
      return par[x] = find(par[x]);
    }
  }

  void unite(int x, int y) {
    x = find(x);
    y = find(y);
    if (x == y) return;
    if (sz[x] < sz[y]) {
      par[x] = y;
      sz[y] += sz[x];
    } else {
      par[y] = x;
      sz[x] += sz[y];
    }
  }

  bool same(int x, int y) { return find(x) == find(y); }

  int size(int x) { return sz[find(x)]; }
};

vector<int> g[100000];

int main() {
  int n, m, k;
  cin >> n >> m >> k;
  vector<int> a(m), b(m);
  UnionFind uf(n);
  for (int i = 0; i < m; ++i) {
    cin >> a[i] >> b[i];
    a[i]--, b[i]--;
    uf.unite(a[i], b[i]);
    g[a[i]].push_back(b[i]);
    g[b[i]].push_back(a[i]);
  }
  vector<int> ans(n);
  for (int i = 0; i < n; ++i) {
    ans[i] = uf.size(i) - g[i].size() - 1;
  }
  vector<int> c(k), d(k);
  for (int i = 0; i < k; ++i) {
    cin >> c[i] >> d[i];
    c[i]--, d[i]--;
    if (uf.same(c[i], d[i])) {
      ans[c[i]]--, ans[d[i]]--;
    }
  }
  for (int i = 0; i < n; ++i) {
    cout << ans[i] << (i == n - 1 ? "\n" : " ");
  }
  return 0;
}

Measured memory_bytes: 9464
#include "bits/stdc++.h"
using namespace std;

/* macro */
#define rep(i,a,b) for(int i=a;i<b;i++)
#define revrep(i,a,b) for(int i = a; i > b; i--)
#define int long long
#define exist(s,e) ((s).find(e)!=(s).end())
#define all(v) (v).begin(), (v).end()
#define each(s,itr) for(auto (itr) = s.begin(); (itr) != s.end(); (itr)++)
#define sum(v) accumulate(all(v), (0LL))
#define isin(a, b, c) (b <= a && a <= c)
#define println cout << "\n";
#define sz(v) (int)v.size()
#define bin(x) static_cast<bitset<16> >(x)



/* alias */
template<class T> using vec = vector<T>;
typedef vector<int> vi;
typedef pair<int, int> pi;
typedef tuple<int, int, int> ti;
typedef map<int, int> mi;
typedef set<int> si;


/* constant */
const int inf = 1LL << 62;
const int mod = 1e9 + 7;
const int dx[8]={1,0,-1,0,-1,1,-1,1};
const int dy[8]={0,1,0,-1,-1,-1,1,1};
const string alphabet = "abcdefghijklmnopqrstuvwxyz";

/* io_method */
int input(){int tmp;cin >> tmp;return tmp;}
string raw_input(){string tmp;cin >> tmp;return tmp;}
template<class T> void printx(T n){cout << n;}
template<class T, class U> void printx(pair<T, U> p){cout << "(" << p.first << "," << p.second << ")";}
template<class T, class U, class V> void printx(tuple<T, U, V> t){cout << "{" << get<0>(t) << "," << get<1>(t) <<"," << get<2>(t) << "}" << endl;}
template<class T> void printx(vector<T> v){cout << "{";rep(i,0,v.size()){printx(v[i]);if(i != v.size()-1)printx(",");}cout << "}";}
template<class T> void print(T n){printx(n);cout << endl;}
template<class T> void print(set<T> s){cout << "{";each(s, e){if(e != s.begin()) printx(",");printx(*e);}cout << "}" << endl;}
template<class T, class U> void print(map<T, U> mp){cout << "{";each(mp, e){cout << "(" << e -> first << "," << e -> second << ")";}cout << "}" << endl;}
template<class T> void printans(vec<T> v){rep(i,0,sz(v)){cout << v[i] << (i == sz(v) - 1 ? "" : " ");}cout << endl;}


/* general_method */
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
template<class T>T cut(T &a, int l, int r){return T(a.begin()+l, a.begin()+r);}

/* main */

char t;
void in(){
    cin >> t;
}

void solve(){
    
    if(t == 'A'){
        print('T');
    }
    if(t == 'T'){
        print('A');
    }
    if(t == 'G'){
        print('C');
    }
    if(t == 'C'){
        print('G');
    }


}

signed main(){

    cin.tie(0);
    ios::sync_with_stdio(false);
    in();
    solve();
    
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define MAXN 100010
#define pb push_back
#define mp make_pair
using namespace std;

long long int a[100010],sum,cnt,ans;

int main(){
	int n;
	cin>>n;
	for(int i=0;i<n;i++){
		cin>>a[i];
	}
	for(int i=0;i<n;i++){
		sum+=a[i];
		if(i%2){
			if(sum>0){
				;
			}
			else{
				cnt+=(abs(sum)+1);
				sum=1;
			}
		}
		else{
			if(sum<0)
				;
			else{
				cnt+=(abs(sum)+1);
				sum=-1;
			}
		}
	}
	ans=cnt;cnt=sum=0;
	for(int i=0;i<n;i++){
		sum+=a[i];
		if(i%2==0){
			if(sum>0){
				;
			}
			else{
				cnt+=(abs(sum)+1);
				sum=1;
			}
		}
		else{
			if(sum<0)
				;
			else{
				cnt+=(abs(sum)+1);
				sum=-1;
			}
		}
	}
	cout<<min(cnt,ans);
	return 0;
}


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

#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP0(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define REP1(i, n) for (int i = 1, i##_len = (n); i <= i##_len; ++i)

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

const int INTINF = int(1e9) + 1;
const LL LLINF = LL(1e18) + 1;
long double eps = 1.0E-14;
#define pow10(n) int(1e##n + n)

struct pos
{
    LL x;
    LL y;
};

void solve()
{
    int N;
    cin >> N;
    vector<pos> p(N);
    REP0 (i, N)
    {
        cin >> p[i].x >> p[i].y;
    }

    int ans = N;

    for (auto p1 : p)
    {
        for (auto p2 : p)
        {
            if (p1.x == p2.x and p1.y == p2.y)
                continue;

            LL dx = p2.x - p1.x;
            LL dy = p2.y - p1.y;

            int edge = 0;

            for (auto pi : p)
            {
                for (auto pj : p)
                {
                    if (pi.x == pj.x and pi.y == pj.y)
                        continue;

                    if (pi.x - pj.x == dx and pi.y - pj.y == dy)
                    {
                        edge++;
                    }
                }
            }
            ans = min(ans, N - edge);
        }
    }
    cout << ans << endl;
}

int main(int argc, char const *argv[])
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    std::cout << std::fixed << std::setprecision(10);
    solve();
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long int num[10];
    for(long long int i=0;i<10;i++)
    {
        cin>>num[i];
    }
    sort(num,num+10);
    for(long long int i=9;i>=7;i--)
    {
        cout<<num[i]<<endl;
    }
    return 0;
}

Measured memory_bytes: 1172
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
set<ll> st;
ll n;
void dfs(ll now,ll add){
    now += add;
    if(now > n)
        return ;
        bool seven = false,five = false,three = false;
        for(ll i = now; i > 0; i /= 10){
            if(i % 10 == 3)
            three = true;
            if(i % 10 == 5)
            five = true;
            if(i % 10 == 7)
            seven = true;
        }
        if(three && five && seven)
            st.insert(now);
        dfs(now * 10, 3);
        dfs(now * 10, 5);
        dfs(now * 10, 7);

}
int main()
{
    ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
    cin >> n;
    dfs(0,7);
    dfs(0,5);
    dfs(0,3);
    cout << st.size() << endl;
}

Measured memory_bytes: 1536
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE BinaryLiterals #-}
{-# LANGUAGE MultiWayIf #-}
{-# LANGUAGE NumDecimals #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TupleSections #-}

import Control.Applicative
import Control.Arrow
import Control.Monad
import Control.Monad.ST

import Data.Char
import Data.List
import Data.Maybe

import qualified Data.ByteString.Char8 as B

import Data.Array.ST.Safe
import Data.STRef

import Debug.Trace
import Text.Printf

readInt = readLn :: IO Int
readInts = map ( fst . fromJust . B.readInt ) . B.words <$> B.getLine
readNInts = readInt >>= flip replicateM readInt

which a b f = if f then a else b
mp [ a, b ] = ( a, b )

main = do
	getLine
	s <- getLine
	let
		whites = length $ filter ( == '.' ) s
	print $ minimum $ solve 0 whites s

solve blacks whiltes [] = [ blacks + whiltes ]
solve blacks whites (c:s) = blacks + whites : solve ( blacks + isBlack ) ( whites - ( 1 - isBlack ) ) s
	where
		isBlack = which 1 0 $ c == '#'

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



//main関数
int main() {
    //入力
    long N,Q;
    cin>>N>>Q;
    vector<long> S(N),T(N),X(N);
    for(int i=0;i<N;i++){
        cin>>S.at(i)>>T.at(i)>>X.at(i);
    }
    vector<long> D(Q);
    for(int i=0;i<Q;i++){
        cin>>D.at(i);
    }
    
    
    
    //計算
    multiset<tuple<long,long,long>> start, goal;
    for(int i=0;i<N;i++){
        if(T.at(i)>X.at(i)){
            start.insert(make_tuple(S.at(i)-X.at(i),X.at(i),i));
            goal.insert(make_tuple(T.at(i)-X.at(i),X.at(i),i));
        }
    }
    
    
    //出力
    multiset<pair<long,long>> block;
    auto ite=start.begin(),itete=goal.begin();
    for(int i=0;i<Q;i++){
        while(ite!=start.end()&&get<0>(*ite)<=D.at(i)){
            block.insert(make_pair(get<1>(*ite),get<2>(*ite)));
            ite++;
        }
        while(itete!=goal.end()&&get<0>(*itete)<=D.at(i)){
            long I=get<2>(*itete);
            auto ittete=block.lower_bound(make_pair(X.at(I),I));
            block.erase(ittete);
            itete++;
        }
        
        if(block.size()>0){
            auto ittetete=block.begin();
            cout<<((*ittetete).first)<<endl;
        }else{
            cout<<-1<<endl;
        }
    }
}

Measured memory_bytes: 45056
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pint = pair<int, int>;
using pll = pair<ll, ll>;
using Edge = pair<int, ll>;
using Graph = vector<vector<int>>;
using WeightedGraph = vector<vector<Edge>>;
const ll INF64 = 1LL << 60;
const int INF32 = 1 << 29;
const ll MOD = 1000000007;

const int CASES = 1;

void solve() {
    string u; cin >> u;
    int n = u.size();
    for (int i = 0; i < n; ++i) {
        cout << 'x';
    }
    cout << endl;
}

int main() {
#ifdef MYLOCAL
    vector<string> filenames {"input1.txt", "input2.txt", "input3.txt", "input4.txt", "input5.txt"};
    cout << "------------\n";
    for(int i = 0; i < CASES; ++i){
        ifstream in(filenames[i]);
        cin.rdbuf(in.rdbuf());
        solve();
        cout << "------------\n";
    }
#else

    solve();

#endif
    return 0;
}


Measured memory_bytes: 256
#include "bits/stdc++.h"
#include<unordered_map>
#include<unordered_set>
#pragma warning(disable:4996)
using namespace std;
using ld = long double;
template<class t>
using table = vector<vector<t>>;
const ld eps=1e-9;

//// < "d:\d_download\visual studio 2015\projects\programing_contest_c++\debug\a.txt"
struct ore {
	vector<int>rights;
	vector<int>lens;
};
bool operator ==(const ore&l, const ore&r) {
	return l.rights == r.rights&&l.lens == r.lens;
}
ore getrev(ore a) {
	for (auto &r : a.rights) {
		r = !r;
	}
	reverse(a.rights.begin(), a.rights.end());
	reverse(a.lens.begin(), a.lens.end());
	return a;
}
int main() {
	while (1) {
		int N; cin >> N;
		if (!N) {
			break;
		}
		ore origin;
		{
			int m; cin >> m;
			int px, py; cin >> px >> py;
			int way = -1;
			vector<int>arights;
			vector<int>lens;
			for (int j =1 ; j < m; ++j) {
				int x, y; cin >> x >> y;
				const int dx = x - px;
				const int dy = y - py;
				int newway;
				if (!dx)newway = dy > 0 ? 3 : 1;
				else newway = dx > 0 ? 0 : 2;
				if (j != 1) {
					if (way == (newway + 1) % 4) {
						arights.push_back(1);
					}
					else {
						arights.push_back(0);
					}
				}
				way = newway;
				lens.push_back(abs(dx) + abs(dy));
				px = x; py = y;
			}
			origin.lens = lens;
			origin.rights = arights;
		}
		vector<ore>ores;
		int ans = 0;
		for (int i = 0; i < N; ++i) {
			int m; cin >> m;
			int px, py; cin >> px >> py;
			int way = -1;
			vector<int>arights;
			vector<int>lens;
			for (int j = 1; j < m; ++j) {
				int x, y; cin >> x >> y;
				const int dx = x - px;
				const int dy = y - py;
				int newway;
				if (!dx)newway = dy > 0 ? 3 : 1;
				else newway = dx > 0 ? 0 : 2;
				if (j != 1) {
					if (way == (newway + 1) % 4) {
						arights.push_back(1);
					}
					else {
						arights.push_back(0);
					}
				}
				way = newway;
				lens.push_back(abs(dx) + abs(dy));
				px = x; py = y;
			}
			ore o;
			o.lens = lens;
			o.rights = arights;
			bool same = false;
			ore ao = getrev(o);
			if (o == origin)same = true;
			else if (getrev(o) == origin)same = true;
			if (same)cout << i + 1 << endl;
		}
		cout << "+++++" << endl;
	}
	return 0;
}

Measured memory_bytes: 3072
# -- coding: utf-8 --
a = int(input())
b = int(input())
c = int(input())
x = int(input())
count = 0
for i in range(a+1):
    for j in range(b+1):
        for k in range(c+1):
            if x == i * 500 + j * 100 + k * 50:
                count +=1

print(count)

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

const int N = 1e5+5;
int n, a[N], dp[N];

int32_t main() {
  scanf("%d", &n);

  for (int i = 0; i < n; i++)
    scanf("%d", a+i);

  dp[1] = abs(a[0] - a[1]);
  for (int i = 2; i < n; i++)
    dp[i] = std::min(abs(a[i]-a[i-1]) + dp[i-1], abs(a[i]-a[i-2]) + dp[i-2]);

  printf("%d\n", dp[n-1]);
  return 0;
}


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

typedef long long LL;
typedef long double LD;
typedef pair < int, int > PII;
typedef pair < LL, LL > PLL;
typedef pair < LD, LD > PDD;

#define _upgrade ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define all(x) (x).begin(), (x).end()
#define sz(x) (int)(x).size()
template < typename _T > inline void _DBG(const char *s, _T x) { cerr << s << " = " << x << "\n"; }
template < typename _T, typename... args > void _DBG(const char *s, _T x, args... a) { while(*s != ',') cerr << *s++; cerr << " = " << x << ','; _DBG(s + 1, a...); }

#ifdef LOCAL
#define DBG(...) _DBG(#__VA_ARGS__, __VA_ARGS__)
#else
#define DBG(...) (__VA_ARGS__)
#define cerr if(0) cout
#endif

// ********************** CODE ********************** //

int main()
{
    _upgrade
    int n; cin >> n;
    int p = 1;
    while(2 * p <= n) p <<= 1;
    cout << p << "\n";
	return 0;
}


Measured memory_bytes: 256
import numpy as np
from fractions import gcd
n, x = map(int, input().split())
X = np.array(list(map(int, input().split())))

X = np.abs(X - x)
X = np.sort(X)

ans = X[0]
for i in range(1,n):
    ans = gcd(ans, X[i])
print(ans)

Measured memory_bytes: 25012
n=int(input())
ab=[]
sumb=0
for _ in range(n):
    a,b=map(int,input().split())
    ab.append(a+b)
    sumb+=b
ab.sort(reverse=True)
ans=0
for i in range(n):
    if i%2==0:
        ans+=ab[i]
print(ans-sumb)

Measured memory_bytes: 7492
#include <iostream>
#include <vector>
#include <cmath>
using namespace std;
int main(int argc, char const *argv[]) {
    int n;
    cin >> n;
    int pet[n];
    for(int i=0;i<n;i++){
        cin >> pet[i];
    }
    int count = 1;
    int sum = 0;
    for(int i=0;i<n-1;i++){
        if(pet[i] == pet[i+1]){
            count++;
            //cout << "count :" << count << endl;
        }else {
            sum += count/2 ;
            count = 1;
        }
    }
    sum += count / 2;
    cout << sum << endl;
    return 0;
}


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

using namespace std;

class Node {

private:
  Node* left;
  Node* right;

public:
  Node() {
    this->left = NULL;
    this->right = NULL;
  }

  Node(string input) {
    
    int level = 0;

    for(int i = 0;i < input.length();i++) {

      if(input[i] == '(') level++;

      if(input[i] == ')') level--;

      if(level == 1 && input[i] == ',') {
	
	string leftString = input.substr(1, i-1);
	string rightString = input.substr(i+1, input.length()-i-2);

	if(leftString.length() == 0) {
	  this->left = NULL;
	}
	else {
	  this->left = new Node(leftString);
	}
	
	if(rightString.length() == 0) {
	  this->right = NULL;
	}
	else {
	  this->right = new Node(rightString);
	}

      }
	
    }
      
  }

  string toString() {

    string res = "";

    if(this == NULL) return "";

    res += "(";

    if(this->left != NULL) res += this->left->toString();
    
    res += ",";

    if(this->right != NULL) res += this->right->toString();

    res += ")";

    return res;

  }

  Node* intersection(Node* other) {

    Node* intersect = new Node();
    
    if(this->left != NULL && other->left != NULL) {

      intersect->left = this->left->intersection(other->left);

    }

    if(this->right != NULL && other->right != NULL) {

      intersect->right = this->right->intersection(other->right);

    }

    return intersect;

  }

  Node* union_(Node* other) {

    Node* uni = new Node();

    if(this->left != NULL && other->left != NULL) {

      uni->left = this->left->union_(other->left);

    }

    else {

      uni->left = this->left ? this->left : other->left;

      

    }

    if(this->right != NULL && other->right != NULL) {

      uni->right = this->right->union_(other->right);

    }

    else {

      uni->right = this->right ? this->right : other->right;


    }

    return uni;

  }

};

int main() {

  string op;
  string nodestr, otherstr;

  while(cin >> op >> nodestr >> otherstr) {

    Node* result;
    Node node(nodestr), other(otherstr);

    if(op == "i") {

      result = node.intersection(&other);

    }

    else if(op == "u") {

      result = node.union_(&other);

    }

    cout << result->toString() << endl;


  }
  // Node n("((,(,)),((,),))");
  // Node other("((,),)");

  // Node* res = n.intersection(&other);
  // cout << res->toString() << endl;

  // Node* res2 = n.union_(&other);
  // cout << res2->toString() << endl;

  return 0;

}

Measured memory_bytes: 1260