akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<queue>
#include<cmath>
#include<cstdio>
#include<tuple>
#include<bitset>
#include<map>

using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<n;++i)
#define rep1(i,n) for(int i=1;i<=n;++i)
#define ALL(x) x.begin(),x.end()
#define ll long long
typedef pair<int,int> P;
const int inf=1000000007;
const int MOD=1000000007;
struct Node{
    int no;
    int par;
    int dist;
    int sum;
    bool par_n;
    vector<Node*> child;
    void build(int i){
        no=i;
        par=i;
        dist=0;
        sum=1;
        par_n=false;
    }
};
struct Tree{
    int n;
    vector<Node> node;
    Tree(int k){
        n=k;
        node.resize(n+1);
        for(int i=1;i<=n;++i){
            node[i].build(i);
        }
    }
    void input(int k){
        for(int i=0;i<k;++i){
            int a,b;cin>>a>>b;
            node[a].child.push_back(&node[b]);
            node[b].child.push_back(&node[a]);
        }
    }
    void BFS(int s){
        queue<Node> que;
        que.push(node[s]);
        while(!que.empty()){
            Node buf=que.front();que.pop();
            int num=buf.child.size();
            for(int i=0;i<num;++i){
              if(buf.child[i]->no==n){
                buf.child[i]->par_n=true;
              }
                if(buf.child[i]->no!=buf.par){
                    buf.child[i]->par=buf.no;
                    buf.child[i]->dist=buf.dist+1;
                    que.push(*buf.child[i]);
                }
            }
        }
    }
    void DFS(Node& node){
        if(node.child.size()==1&&node.par!=node.no){
            return;
        }
        else{
            int num=node.child.size();
            for(int i=0;i<num;++i){
                if(node.child[i]->no!=node.par){
                    DFS(*node.child[i]);
                    node.sum+=node.child[i]->sum;
                    if(node.child[i]->par_n)node.par_n=true;
                }
            }
        }
    }
};
signed main(){
  int n;cin>>n;
  Tree tree(n);
  tree.input(n-1);
  tree.BFS(1);
  tree.DFS(tree.node[1]);
  int num=tree.node[n].dist-1;
  int white=0;
  rep1(i,n){
    if(tree.node[i].dist==(num+1)/2+1&&tree.node[i].par_n){
      white=max(white,tree.node[i].sum);
    }
  }
	if(n-white>white){
    cout<<"Fennec"<<endl;
  }
  else{
    cout<<"Snuke"<<endl;
  }
  return 0;
}


Measured memory_bytes: 12928
import std.stdio, std.algorithm, std.conv, std.array, std.string, std.math, std.typecons, std.numeric, std.container;

long P = 10^^9+7;
long[1001] F, RF;

long pow(long x, long n) {
    long y = 1;
    while (n) {
        if (n%2 == 1) y = (y * x) % P;
        x = x^^2 % P;
        n /= 2;
    }
    return y;
}

long inv(long x)
{
    return pow(x, P-2);
}

void init()
{
    F[0] = F[1] = 1;
    foreach (i, ref x; F[2..$]) x = (F[i+1] * (i+2)) % P;

    {
        RF[$-1] = 1;
        auto x = F[$-1];
        auto k = P-2;
        while (k) {
            if (k%2 == 1) RF[$-1] = (RF[$-1] * x) % P;
            x = x^^2 % P;
            k /= 2;
        }
    }
    foreach_reverse(i, ref x; RF[0..$-1]) x = (RF[i+1] * (i+1)) % P;
}

long comb(N)(N n, N k)
{
    if (k > n) return 0;
    auto n_b = F[n];    // n!
    auto nk_b = RF[n-k]; // 1 / (n-k)!
    auto k_b = RF[k];    // 1 / k!

    auto nk_b_k_b = (nk_b * k_b) % P; // 1 / (n-k)!k!

    return (n_b * nk_b_k_b) % P;  // n! / (n-k)!k!
}

long perm(N)(N n, N k)
{
    if (k > n) return 0;
    auto n_b = F[n];
    auto n_k_b = RF[n-k];
    return (n_b * n_k_b) % P;
}

void main()
{
    init();
    auto nk = readln.split.to!(long[]);
    auto N = nk[0];
    auto K = nk[1];
    writeln(comb(K, N) * F[N] % P);
}


Measured memory_bytes: 2508
#include <bits/stdc++.h>
#include <math.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
const ll mod = 998244353;
const ll INF = 1001001001;
const ll LINF = 1001001001001001001;

void prvec(vector<ll> vec){
    ll n = vec.size();
    rep(i,n) cout << i << " " << vec.at(i) << "\n";
}

void pr2d(vector<vector<ll>> vvec){
    ll h = vvec.size();
    ll w = vvec.at(0).size();
    rep(i,h){
        rep(j,w){
            cout << vvec.at(i).at(j) << " ";
        }
        cout << "\n";
    }
}

int main(){
    ll n ; cin >> n;
    ll cnt = 0;
    ll mx = 0;
    rep(i,n){
        ll x,y; cin >> x >> y;
        if(x==y) cnt++; else cnt = 0;
        mx = max(mx,cnt);
    }
    if(mx>=3) cout << "Yes"; else cout << "No";
    cout << endl;
    return 0;
}


Measured memory_bytes: 3532
//organize and stay in moment - Abhinav IIIT-A
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define f(i,x,n) for(int i=x;i<n;++i)
#define ar array
#define MAXN (int)2e5+5
#define pb push_back
int mod= 998244353;
int arr[MAXN];
int as;
void input(){
  cin>>as;
  f(i,0,as) cin>>arr[i];
}
void q1(){
  string s; cin>>s;
  int a=0,b=0;
  f(i,0,3)
  s[i]=='A'  ? ++a : ++b;
  if(a&&b)
    cout<<"Yes";
  else cout<<"No";
}
void q2(){
  int n,a,b;
  cin>>n>>a>>b;
  int t=a+b;
  int q=n/t;
  int ans=q*a;
  int r=n%t;
  ans+=min(r,a);
  cout<<ans;
}
void q3(){
  int a,b; cin>>a>>b;
  for(int i=1;i<=100000;++i){
    int x=i*8; x/=100;
    int y=i*10; y/=100;
    if(x==a && y==b){
      cout<<i;
      return ;
    }
  }
  cout<<-1;
}
void q4(){
  string s; cin>>s;
  deque<int> q;
  f(i,0,s.size())
  q.push_back(s[i]);
  int Q; cin>>Q;
  int curr=0;
  while(Q--){
    int t;
    cin>>t;
    if(t==1){
      curr=1-curr;
    }else{
      // 0 0 begin
      //0 1 end
      //1 0 end
      //1 1 begin
      int f;char c; cin>>f>>c;
      if((f+curr)%2==0)
        q.push_front(c);
      else q.push_back(c);
    }
  }
  string ret="";
  while(!q.empty()){
    ret+=q.front();
    q.pop_front();
  }
  if(curr)
     reverse(ret.begin(),ret.end());
   cout<<ret;
   return ;
}
void q5(){
  int n,p; cin>>n>>p;
  string s; cin>>s;
  int ans=0;
  if(p==2){
    f(i,0,n)
    if((s[i]-'0')%2==0)
      ans+=i+1;
  }else if(p==5){
    f(i,0,n)
    if((s[i]-'0')%5==0)
      ans+=i+1;
  }else {
    int tt=1;
    int curr=0;
     map<int,int> mp;
     mp[0]++;
     for(int i=n-1;i>=0;--i){
        curr+=(s[i]-'0')*tt;
        tt*=10;
        tt%=p; curr%=p;
        ans+=mp[curr];
        ++mp[curr];
     }
  }
  cout<<ans;
}
int mod2=998244353;
void solve(){
 
}
int32_t main()
{
  int t; t=1; //cin>>t;
  while(t--) q3();
  return 0;
}


Measured memory_bytes: 256
n, y = map(int, input().split())
y //= 1000
for i in range(y//10+1) :
  for j in range((y-i*10)//5+1) :
    k = y-i*10-j*5
    if(i+j+k == n and k >= 0) :
      print("{} {} {}".format(i, j, k))
      exit()
print("-1 -1 -1")

Measured memory_bytes: 3060
#include<bits/stdc++.h>
#define     fast                    ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define     ll                      long long
#define     pb                      push_back
#define     M                       1000000007
using namespace std;
int main()
{
    ll n,x,y,sum=0;
    cin>>x;
     cout<<x*x<<endl;


}


Measured memory_bytes: 3556
#include <bits/stdc++.h>
using namespace std;
int main(){
  int N;
  cin >> N;
  vector<int> A(N);
  for (int i = 0; i < N; i++){
    cin >> A[i];
  }
  if (N % 2 == 0){
    vector<vector<long long>> dp(N / 2 + 1, vector<long long>(2, 0));
    //0: left 1: right
    for (int i = 0; i < N / 2; i++){
      dp[i + 1][0] = dp[i][0] + A[i * 2];
      dp[i + 1][1] = max(dp[i][0], dp[i][1]) + A[i * 2 + 1];
    }
    cout << max(dp[N / 2][0], dp[N / 2][1]);
  } else {
    vector<vector<long long>> dp(N / 2 + 1, vector<long long>(3, 0));
    for (int i = 0; i < N / 2; i++){
      dp[i + 1][0] = dp[i][0] + A[i * 2];
      dp[i + 1][1] = max(dp[i][0], dp[i][1]) + A[i * 2 + 1];
      dp[i + 1][2] = max({dp[i][0], dp[i][1], dp[i][2]}) + A[i * 2 + 2];
    }
    cout << max({dp[N / 2][0], dp[N / 2][1], dp[N / 2][2]});
  }
}

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

#define S 8
#define FREE -1
#define NOFREE 1

int row[S],col[S],dpos[2*S-1],dneg[2*S-1];
bool X[S][S];

void initialize(){
    for(int i=0;i<S;i++){
        row[i]=FREE;
        col[i]=FREE;
    }
    for(int i=0;i<2*S-1;i++){
        dpos[i]=FREE;
        dneg[i]=FREE;
    }
}

void prnt(){
    for(int i=0;i<S;i++){
        for(int j=0;j<S;j++){
            if(X[i][j] && row[i]!=j)return;
        }
    }
    for(int i=0;i<S;i++){
        for(int j=0;j<S;j++){
            cout<<((row[i]==j)?"Q":".");
        }
        cout<<endl;
    }
}

void rec(int i){
    if(i==S){
        prnt();
        return;
    }
    for(int j=0;j<S;j++){
        if(NOFREE==col[j] || NOFREE==dpos[i+j] ||
        NOFREE==dneg[i-j+S-1])continue;

        row[i]=j;
        col[j]=dpos[i+j]=dneg[i-j+S-1]=NOFREE;
        rec(i+1);
        row[i]=col[j]=dpos[i+j]=dneg[i-j+S-1]=FREE;
    }
}
int main(){
    initialize();
    for(int i=0;i<S;i++){
        for(int j=0;j<S;j++)X[i][j]=false;
    }
    int k;
    cin>>k;
    for(int i=0;i<k;i++){
        int r,c;
        cin>>r>>c;
        X[r][c]=true;
    }
    rec(0);
    return 0;
}


Measured memory_bytes: 3116
using System;
using System.Text;
using System.Collections.Generic;
using System.Collections;
using System.Linq;
class Problem
{
    static void Main()
    {
        //--------------------------------input--------------------------------//

        int n = Convert.ToInt32( Console.ReadLine() );
        var a = Array.ConvertAll( Console.ReadLine().Split(), Convert.ToInt32 );

        //--------------------------------solve--------------------------------//

        int min = a[0];
        int kq = 0;
        for(int i = 0 ; i < n ; i++)
            if(a[i] >= min)
            {
                kq++;
                min = a[i];
            }
        Console.WriteLine( kq );
    }




}

Measured memory_bytes: 11220
#include<stdio.h>
#include<assert.h>
#include<math.h>
#include<string.h>
int stack[110];
int top = 0;

void push(int v){ stack[top++] = v; }
int  pop(){ return stack[--top]; }
int getInt(char *s)
{
  int i,ret=0;
  int size = strlen(s);
  for(i=0;i<size;i++)
    {
      ret += (s[i]-'0')*pow(10,size-i-1);
    }
  return ret;
}

int main()
{
  char s[1000];
  while(scanf("%s",s)!=EOF)
    {
      if('0' <= s[0] && s[0] <= '9')
	{
	  int v = getInt(s);
	  push(v);
	  continue;
	}
	  int a,b;
	  b = pop();
	  a = pop();
	  if(s[0] == '+')
	      push(a+b);
	  else if(s[0] == '-')
	    push(a-b);
	  else if(s[0] == '*')
	    push(a*b);
	  else 
	    assert(0);
    }
  printf("%d\n",pop());
  return 0;
}


Measured memory_bytes: 2072
N=int(input())
count=0
def check():
    global count
    if N>=9:
        count+=9
    else:
        count+=N
        return None

    if N>=999:
        count+=999-100+1
    elif N>=100:
        count+=N-100+1
        return None

    if N>=99999:
        count+=99999-10000+1
    elif N>=10000:
        count+=N-10000+1
        return None
check()
print(count)

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

#define REP(i, x) REPI(i, 0, x)
#define REPI(i, a, b) for (int i = int(a); i < int(b); ++i)
#define ALL(x) (x).begin(), (x).end()

typedef long long ll;
using namespace std;

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

  int H, W;
  cin >> H >> W;
  vector<vector<char>> map;
  string S;
  REP(i, H) {
    map.push_back({});
    cin >> S;
    REP(j, W) {
      for (char const &c : S) {
        map.at(i).push_back(c);
      }
    }
  }

  REP(i, H) {
    REP(j, W) {
      int count = 0;

      if (map.at(i).at(j) == '.') {
        for (int y = -1; y <= 1; ++y) {
          for (int x = -1; x <= 1; ++x) {
            int nx = j + x;
            int ny = i + y;

            if ((-1 < nx && nx < W) && (-1 < ny && ny < H)) {
              if (map.at(ny).at(nx) == '#') {
                // cout << i << ":" << j << "/" << ny << ":" << nx << endl;
                ++count;
              }
            }
          }
        }

        map.at(i).at(j) = char('0' + count);
      }
    }
  }

  REP(i, H) {
    REP(j, W) { cout << map.at(i).at(j); }
    cout << endl;
  }

  return 0;
}

Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i = 0; i < n; ++i)
using ll = long long;
const ll MOD = 1000000007;//998244353;
struct UnionFind {
  vector<int> d;
  UnionFind(int n=0): d(n,-1) {}
  int find(int x) {
    if (d[x] < 0) return x;
    return d[x] = find(d[x]);
  }
  bool unite(int x, int y) {
    x = find(x); y = find(y);
    if (x == y) return false;
    if (d[x] > d[y]) swap(x,y);
    d[x] += d[y];
    d[y] = x;
    return true;
  }
  bool same(int x, int y) { return find(x) == find(y);}
  int size(int x) { return -d[find(x)];}
};
int main() {
   ios::sync_with_stdio(false);
   cin.tie(0);
   int n, m; cin >> n >> m;
   UnionFind uf(n);
   rep(i,m){
      int x, y, z; cin >> x >> y >> z;
      x--;y--;
      uf.unite(x,y);
   }
   int ans = 0;
   for (auto &&i : uf.d)
      if (i<0)ans++;
   cout << ans << endl;
}

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

#define rep(i, m, n) for(int(i) = (int)(m); i < (int)(n); ++i)
#define rep2(i, m, n) for(int(i) = (int)(n)-1; i >= (int)(m); --i)
#define REP(i, n) rep(i, 0, n)
#define REP2(i, n) rep2(i, 0, n)
#define all(hoge) (hoge).begin(), (hoge).end()
#define en '\n'
using ll = long long;
using ull = unsigned long long;
template <class T>
using vec = vector<T>;
template <class T>
using vvec = vector<vec<T>>;
typedef pair<ll, ll> P;
constexpr long long INF = 1LL << 60;
constexpr int INF_INT = 1 << 25;
constexpr long long MOD = (ll)1e9 + 7;
//constexpr long long MOD = 998244353LL;
using ld = long double;
static const ld pi = 3.141592653589793L;
typedef vector<ll> Array;
typedef vector<Array> Matrix;

template <class T>
inline bool chmin(T &a, T b) {
    if(a > b) {
        a = b;
        return true;
    }
    return false;
}
template <class T>
inline bool chmax(T &a, T b) {
    if(a < b) {
        a = b;
        return true;
    }
    return false;
}

struct Edge {
    ll to, rev;
    long double cap;
    Edge(ll _to, long double _cap, ll _rev) {
        to = _to;
        cap = _cap;
        rev = _rev;
    }
};
using Edges = vector<Edge>;
using Graph = vector<Edges>;

void add_edge(Graph &G, ll from, ll to, long double cap, bool revFlag,
              long double revCap) {
    G[from].push_back(Edge(to, cap, (ll)G[to].size()));
    if(revFlag)
        G[to].push_back(Edge(from, revCap, (ll)G[from].size() - 1));
}

void solve() {
    ll a, b, c, x, y;
    cin >> a >> b >> c >> x >> y;

    ll ans = INF;
    REP(k, max(x, y) + 1) {
        int j = max(y - k, 0LL);
        int i = max(x - k, 0LL);
        chmin(ans, a * i + b * j + c * k * 2);
    }
    cout << ans << en;
}

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

    solve();

    /*
    ll t;
    cin >> t;
    REP(i, t) { solve();}
    */

    return 0;
}


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

long gcd(long a,long b) {
	if (a == 0)return b;
	return gcd(b % a, a);
}

int main() {
	int N; cin >> N;
	long a[110000];
	for (int i = 0; i < N; i++) {
		cin >> a[i];
	}
	long g = a[0];
	for (int i = 0; i < N; i++) {
		if (g > a[i])g = gcd(a[i], g);
		else g = gcd(g, a[i]);
	}
	cout << g;
}

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

import sys

def solve_sim_equ(a, b, c, d, e, f):
    '''
    This function solves following equation.
    ax + by = c
    dx + ey = f
    '''
    if a==0 and d==0:
        if b==0 and e==0:
            return 0., 0.
        if b != 0:
            return 0., c/b+0.
        else:
            return 0., f/e+0.
    elif b==0 and e==0:
        if a != 0:
            return 0., d/a+0.
        else:
            return 0., a/d+0.

    if b == 0:
        a, d = d, a
        b, e = e, b
        c, f = f, c
    g = e / b
    x = (g*c - f) / (g*a - d)
    y = (c - a*x) / b
    return x+0., y+0.

def main():
    for line in sys.stdin:
        a,b,c,d,e,f = map(float, line.split())
        x, y = solve_sim_equ(a, b, c, d, e, f)
        print('{0:.3f} {1:.3f}'.format(x,y))

if __name__ == '__main__':
    main()

Measured memory_bytes: 7540
#include<bits/stdc++.h>
//#include<iostream>
//#include<cstdio>
//#include<stdlib.h>
//#include<string.h>
//#include<algorithm>
using namespace std;
#define SPEED ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define READ freopen("in.txt","r",stdin)
#define WRITE freopen("out.txt","w",stdout);
#define pb push_back
#define mem(arr,val) memset(arr,val,sizeof(arr))
#define sf(x) scanf("%d",&x)
#define sf2(x,y) scanf("%d %d",&x,&y)
#define sf3(x,y,z) scanf("%d %d %d",&x,&y,&z)
#define sl(x) scanf("%lld",&x)
#define sl2(x,y) scanf("%lld %lld",&x,&y)

#define sl3(x,y,z) scanf("%lld %lld %lld",&x,&y,&z)
#define sd(x) scanf("%lf",&x);
#define pLL pair<long long,long long>
#define pDB pair<double,double>
#define ff first
#define sn second
#define PRINT_CASE  printf("Case %d: ",tc++)
#define PRINT_CASENL  printf("Case %d:\n",tc++)
//#define mx 100005
#define lnd tree[ind<<1]
#define rnd tree[(ind<<1)+1]
#define cnd tree[ind]
#define lndp b,(b+e)>>1,(ind<<1)
#define rndp ((b+e)>>1)+1,e,(ind<<1)+1
#define IN(a,x,y) (a>=x && a<=y)
#define popcountL __builtin_popcountll
#define popcount __builtin_popcount
/// int other=mask^((1<<n)-1);
typedef long long ll;
typedef long long int lln;
typedef pair<int,int> pii;
ll INF=1<<28;
//typedef long long lld;
const double PI=acos(-1.0);
//int fx[]={1,-1,0,0}; //direction array
//int fy[]={0,0,1,-1};
int dir[4][2]={1,0,-1,0,0,-1,0,1};
int knight[8][2]={1,2,1,-2,2,1,2,-1,-1,2,-1,-2,-2,1,-2,-1};
const long double EPS=1e-7;
//#define INF 10000

struct compare
{
  bool operator()(const pair<int,pii>& l, const pair<int,pii>& r)
  {
      if(l.ff==r.ff)
      {
          return l.sn.ff>r.sn.ff;
      }
      return l.ff<r.ff;
  }
};
// bool operator<(pair<int,pii> l, pair<int,pii> r)
//  {
//      if(l.ff==r.ff)
//      {
//          cout<<"ok "<<endl;
//          return l.sn.ff<r.sn.ff;
//      }
//      return l.ff>r.ff;
//  }

/////////////////////////////////////template sesh/////////////////////////////////////////////////////

///code goes from here
const int mx=500150;
///
int mod=1000000007;

int arr[mx];

int main()
{
//    SPEED;
    int n;
    sf(n);
    n%=1000;
    n=1000-n;
    n%=1000;
    cout<<n<<endl;
    return 0;
}



Measured memory_bytes: 3756
import java.util.ArrayList;
import java.util.Scanner;

public class Main {
    char[] cs;
    int n;

    public static void main(String[] args) {
        Main m = new Main();
        m.read();
        m.solve();
    }

    private void read() {
        Scanner sc = new Scanner(System.in);
        cs = sc.nextLine().toCharArray();
        n = cs.length;
    }

    private void solve() {
        int i = 0;
        int j = n - 1;
        long cnt = 0;
        while (i < j) {
            if (cs[i] == cs[j]) {
                i++;
                j--;
            }
            else if (cs[i] == 'x') {
                i++;
                cnt++;
            }
            else if (cs[j] == 'x') {
                j--;
                cnt++;
            }
            else {
                break;
            }
        }
        if (i >= j)
            System.out.println(cnt);
        else
            System.out.println(-1);
    }
}


Measured memory_bytes: 27080
#include <bits/stdc++.h>
//#define ll long long
#define int long long
#define pb push_back
#define mod 1000000007;
#define inf (1LL<<60)
using namespace std;


int solve(int h[],int b[],int n)
{
    int dp[n];
    map<int,int> m;
    dp[0]=b[0];
    m[h[0]]=dp[0];
    int ans=dp[0];
    for(int i=1;i<n;i++)
    {
        dp[i]=b[i];
        auto it=m.lower_bound(h[i]);
        if(it!=m.begin())
        {
            it--;
            dp[i]+=it->second;
        }
        m[h[i]]=dp[i];
        it=m.upper_bound(h[i]);
        ans=max(ans,dp[i]);
        while(it!=m.end()&&it->second<=dp[i])
        {
            auto temp =it;
            temp++;
            m.erase(it);
            it=temp;
        }
    }
    return ans;
}
signed main()
{
    int n;
    cin>>n;
    int h[n],b[n];
    for(int i=0;i<n;i++)
        cin>>h[i];
    for(int i=0;i<n;i++)
        cin>>b[i];
    cout<<solve(h,b,n);
    return 0;
}


Measured memory_bytes: 17408
#include <algorithm>
#include <bitset>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#define MOD (1000000007l)
#define ll long long
#define rep(i, n) for (ll i = 0; i < (n); i++)

using namespace std;

void solve() {
  string S;
  cin >> S;
  for (auto it: S) cout << 'x';
  cout << endl;
}

int main(void) {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout.precision(12);
  cout << fixed;
  solve();
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main(void){
    // Your code here!
   string s;
   cin>>s;
   int a=0,b=0;
   for(int i=0;i<3;i++)
   {
       if(s[i]=='A')
       a++;
       else
       b++;
   }
   if(a==0 || b==0)
   cout<<"No";
   else
   cout<<"Yes";
   }


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, a, b) for (int i = (a); i < (b); i++)
//#include "library/debug.cpp"

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

    int n;
    cin >> n;

    vector<string> s(n);
    vector<ll> t(n);
    rep(i, 0, n) cin >> s[i] >> t[i];
    string x;
    cin >> x;
    bool ok = false;
    ll ans = 0;
    rep(i, 0, n) {
        if (ok) ans += t[i];
        if (s[i] == x) ok = true;
    }
    cout << ans << endl;
    return 0;
}


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

long long n;
vector<long long> a;

long double solve();

int main() {
  cout << fixed << setprecision(10);
  cin >> n;
  a.resize(n);
  for(int i = 0; i < n; ++i) cin >> a[i];
  cout << solve() << endl;
  return 0;
}

long double solve() {
  long double ans = 1, sum = 0.0;
  for(int i = 0; i < n; ++i) sum += (long double)1.0 / a[i];
  return ans / sum;
}

Measured memory_bytes: 256
import java.io.*;
import java.math.*;
import java.util.*;

public class Main {
    private static boolean debug = false;
    private static boolean elapsed = false;

    private static PrintWriter _out = new PrintWriter(System.out);
    private static PrintWriter _err = new PrintWriter(System.err);

    private void solve(Scanner sc) {
        int N = sc.nextInt();
        int[] a = new int[3 * N];
        for (int i = 0; i < 3 * N; ++i) {
            a[i] = sc.nextInt();
        }

        Queue<Integer> q1 = new PriorityQueue<>();
        long[] sum1 = new long[N + 1];
        for (int i = 0; i < N; ++i) {
            q1.offer(a[i]);
            sum1[0] += a[i];
        }

        Queue<Integer> q2 = new PriorityQueue<>(Collections.reverseOrder());
        long[] sum2 = new long[N + 1];
        for (int i = 2 * N; i < 3 * N; ++i) {
            q2.offer(a[i]);
            sum2[0] += a[i];
        }

        for (int k = N; k < 2 * N; ++k) {
            q1.offer(a[k]);
            int t1 = q1.poll();
            sum1[k - N + 1] = sum1[k - N] + a[k] - t1;

            q2.offer(a[3 * N - k - 1]);
            int t2 = q2.poll();
            sum2[k - N + 1] = sum2[k - N] + a[3 * N - k - 1] - t2;
        }

        long max = Long.MIN_VALUE;
        for (int i = 0; i <= N; ++i) {
            max = Math.max(max, sum1[i] - sum2[N - i]);
        }
        _out.println(max);
    }
    private static BigInteger C(long n, long r) {
        BigInteger res = BigInteger.ONE;
        for (long i = n; i > n - r; --i) {
            res = res.multiply(BigInteger.valueOf(i));
        }
        for (long i = r; i > 1; --i) {
            res = res.divide(BigInteger.valueOf(i));
        }
        return res;
    }
    private static BigInteger P(long n, long r) {
        BigInteger res = BigInteger.ONE;
        for (long i = n; i > n - r; --i) {
            res = res.multiply(BigInteger.valueOf(i));
        }
        return res;
    }
    /*
     * 10^10 > Integer.MAX_VALUE = 2147483647 > 10^9
     * 10^19 > Long.MAX_VALUE = 9223372036854775807L > 10^18
     */
    public static void main(String[] args) {
        long S = System.currentTimeMillis();

        Scanner sc = new Scanner(System.in);
        new Main().solve(sc);
        _out.flush();

        long G = System.currentTimeMillis();
        if (elapsed) {
            _err.println((G - S) + "ms");
        }
        _err.flush();
    }
}

Measured memory_bytes: 97948
import sys
n = int(input())
class Node:
  def __init__(self,v):
    self.p = None
    self.key = v
    self.left = None
    self.right = None

sys.setrecursionlimit(15000)
r = None
def insert(z):
  global r
  y = None
  x = r
  while x != None:
    y = x
    if z.key < x.key:
      x = x.left
    else:
      x = x.right
  z.p = y

  if y == None:
    r = z
  elif z.key < y.key:
    y.left = z
  else:
    y.right = z

ret = []
def inorder(r):
  if r == None: return
  inorder(r.left)
  ret.append(r.key)
  inorder(r.right)

def preorder(r):
  if r == None: return
  ret.append(r.key)
  preorder(r.left)
  preorder(r.right)

def search(r,key):
  if r == None: return None
  if r.key == key:
    return r
  if r.key < key:
    return search(r.right,key)
  else:
    return search(r.left,key)

def delete(key):
  global r
  z = search(r,key)
  if not z.left or not z.right:
    y = z # node to delete
  else:
    y = z.right
    while y.left:
      y = y.left

  if y.left:
    x = y.left # child node of delete node
  else:
    x = y.right

  if x:
    x.p = y.p

  if y.p == None:
    r = x
  elif y == y.p.left:
    y.p.left = x
  else:
    y.p.right = x

  if y != z:
    z.key = y.key

for i in range(n):
  s = input()
  #print(s)
  if s[0]=="i":
    insert(Node(int(s.split()[1])))
  elif s[0]=="f":
    if search(r,int(s.split()[1])) != None:
      print("yes")
    else:
      print("no")
  elif s[0]=="d":
    #print("d",int(s.split()[1]))
    #print(r.key)
    delete(int(s.split()[1]))
  else:
    #print("p")
    ret = []
    inorder(r)
    print(""," ".join(map(str,ret)))
    ret = []
    preorder(r)
    print(""," ".join(map(str,ret)))



Measured memory_bytes: 118480
#include<deque>
#include<queue>
#include<vector>
#include<algorithm>
#include<iostream>
#include<set>
#include<cmath>
#include<tuple>
#include<string>
#include<chrono>
#include<functional>
#include<iterator>
#include<random>
#include<unordered_set>
#include<array>
#include<map>
#include<iomanip>
#include<assert.h>
#include<bitset>
#include<stack>
#include<memory>
using namespace std;
using namespace std::chrono;
typedef long long int llint;
typedef double lldo;
#define mp make_pair
#define mt make_tuple
#define pub push_back
#define puf push_front
#define pob pop_back
#define pof pop_front
#define fir first
#define sec second
#define res resize
#define ins insert
#define era erase
/*cout<<fixed<<setprecision(20);cin.tie(0);ios::sync_with_stdio(false);*/
const llint mod=1000000007;
const llint big=2.19e15+1;
const long double pai=3.141592653589793238462643383279502884197;
const long double eps=1e-15;
template <class T,class U>bool mineq(T& a,U b){if(a>b){a=b;return true;}return false;}
template <class T,class U>bool maxeq(T& a,U b){if(a<b){a=b;return true;}return false;}
llint gcd(llint a,llint b){if(a%b==0){return b;}else return gcd(b,a%b);}
llint lcm(llint a,llint b){if(a==0){return b;}return a/gcd(a,b)*b;}
template<class T> void SO(T& ve){sort(ve.begin(),ve.end());}
template<class T> void REV(T& ve){reverse(ve.begin(),ve.end());}
template<class T>llint LBI(vector<T>&ar,T in){return lower_bound(ar.begin(),ar.end(),in)-ar.begin();}
template<class T>llint UBI(vector<T>&ar,T in){return upper_bound(ar.begin(),ar.end(),in)-ar.begin();}

int main(void){
	cin.tie(0);ios::sync_with_stdio(false);
	string str;cin>>str;
	int lose=0;
	for(auto it:str){if(it=='x'){lose++;}}
	cout<<(lose<8?"YES":"NO")<<endl;
	return 0;
}


Measured memory_bytes: 256
s = input()
ans = 0
if len(s) % 2 == 0:
    head = s[0:len(s) // 2]
    tail = list(reversed(s[len(s) // 2:]))
    for i in range(len(head)):
        if head[i] != tail[i]:
            ans += 1
    print(ans)

else:
    head = s[0:len(s) // 2]
    tail = list(reversed(s[len(s) // 2 + 1:]))
    for i in range(len(head)):
        if head[i] != tail[i]:
            ans += 1
    print(ans)


Measured memory_bytes: 38384
#include <bits/stdc++.h>
#include <functional>
#include<stdio.h>
using namespace std;
#define ll       	unsigned long long int
#define dd      	long double
#define pb          push_back
#define pf          push_front
#define pi         pair<ll,ll>
#define vi          vector<ll>
#define vpi        vector<pi>
#define mi          map<ll,ll>
#define vvi         vector<vector<ll>>
#define mpi         map<pi,ll>
#define pipi        pair<ll,pair<ll,ll> >
#define all(a)      (a).begin(),(a).end()
#define rall(a)     (a).rbegin(),(a).rend()
#define x         first
#define y         second
#define sz(x)       (ll)x.size()
#define u        	'\n'
#define PI          3.141592653589
#define bs(v,n)     binary_search(all((v)),(n))
#define lb(v,n)     lower_bound(all((v)),(n))
#define ub(v,n)     upper_bound(all((v)),(n))
#define fo(i,l,u)   for(i=l;i<u;i++)
#define rfo(i,l,u)  for(i=l;i>=u;i--)
#define rf(s)       for(auto &c : s)
#define allfo(s)    for(auto it=(s).begin();it!=(s).end();it++) //use Iterator
#define tezz        ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define M           998244353
#define ef          else if
#define yes       cout<<"YES"<<'\n';
#define no        cout<<"NO"<<'\n';
#define C         continue;
#define wa(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }
void err(istream_iterator<string> it) {}
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
	cerr << *it << " = " << a << endl;
	err(++it, args...);
}
#define debug(vec) cout<<(#vec)<<": "; for (auto& i: vec) cout<<i<<" "; cout<<'\n'
#define debugp(vec) cout<<(#vec)<<": "; for (auto& i: vec) cout<<i.x<<","<<i.y<<" | "; cout<<'\n'
#include <ext/pb_ds/tree_policy.hpp>     
#include <ext/pb_ds/detail/standard_policies.hpp>
#include <ext/pb_ds/assoc_container.hpp>     
using namespace __gnu_pbds;
typedef tree<pi,null_type,less<pi>,rb_tree_tag,tree_order_statistics_node_update> pbds;
#define fbo find_by_order
#define ook order_of_key
const ll N = 350;
 
ll gcd(ll a, ll b) {  if (a == 0)  return b; return gcd(b % a, a); } 
ll power(ll x, ll y) 
{ 
    ll res = 1;   
    while (y > 0) 
    { 
        if (y & 1) 
        res = res*x; 
        y = y>>1; 
        x = x*x;  
    } 
    return res; 
}

signed main()
{
	tezz
	ll t=1;
	//cin>>t;
	while(t--)
	{
		ll n,x,k,i,j,c=0,ans=0;
		cin>>n>>x>>k;
		if(n==1)
		{
			cout<<x<<u;
			C
		}
		map<ll,ll>m;
		ans+=x;
		ll last=x;
		vi v(100001);
		m[x]=c;
		v[c++]=ans;
		ll now;
		ll flag=0;
		while(c<n)
		{
			now=(last*last)%k;
			if(m[now])
			{
			    flag=1;
			    break;
			}
			else
			m[now]=c;
			last=now;
			ans+=now;
			v[c++]=ans;
		}
		ll rem=n-c;
		if(flag==1 && rem>0)
		{
    		ll between=c-m[now];
    		ll r=rem/between;
    		ans+=(r*(v[c-1]-v[m[now]-1]));
    		ll temp=rem%between;
    		ll ind=m[now]-1;
    		ans+=(v[ind+temp]-v[ind]);
		}
		cout<<ans<<u;
		
	}
	return 0;
} 

Measured memory_bytes: 7120
#include <bits/stdc++.h>
using namespace std;
using uint = unsigned int;
using lint = long long int;
using ulint = unsigned long long int;
template<class T = int> using V = vector<T>;
template<class T = int> using VV = V< V<T> >;
template<class T, class U> void assign(V<T>& v, int n, const U& a) { v.assign(n, a); }
template<class T, class... Args> void assign(V<T>& v, int n, const Args&... args) { v.resize(n); for (auto&& e : v) assign(e, args...); }


int main() {
  cin.tie(nullptr); ios_base::sync_with_stdio(false);
  int x; cin >> x;
  cout <<  (x == 3 or x == 5 or x == 7 ? "YES" : "NO") << endl;
}

Measured memory_bytes: 256
package main

import (
	"fmt"
	"sort"
)

func main() {
	var N int
	s := make([]int, 0, 100)
	fmt.Scanf("%d", &N)
	ret := 0
	for i := 0; i < N; i++ {
		var t int
		fmt.Scanf("%d", &t)
		s = append(s, t)
		ret += t
	}
	if ret%10 == 0 {
		sort.Ints(s)
		for i := 0; i < N; i++ {
			if s[i]%10 != 0 {
				ret -= s[i]
				break
			}
		}
	}
	if ret%10 == 0 {
		fmt.Println(0)
	} else {
		fmt.Println(ret)
	}

}


Measured memory_bytes: 512
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Random;
import java.util.StringTokenizer;
import java.util.TreeSet;

public class Main {
	
	public static void main(String[] args) {
		FastReader scan = new FastReader();
		PrintWriter out = new PrintWriter(System.out);
		Task solver = new Task();
		solver.solve(1, scan, out);
		out.close();
	}
	
	static class Task {
		public void solve(int testNumber, FastReader scan, PrintWriter out) {
			char[] s = scan.next().toCharArray();
			char[] t = scan.next().toCharArray();
			int[][] after = new int[s.length+1][26];
			long total = 0;
			int at = 0;
			for(int i = 0; i < after.length; i++) Arrays.fill(after[i], -1);
			for(int i = s.length-1; i >= 0; i--) {
				for(int j = 0; j < 26; j++) after[i][j] = after[i+1][j];
				after[i][s[i]-'a'] = i+1;
			}
			for(int i = 0; i < t.length; i++) {
				int next = after[at][t[i]-'a'];
				if(next == -1) {
					total += s.length-at;
					next = after[at=0][t[i]-'a'];
				}
				if(next == -1) {
					out.println(-1);
					return;
				}
				total += next - at;
				at = next;
			}
			out.println(total);
		}
	}
	
	static void shuffle(int[] a) {
		Random get = new Random();
		for(int i = 0; i < a.length; i++) {
			int r = get.nextInt(a.length);
			int temp = a[i];
			a[i] = a[r];
			a[r] = temp;
		}
	}
	
	static void shuffle(long[] a) {
		Random get = new Random();
		for(int i = 0; i < a.length; i++) {
			int r = get.nextInt(a.length);
			long temp = a[i];
			a[i] = a[r];
			a[r] = temp;
		}
	}
	

	static class FastReader {
		BufferedReader br;
		StringTokenizer st;

		public FastReader() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}
		public FastReader(String s) throws FileNotFoundException {
			br = new BufferedReader(new FileReader(new File(s)));
		}

		String next() {
			while (st == null || !st.hasMoreElements()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}

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

		long nextLong() {
			return Long.parseLong(next());
		}

		double nextDouble() {
			return Double.parseDouble(next());
		}

		String nextLine() {
			String str = "";
			try {
				str = br.readLine();
			} catch (IOException e) {
				e.printStackTrace();
			}
			return str;
		}
	}

}


Measured memory_bytes: 39636
#include<bits/stdc++.h>
using namespace std;
int n;
int a[2100000];
int l[2100000];
int r[2100000];
long long ans=0;
int main()
{
	scanf("%d",&n);
    r[0]=1;
    l[n+1]=n;
    for(int i=1;i<=n;i++)
    {
       	int x;
       	scanf("%d",&x);
        l[i]=i-1;
        r[i]=i+1;
        a[x]=i;
    }
    for(int i=n;i>=1;i--)
    {
        ans+=1LL*i*(a[i]-l[a[i]])*(r[a[i]]-a[i]);
        r[l[a[i]]]=r[a[i]];
		l[r[a[i]]]=l[a[i]];
    }
	printf("%lld\n",ans);
    return 0;
}

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

int n;

main(){
    int i, j;
    cin >> n;
    for (i = 1; i <= 9; i++) {
        for (j = 1; j <= 9; j++) {
            if (i * j == n) {puts("Yes"); return 0;}
        }
    }
    puts("No");
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> pll;
typedef pair<string, string> pss;
typedef vector<ll> vll;
typedef vector<pll> vpll;
typedef vector<vll> vvll;
typedef vector<vpll> vvpll;
typedef unordered_map<ll, ll> um;
typedef unordered_set<ll> us;

#define fastio ios::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
#define ts ll t; in(t) while (t--) solve();
#define ks ll t; in(t) FOR(i, 1, t+1) out("Case #" << i << ": " << solve());
#define endl '\n'
#define ln cout << endl;
#define in(x) cin >> x;
#define out(x) cout << x << endl;
#define flush cout << flush;
#define reset(a, b) memset(a, b, sizeof(a));
#define ordered_set tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update>
#define FOR(i, a, b) for (ll i = a; i < b; ++i)
#define FORI(i, a, b, c) for (ll i = a; i < b; i += c)
#define FORD(i, a, b) for (ll i = a; i > b; --i)
#define FOREACH(it, v, r) for (auto it = v.begin() + r; it != v.end(); it++)
#define FORALL(it, v) for (auto it : v)
#define F first
#define S second
#define mp make_pair
#define pb push_back
#define vin(v, x) vll v(x); FOR(i, 0, x) in(v[i])
#define all(v) v.begin(), v.end()
#define allr(v, r) v.begin(), v.begin() + r
#define showv(v) FORALL(it, v) cout << it << ' '; ln
#define printv(v) FORALL(it, v) out(it)
#define show2d(v) FORALL(it, v) { FORALL(j, it) cout << j << ' '; ln}
#define showm(v) FORALL(it, v) cout << it.F << ": " << it.S << ' '; ln
#define sortv(v) sort(all(v));
#define revv(v) reverse(all(v));
#define maxv(v) *max_element(all(v))
#define minv(v) *min_element(all(v))
#define gcd __gcd
#define checkbit(n, i) (n >> i) & 1               // check ith bit
#define bitcount __builtin_popcount               // count set bits
#define firstbitindex __builtin_ctz               // count trailing zeros
#define lastbitindex __builtin_clz                // count leading zeros
#define bitparity __builtin_parity                // check set bits are even or odd
#define findv(v, x) (find(all(v), x) != v.end())  // find in a vector
#define findsm(u, x) (u.find(x) != u.end())       // find in a set / map
#define findstr(s, x) (s.find(x) != string::npos) // find in a string
#define sz(a) a.size()
#define precise(x) cout << fixed << setprecision(x);

const ll MAXN = 1e5 + 1, MOD = 998244353, SIZE = 2e7;//, INF = 0x7f7f7f7f7f7f7f7f;
const double EPS = 1e-9, PI = acos(-1);
const int INFi = 0x7f7f7f7f;

//<<------Declare Variables Here----->>//
ll n, q, s, a[MAXN], b, c, d;

//<<-----Implement Functions Here---->>//
void solve()
{
    in(n)
    FOR(i, 0, n)
        cin >> d, a[d]++, s += d;
    in(q)
    FOR(i, 0, q)
        cin >> b >> c, s += a[b] * (c - b), a[c] += a[b], a[b] = 0, out(s)
}

//<<----------Start of Main---------->>//
int main()
{
    fastio
    //ts
    solve();
    return 0;
}

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

int main() {
	int r;

	std::cin >> r;
	if (r < 1200) {
		std::cout << "ABC" << std::endl;
	}
	else if (r < 2800) {
		std::cout << "ARC" << std::endl;
	}
	else {
		std::cout << "AGC" << std::endl;
	}

	return 0;
}

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

string s;
string t;

long long func(int l, int r){
	vector<int> a(r-l, 0);
	for(int i=l; i<r; ++i)
		if(t[i] == 'A') ++a[i-l];
	for(size_t i=1; i<a.size(); ++i)
		a[i] += a[i-1];
	long long res = 0;
	for(int i=l; i<r; ++i)
		if(t[i] == 'T')
			res += a[i-l];
	return res;
}

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	cin >> s;
	for(size_t i=0; i<s.size(); ++i){
		if(i+1<s.size() && s.substr(i, 2) == "BC"){
			t += "T";
			++i;
		}else{
			t += s[i];
		}
	}
	long long ans = 0;
	for(size_t i=0; i<t.size(); ++i){
		if(t[i] == 'A' || t[i] == 'T'){
			int j = i;
			while(t[j] == 'A' || t[j] == 'T') ++j;
			ans += func(i, j);
			i = j-1;
		}
	}
	cout << ans << "\n";
}

Measured memory_bytes: 1684
n = int(input())
a, b = 0, 0
for i in map(int, input().split()):
    if i % 4 == 0:
        a += 1
    elif i % 2 == 0:
        b += 1
c = n - a - b
if b == 0:
    if a + 1 < c:
        print("No")
    else:
        print("Yes")
else:
    if a < c:
        print("No")
    else:
        print("Yes")

Measured memory_bytes: 16976
# import math
from fractions import gcd

a, b, c, d = map(int, input().split())

cd_lcm = c * d // gcd(c, d)

x1 = b//c - (a-1)//c
x2 = b//d - (a-1)//d
x3 = b//cd_lcm - (a-1)//cd_lcm

print((b-(a-1))-x1-x2+x3)


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

int main() {
    int n, q;
    cin >> n;
    map<long, long> a;
    long long sum = 0;
    for (int i = 0; i < n; i++) {
        long tmp;
        cin >> tmp;
        a[tmp]++;
        sum += tmp;
    }

    cin >> q;
    for (int i = 0; i < q; i++) {
        long b, c;
        cin >> b >> c;
        long bnum = a[b];
        long cnum = a[c];
        a[c] = bnum + cnum;
        a[b]=0;
        sum = sum + bnum * c - b * bnum;
        cout << sum << endl;
    }
}

Measured memory_bytes: 9576
#include <iostream>
#include<string.h>
using namespace std;

int main()
{
    int a,b,c,k;
    cin>>a>>b>>c>>k;
    if(k<=a)cout<<k;
    else if(a<k&&k<=(a+b))cout<<a;
    else cout<<a-(k-(a+b));
    return 0;
}

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

typedef pair<int, int> point;

int main()
{
    int m, n;
    while(cin >> m && m) {
        vector<point> star(m);
        int x, y;
        for(int i = 0; i < m; i++) {
            cin >> x >> y;
            star[i] = point(x, y);
        }

        cin >> n;
        vector<point> ps(n);
        for(int i = 0; i < n; i++) {
            cin >> x >> y;
            ps[i] = point(x, y);
        }

        int dx, dy;
        for(int i = 0; i < n; i++) {
            dx = ps[i].first - star[0].first; dy = ps[i].second - star[0].second;
            bool ok1 = true;
            for(int j = 1; j < m; j++) {
                bool ok2 = false;
                x = star[j].first + dx;
                y = star[j].second + dy;
                for(int k = 0; k < n; k++) {
                    if(x == ps[k].first && y == ps[k].second) {
                        ok2 = true;
                        break;
                    }
                }
                if(!ok2) {
                    ok1 = false;
                    break;
                }
            }
            if(ok1) {
                cout << dx << " " << dy << endl;
                break;
            }
        }
    }
}

Measured memory_bytes: 0
import itertools as its

X = int(input())

pows = []
for p in range(1, 1000+1):
    for q in range(2, 1000+1):
        n = p**q
        if n > X:
            break
        else:
            pows.append(n)

pows.sort(reverse=True)

print(pows[0])


Measured memory_bytes: 3060
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<map>
#include<set>

using namespace std;

int main(void){
    long long A, B;
    cin >> A >> B;
    long long l = 0, u = 0;
    for(long long a = (A / 4) * 4; a < A; a++) l ^= a;
    for(long long b = (B / 4) * 4; b <= B; b++) u ^= b;
    cout << (l ^ u) << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

#define sf scanf
#define pf printf
#define pb push_back
#define mp make_pair
#define PI ( acos(-1.0) )
#define mod 1000000007
#define maxn 100005
#define IN freopen("nocross.in","r",stdin)
#define OUT freopen("nocross.out","w",stdout)
#define FOR(i,a,b) for(i=a ; i<=b ; i++)
#define DBG pf("Hi\n")
#define INF 2000000000
#define i64 long long int
#define eps (1e-8)
#define xx first
#define yy second
#define ln 17
#define off 2

using namespace __gnu_pbds;
using namespace std ;

typedef tree< i64, null_type, less<i64>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;

int p[100005] ;

int main()
{
    int i , j , k , n , ans = 0 ;

    scanf("%d",&n) ;

    int fl = 0 ;
    for(i=1 ; i<=n ; i++)
    {
        int a ;
        scanf("%d",&a) ;
        if( a==i ) fl++ ;
        else{
            ans += (fl+1)/2 ;
            fl = 0 ;
        }
    }

    ans += (fl+1)/2 ;

    printf("%d\n",ans) ;

    return 0 ;
}


Measured memory_bytes: 256
#include <cstdio>
#include <climits>
#include <iostream>
#include <algorithm>
#include <string>
#include <cstdio>
#include <climits>
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <utility>
#include <queue>
#include <cstring>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
const long long MOD = 1000000007;

typedef long long ll;

  
int
main(int argc, char *argv[])
{
  int n, p, a[55], f = 0;
  cin >> n >> p;
  rep(i, n) {
    cin >> a[i];
  }
  
  ll dp[60][3];
  dp[0][0] = 1;
  dp[0][1] = 0;
  for (int i = 1; i <= n; i++) {
    if (a[i - 1] % 2) {
      dp[i][0] = dp[i - 1][0] + dp[i - 1][1];
      dp[i][1] = dp[i][0];
    } else {
      dp[i][0] = (ll)2 * dp[i - 1][0];
      dp[i][1] = (ll)2 * dp[i - 1][1];
    }
  }
  cout << dp[n][p] << endl;
  
  return 0;
}


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


using namespace std;

int main() {
    double x1, x2, y1, y2;
    cin >> x1 >> y1 >> x2 >> y2;
    cout << setprecision(10) << sqrt(pow(abs(x1-x2), 2) + pow(abs(y1-y2), 2)) << endl;
    return 0;
}


Measured memory_bytes: 3224
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;

class Program
{
    static void Main(string[] args)
    {
        var n = int.Parse(Console.ReadLine());
        var al = Console.ReadLine().Split(' ')
            .Select(x => long.Parse(x))
            .ToArray();
        var count = 0;
        while (true)
        {
            al = al.Where(x => x % 2 == 0)
                .Select(x => x / 2)
                .ToArray();
            if (al.Count() != n)
            {
                Console.WriteLine(count);
                break;
            }
            count++;
        }
    }
}

Measured memory_bytes: 28364
#!/usr/bin/env python3
import sys


def solve(N: int, a: "List[int]"):
    s = {1}
    i = 1
    c = 0
    while True:
        c += 1
        i = a[i-1]
        if i == 2:
            print(c)
            break
        if i in s:
            print(-1)
            break
        s.add(i)

    return


# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    a = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, a)

if __name__ == '__main__':
    main()


Measured memory_bytes: 90804