akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
#define fr(i,n) for (int i = 1; i <= n; i++)
#define mod 1000000007
#define pb push_back
#define ff first
#define ss second
#define ii pair<ll,ll>
#define vi vector<int>
#define vii vector<ii>
#define ll long long int
#define INF 1000000000
#define endl '\n'
using namespace std;
vector<int>v[2000001];
vector<int>parent(2000001,-1);
int R[2000001]={1};
ll ct=0;
int find(int a){
	//cout<<parent[a]<<endl;
	if(parent[a]<0)
	return a;
	return parent[a]=find(parent[a]);
}
void u(int a,int b){
	//cout<<a<<b<<endl;
	parent[a]=-(abs(parent[a])+abs(parent[b]));
	//cout<<parent[a]<<endl;
	if(R[a]>=R[b]){
			parent[b]=a;
			R[a]+=R[b];		
	}
	else{
		parent[a]=b;
		R[b]+=R[a];
	}
	// Rank decrease we can find in o(logn) max time;

}
int main()
{
//	freopen("in4.txt", "r", stdin); 
//    freopen("output4.txt", "w", stdout);

	ll n,m,a,b;
	cin>>n>>m;
	for(int i=1;i<=n;i++){
		v[i].pb(i);
	}
	for(int i=1;i<=m;i++){
		cin>>a>>b;
		a=find(a);
		//cout<<a<<endl;
		b=find(b);
		//cout<<b<<endl;
		if(a!=b)
		u(a,b);
	}
	int maxi=INT_MIN;
	for(int i=1;i<=n;i++){
		//cout<<parent[i]<<" ";
		if(parent[i]<0){
			maxi=max(maxi,abs(parent[i]));
		}
	}
	cout<<maxi<<endl;
}

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

int main(){
	int x, ans = 0;
	cin >> x;
	
	for(int i = 1; i <= x; i++){
		int p = 0;
		for(int j = 2;; j++){
			int temp = pow(i, j);
			if(i == 1){
				ans = 1;
				break;
			}
			if(temp > x){
				ans = max(ans, p);
				break;
			}
			p = temp;
		}
	}
	
	cout << ans << endl;
	
	return 0;
}

Measured memory_bytes: 256
#![allow(unused_mut)]
#![allow(non_snake_case)]
#![allow(unused_macros)]
#![allow(unused_variables)]
#![allow(unused_imports)]
// https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

macro_rules! max {
    ($x: expr) => ($x);
    ($x: expr, $($y: expr),+) => {
        ::std::cmp::max($x, max!($($y),+))
    };
}

macro_rules! min {
    ($x: expr) => ($x);
    ($x: expr, $($y: expr),+) => {
        ::std::cmp::min($x, max!($($y),+))
    };
}

use std::cmp;
use std::collections::{HashSet, BinaryHeap, VecDeque};
use std::iter::FromIterator;
fn main() {
    input!{
        N: usize,
        M: usize,
        A: [usize; N],
        exchange: [(usize, usize); M],
    }

    A.sort();
    exchange.sort_by(|a, b| b.1.cmp(&a.1));

    let mut a_ind = 0;

    'outer: for &(b, c) in exchange.iter() {
        for _ in 0..b {
            if a_ind >= A.len() {
                break 'outer;
            } else if A[a_ind] >= c {
                break 'outer;
            } else {
                A[a_ind] = c;
                a_ind += 1;
            }
        }
    }

    println!("{}", A.iter().sum::<usize>());
}

Measured memory_bytes: 8444
#include<stdio.h>

int main()
{
	long long int N,i,j=0,min,A[200005];

	scanf("%lld",&N);

	for (i=0;i<N;i++)
		scanf("%lld",&A[i]);

	min=A[0];

	for(i=0;i<N;i++)
	{
		if (A[i]<=min)
		{
			j++;
			min=A[i];
		}
	}
	printf("%lld\n",j);
	return 0;
}


Measured memory_bytes: 1664
#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <map>
#include <queue>
#include <stack>
#include <algorithm>
#include <fstream>
#include <sstream>
#include <iomanip>
#define ll long long

using namespace std;

long long MOD = 1000000007;

int max_;
vector<int> used;
vector<vector<int>> edge;
int cnt;
vector<int> H;

int main(){
    int N, M;
    cin >> N >> M;
    H=vector<int>(N,0);
    for(auto &h:H){
        cin >> h;
    }

    edge =vector<vector<int>>(N,vector<int>(0));
    for(int i=0; i<M; i++){
        int a,b;
        cin >> a >> b;
        a--;b--;
        edge[a].push_back(b);
        edge[b].push_back(a);
    }

    int ans=0;
    for(int i=0; i<N; i++){
        int tmp=1;
        for(auto e:edge[i]){
            if(H[i]<=H[e]){
                tmp=0;
                break;
            }
        }
        ans+=tmp;
    }
    cout << ans << endl;
}

Measured memory_bytes: 8732
s = map(int, list(raw_input()))
sum = 0
for i in xrange(0, int(1 << len(s) - 1)):
    temp_num = 0
    for j in xrange(0, len(s)):
        cur_num = s[j]
        if i % 2 == 1:
            temp_num += cur_num
            if j != len(s) - 1:
                sum += temp_num
                temp_num = 0
        else:
            temp_num += cur_num
        i /= 2
        if j == len(s) - 1:
            sum += temp_num
            temp_num = 0
        temp_num *= 10
print sum


def sum(total, s):
    r = 0
    for i in range(len(s)):
        if i == 0:
            r = total + int(s)
        else:
            r += sum(total + int(s[:i]), s[i:])
    return r



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

//#define int long long
struct Fast {Fast(){std::cin.tie(0);ios::sync_with_stdio(false);}} fast;

/* cpp template {{{ */

/* short */
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define Fi first
#define Se second
#define ALL(v) (v).begin(), (v).end()
#define RALL(v) (v).rbegin(), (v).rend()
#define X real()
#define Y imag()

/* REPmacro */
#define REPS(i, a, n) for (ll i = (a); i < (ll)(n); ++i)
#define rep(i, n) REPS(i, 0, n)
#define REP0(i,n) for (ll i = 0; i <= (ll)(n); ++i)
#define REP1(i,n) for (ll i = 1; i <= (ll)(n); ++i)
#define RREP(i, n) REPS(i, 1, n + 1)
#define DEPS(i, a, n) for (ll i = (a); i >= (ll)(n); --i)
#define DEP(i, n) DEPS(i, n, 0)
#define EACH(i, n) for (auto&& i : n)

/* debug */
#define debug(x) cerr << x << " " << "(L:" << __LINE__ << ")" << '\n';

/* alias */
using ll = long long;
using ull = unsigned long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using pii = pair<int, int>;
using D = double;
using P = complex<D>;
using vs = vector<string>;
template <typename T> using PQ = priority_queue<T>;
template <typename T> using minPQ = priority_queue<T, vector<T>, greater<T>>;

/* const */
const int INF = 1001001001;
const ll LINF = 1001001001001001001ll;
const int MOD = 1e9 + 7;
const D EPS = 1e-9;
const int dx[] = {0, 1, 0, -1, 1, -1, 1, -1}, dy[] = {1, 0, -1, 0, 1, -1, -1, 1};

/* func */
inline bool inside(int y, int x, int H, int W) {return y >= 0 && x >= 0 && y < H && x < W;}
inline int in() {int x; cin >> x; return x;}
inline ll IN() {ll x; cin >> x; return x;}
inline vs split(const string& t, char c) {vs v; stringstream s(t); string b; while(getline(s, b, c)) v.eb(b); return v;}
template <typename T> inline bool chmin(T& a, const T& b) {if (a > b) a = b; return a > b;}
template <typename T> inline bool chmax(T& a, const T& b) {if (a < b) a = b; return a < b;}
template <typename T, typename S> inline void print(const pair<T, S>& p) {cout << p.first << " " << p.second << endl;}
template <typename T> inline void print(const T& x) {cout << x << '\n';}
template <typename T, typename S> inline void print(const vector<pair<T, S>>& v) {for (auto&& p : v) print(p);}
template <typename T> inline void print(const vector<T>& v, string s = " ") {rep(i, v.size()) cout << v[i] << (i != (ll)v.size() - 1 ? s : "\n");}
template<typename T>
istream& operator >> (istream& is, vector<T>& vec){
  for(T& x: vec) is >> x;
  //for(int i=0; i<vec.size(); i++) is >> x[i]; とかでもいいです。
  return is;
}
template<typename T>
ostream& operator << (ostream& os, vector<T>& vec){
  for(int i=0; i<vec.size(); i++){
    os << vec[i] << ( i+1 == vec.size() ? "" : " " );
  }
  return os;
}
/* }}} */

signed main() 
{
  int n,k;
  cin >> n >> k;
  int x[n];
  int sum=0;
  rep(i,n)
  {
    cin >> x[i];
    x[i]<=k-x[i]?sum+=x[i]:sum+=k-x[i];
  }
  print(2*sum);

  return 0;
}

Measured memory_bytes: 384
import sys

stdin = sys.stdin

ns = lambda: stdin.readline().rstrip()
ni = lambda: int(stdin.readline().rstrip())
nm = lambda: map(int, stdin.readline().split())
nl = lambda: list(map(int, stdin.readline().split()))

mod = 10**9 + 7

n, k = nm()
rl = [-1]*(k+1)
dp = [0]*(k+1)
ans = 0
for i in range(k, 0, -1):
    t = k//i
    if rl[t] < 0:
        rl[t] = pow(t, n, mod)
    r = rl[t]
    for j in range(2*i, k+1, i):
        r = (r - dp[j]) % mod
    dp[i] = r
    ans = (ans + r*i) % mod
print(ans)


Measured memory_bytes: 11984
#include "bits/stdc++.h"
using namespace std;
#define int long long
#define FOR(i, a, b) for(int i=(a);i<(b);i++)
#define RFOR(i, a, b) for(int i=(b-1);i>=(a);i--)
#define REP(i, n) for(int i=0; i<(n); i++)
#define RREP(i, n) for(int i=(n-1); i>=0; i--)
#define REP1(i, n) for(int i=1; i<=(n); i++)
#define RREP1(i, n) for(int i=(n); i>=1; i--)
#define ALL(a) (a).begin(),(a).end()
#define UNIQUE_SORT(l) sort(ALL(l)); l.erase(unique(ALL(l)), l.end());
#define CONTAIN(a, b) find(ALL(a), (b)) != (a).end()
#define out(...) printf(__VA_ARGS__)
#if DEBUG
#define debug(...) printf(__VA_ARGS__)
#else
#define debug(...) /* ... */
#endif
template<class T>bool chmax(T &a,const T &b){if(a<b){a=b;return true;}return false;}
template<class T>bool chmin(T &a,const T &b){if(b<a){a=b;return true;}return false;}

int TT;
void solve(int t);
void answer() {
    cin>>TT;
    REP1(t,TT) solve(t);
}
signed main()
{
#if DEBUG
    std::ifstream in("input.txt");
    std::cin.rdbuf(in.rdbuf());
#endif
    cin.tie(0);
    ios::sync_with_stdio(false);
    answer();
    return 0;
}

/*================================*/
#if DEBUG
#define SIZE 100
#else
#define SIZE 223450
#endif

int N,Q,K;
int A[SIZE];

struct Item{
    int k,l,r;
    bool operator < (const Item& that) const {
        return abs(l-r) > abs(that.l-that.r);
    }
};


void solve(int _t) {
    cin>>N;
    int K,L,R;
    vector<Item> items;
    priority_queue<Item> que;
    set<int> s;
    // 左の方が大きい人
    vector<vector<int>> lefts(N), rights(N);
    int ans = 0;
    REP(i,N) {
        cin>>K>>L>>R;
        --K;
        items.push_back({K,L,R});
        if ((K==N-1) || (L==R)) {
            ans += L;
        }
        else if (L>R) {
            lefts[K].push_back(i);
        }
        else if (R>L) {
            rights[K].push_back(i);
        }
    }
    REP(i,N) {
        for (int j:lefts[i]) que.push(items[j]);
        while (que.size() > i+1) {
            auto [k,l,r] = que.top();
            que.pop();
            ans += r;
        }
    }
    while(que.size()) {
        auto [k,l,r] = que.top();
        que.pop();
        ans += l;
    }
    REP(i,N-1) {
        for (int j:rights[N-2-i]) que.push(items[j]);
        while (que.size() > i+1) {
            auto [k,l,r] = que.top();
            que.pop();
            ans += l;
        }
    }
    while(que.size()) {
        auto [k,l,r] = que.top();
        que.pop();
        ans += r;
    }
    out("%lld\n", ans);
}




Measured memory_bytes: 27312
#include<stdio.h>

int main(void){
  int N;
  scanf("%d", &N);
  double P; //aが奇数である確率
  if(N%2 == 1){
    P = ((double)(N+1)/2.0)/(double)N;
  }else{
    P = ((double)N/2.0)/(double)N;
  }
  printf("%.11lf",P); 
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
#define ALL(a) (a).begin(),(a).end()
#define rALL(a) (a).rbegin(),(a).rend()
typedef pair<int, int> Pint;
typedef pair<int64_t, int64_t> Pll;



const int MAX = 1000000;
const int MOD = 1000000007;

long long fac[MAX], finv[MAX], inv[MAX];

// テーブルを作る前処理
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

// 二項係数計算
long long COM(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}
int main() {
    int64_t X, Y, ans = 1, T;
    cin >> X >> Y;
    if ((X + Y) % 3 != 0) {
        cout << 0 << endl;
        return 0;
    }
    else {
        int64_t A = X, B = Y;
        X -= (A + B) / 3;
        Y -= (A + B) / 3;
    }
    T = X + Y;
    COMinit();
    cout << COM(T, X) << endl;


}


Measured memory_bytes: 23680
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.lang.reflect.Array;
import java.util.*;


public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n=scanner.nextInt();
        Deque<Integer> result=new LinkedList<>();
        for(int i=0;i<n;i++){
            if(i%2==0){
                result.offerLast(scanner.nextInt());
            }else{
                result.offerFirst(scanner.nextInt());
            }
        }
        Iterator<Integer> itr=(n%2==0)?result.iterator():result.descendingIterator();
        System.out.print(itr.next());
        while(itr.hasNext()){
            System.out.print(format(" %d",itr.next()));
        }
        put("");


    }

    public static void put(Object object) {
        System.out.println(object);
    }
    public static String format(String string, Object... args) {
        return String.format(string, args);
    }
}


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

int main() {
  int N, a;
  cin >> N;
  a = N / 100000000 + N / 10000000 % 10 + N / 1000000 % 10 + N / 100000 % 10 
    + N / 10000 % 10 + N / 1000 % 10 + N / 100 % 10 + N / 10 % 10 + N % 10;
  
  if (N % a == 0) {
   cout << "Yes";
  }
 
  else {
    cout << "No";
  }
}

Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
//#define mod 1000000007
#define dom 998244353
#define all(c) begin(c),end(c)
#define rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
template <typename T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return true; } return false; }
template <typename T> bool chmin(T &a, const T &b) { if (b < a) { a = b; return true; } return false; }
//#define long long long
#define List vector
#define var auto
#define Count size()
#define Length size()
int dd[] = { 0, 1, 0, -1, 0 }; //→↓←↑

struct RollingHash {
	const int base = 9973;
	const vector<int> mod = { 999999937LL, 1000000007LL };
	string S;
	vector<long long> hash[2], power[2];

	// construct
	RollingHash() {}
	RollingHash(const string &cs) { init(cs); }
	void init(const string &cs) {
		S = cs;
		int n = (int)S.size();
		for (int iter = 0; iter < 2; ++iter) {
			hash[iter].assign(n + 1, 0);
			power[iter].assign(n + 1, 1);
			for (int i = 0; i < n; ++i) {
				hash[iter][i + 1] = (hash[iter][i] * base + S[i]) % mod[iter];
				power[iter][i + 1] = power[iter][i] * base % mod[iter];
			}
		}
	}
	// get hash of S[left:right]
	inline long long get(int l, int r, int id = 0) const {
		long long res = hash[id][r] - hash[id][l] * power[id][r - l] % mod[id];
		if (res < 0) res += mod[id];
		return res;
	}
	// get lcp of S[a:] and S[b:]
	inline int getLCP(int a, int b) const {
		int len = min((int)S.size() - a, (int)S.size() - b);
		int low = -1, high = len + 1;
		while (high - low > 1) {
			int mid = (low + high) / 2;
			if (get(a, a + mid, 0) != get(b, b + mid, 0)) high = mid;
			else if (get(a, a + mid, 1) != get(b, b + mid, 1)) high = mid;
			else low = mid;
		}
		return low;
	}
	// get lcp of S[a:] and T[b:]
	inline int getLCP(const RollingHash &t, int a, int b) const {
		int len = min((int)S.size() - a, (int)S.size() - b);
		int low = -1, high = len + 1;
		while (high - low > 1) {
			int mid = (low + high) / 2;
			if (get(a, a + mid, 0) != t.get(b, b + mid, 0)) high = mid;
			else if (get(a, a + mid, 1) != t.get(b, b + mid, 1)) high = mid;
			else low = mid;
		}
		return low;
	}
};

void solve()
{
	string S, T;
	cin >> S >> T;
	int N = S.Length;
	int M = T.Length;
	while (S.Length < N + M) S += S;
	RollingHash B, A;
	B.init(T);
	A.init(S);
	var hash = B.get(0, M);

	long ans = 0;
	vector<bool> used(N);

	for (int i = 0; i < N; i++)
	{
		if (used[i])
		{
			continue;
		}
		used[i] = true;
		int next = i;
		long cnt = 0;
		vector<bool> H(N);
		

		while (A.get(next, next + M) == hash)
		{

			cnt++;
			if (H[(next)])
			{
				cout << (-1) << endl;
				return;
			}
			H[next] = true;
			next = (next + M) % N;
			used[next] = true;
		}
		chmax(ans, cnt);
	}
	cout << ans << endl;
}

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


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

# Tenka1 Programmer Beginner Contest
# Problem B

if __name__ == '__main__':
    n = int(input())
    worst_rank, worst_score = 0, 0

    # See:
    # https://beta.atcoder.jp/contests/tenka1-2017-beginner/submissions/1637273
    # https://beta.atcoder.jp/contests/tenka1-2017-beginner/submissions/1655004
    for i in range(n):
        ai, bi = list(map(int, input().split()))

        if ai > worst_rank:
            worst_rank = ai
            worst_score = bi

    print(worst_rank + worst_score)


Measured memory_bytes: 3060
//agc029_a.cpp
//Sat Dec 15 21:24:13 2018

#include <iostream>
#include <string>
#include <queue>
#include <unordered_map>
#include <vector>
#include <algorithm>
#include <math.h>
#define INTINF 2147483647
#define LLINF 9223372036854775807
using namespace std;
using ll=long long;
typedef pair<int,int> P;

int main(){
	string s;
	cin >> s;

	ll bnum = 0;
	ll ans = 0;
	for (int i=s.length()-1;i>=0;i--){
		if (s[i] == 'B'){
			if (s.length()-1-i-bnum>0){
				ans = ans + s.length()-1-i-bnum;
			}
			bnum++;
		}
	}

	cout << ans << endl;
//	printf("%.4f\n",ans);
}

Measured memory_bytes: 640
#include<iostream>
#include<stdlib.h>
#include<algorithm>
#include<vector>
#include<string>

using namespace std;

int main(int argc,char** argv){
  int N;
  cin >> N;
  int a = N / 7;
  bool flag = false;
  for(int i = 0; i < a + 1; i++){
    int tmp = N - 7 * i;
    if(tmp % 4 == 0){
      flag = true;
      break;
    }
  }
  if(flag){
    cout << "Yes" << endl;
  }else{
    cout << "No" << endl;
  }
  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>;
#define ll long long
#define all(x) (x).begin(),(x).end()
#define rep(i, n) for(ll i = 0; i < n; i++)
const ll INF = 1LL << 60;

int main(){
    int N; cin >> N;
    priority_queue<double, vector<double>, greater<double>> pq;
    rep(i, N){
        double v; cin >> v;
        pq.push(v);
    }
    rep(i, N - 1){
        double a, b;
        a = pq.top(); pq.pop();
        b = pq.top(); pq.pop();
        pq.push((a + b) / 2.0);
    }
    cout << pq.top() << endl;
} 

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

using namespace std;
using ll=long long;
using ull=unsigned long long;
using pii=pair<int,int>;

#define INF LONG_MAX
#define MOD 1000000007
#define rng(a) a.begin(),a.end()
#define rrng(a) a.end(),a.begin()

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

  int N;
  cin>>N;
  vector<ll>sum(N+1);
  sum[0]=0;
  for(int i=0;i<N;i++)sum[i+1]+=sum[i]+i+1;
  vector<int>ans;
  for(int i=1;i<=N;i++){
    if(sum[i]>=N){
      int memo=sum[i]-N;
      for(int j=1;j<=i;j++){
        if(j==memo)continue;
        cout<<j<<endl;
      }
      return 0;
    }
  }
  return 0;
}


Measured memory_bytes: 78464
g1 = [1,3,5,7,8,10,12]
g2 = [4,6,9,11]
g3 = [2]

x, y = map(int, input().split())
if x in g1 and y in g1 or x in g2 and y in g2 or x == y == 2:
    print("Yes")
else:
    print("No")    


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

#include<boost/multi_array.hpp>
#include<boost/optional.hpp>
#include<boost/range/irange.hpp>
#include<boost/range/algorithm.hpp>
#include<boost/range/adaptors.hpp>
namespace adaptor = boost::adaptors;

// 多倍長テンプレ
/* ---------------------- ここから ---------------------- */
#include <boost/multiprecision/cpp_dec_float.hpp>
#include <boost/multiprecision/cpp_int.hpp>
namespace mp = boost::multiprecision;
// 任意長整数型
using Bint = mp::cpp_int;
// 仮数部が1024ビットの浮動小数点数型(TLEしたら小さくする)
using Real = mp::number<mp::cpp_dec_float<1024>>;
/* ---------------------- ここまで ---------------------- */

using ll = long long;
using ull = unsigned long long;

// a^n mod を計算する
ll modpow(ll a, ll n, ll mod)
{
    ll res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}

ll mod_neg(ll val, ll m)
{
    ll res = val % m;
    if (res < 0) res += m;
    return res;
}

void Main()
{
	ll N = 0;
	cin >> N;

    ll mod = 1000000007;
    ll ans = modpow(10, N, mod) - modpow(9, N, mod) * 2 + modpow(8, N, mod);
    ans = mod_neg(ans, mod);
    cout << ans;

    return;
}

int main()
{
	std::cin.tie(nullptr);
	std::ios_base::sync_with_stdio(false);
	std::cout << std::fixed << std::setprecision(15);
	Main();
}

Measured memory_bytes: 3620
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <vector>
#include <iostream>
#include <map>
#include <set>
#include <algorithm>
#include <queue>
#include <sstream>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
#define SZ(x) (int)(x.size())
#define F0(i,n) for(int i=0;i<n;i++)
#define F1(i,n) for(int i=1;i<=n;i++)
#define CL(a,x) memset(x, a, sizeof(x));
#define P(x) cerr << #x << "=" << x << endl

const int MOD = 998244353;
const double pi = atan(1.0)*4.0;
const double eps = 1e-8;
ll gcd(ll x, ll y) { return y ? gcd(y, x%y) : x; }
int bc(int n) { return n ? bc((n-1)&n)+1 : 0; }

int i, j, k, m, n, l, D1, D2;
string s;
int a[200001];

void solve() {
    map<int, int> M;
    F0(i, n) {
        scanf("%d", &a[i]);
        M[a[i]]++;
    }
    sort(a, a + n);
    int ret = 0;
    int pw = 1 << 30;
    for (int i = n - 1; i >= 0; i--) if (M[a[i]]) {
        M[a[i]]--;
        P(a[i]);
        while (pw >= 2 && 2 * a[i] < pw) pw >>= 1;
        if (M.count(pw - a[i]) && M[pw - a[i]]) {
            ret++;
            M[pw - a[i]]--;
        }
    }
    cout << ret << endl;
}

int main() {
    //freopen("x.in", "r", stdin);
    while (cin >> n) {
        solve();
    }
    return 0;
}


Measured memory_bytes: 10368
#include <iostream>
#include <algorithm>
#include <vector>
#include <math.h>
using namespace std;
typedef long long ll;

int main(void){
    int a[5];
    cin >> a[0]>>a[1]>>a[2]>>a[3]>>a[4];
    
    int mn = 10, ans = 0;
    for (int i = 0; i < 5; i++) {
        if (a[i] % 10 != 0) {
            mn = min(mn, a[i] % 10);
            ans += (a[i] / 10 + 1) * 10;
        }
        else ans += a[i];
    }
    
    if (mn == 10) cout << ans << endl;
    else cout << ans - (10 - mn) << endl;
    
}


Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <stdbool.h>
#include <limits.h>

#define lli long long int
#define min(a,b) ((a)<(b)?(a):(b))
#define max(a,b) ((a)>(b)?(a):(b))
#define	abs(a) ((a)<0?-(a):(a))



int main(void){
	/* === input paramater === */
	int n,x;

	/* === paramater === */
	int i;
	int counter;
	/* === input === */
	scanf("%d%d",&n,&x);
	if(x == 1 || x == 2*n-1){
		printf("No\n");
		return 0;
	}
	printf("Yes\n");
	if(n==2){
		printf("%d\n%d\n%d\n",1,2,3);
		return 0;
	}
	counter = 1;
	if(x==2){
		for(i=0;i<n-2;i++){
			if(counter == x-1){
				counter += 4;
			}
			printf("%d\n", counter);
			counter++;
			if(counter == x-1){
				counter += 4;
			}
		}
		printf("%d\n%d\n%d\n%d\n",x+1,x,x-1,x+2);
		for(i=0;i<n-3;i++){
			if(counter == x-1){
				counter+=4;
			}
			printf("%d\n", counter);
			counter++;
			if(counter == x-1){
				counter+=4;
			}
		}
		return 0;
	}
	for(i=0;i<n-3;i++){
		if(counter == x-2){
			counter += 4;
		}
		printf("%d\n", counter);
		counter++;
		if(counter == x-2){
			counter += 4;
		}
	}
	printf("%d\n%d\n%d\n%d\n",x-2,x+1,x,x-1);
	for(i=0;i<n-2;i++){
		if(counter == x-2){
			counter += 4;
		}
		printf("%d\n", counter);
		counter++;
		if(counter == x-2){
			counter+=4;
		}
	}
	return 0;
}

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

using namespace std;
using namespace __gnu_pbds;
typedef long long ll;

struct int_hash {
    static uint64_t splitmix64(uint64_t x) {
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
    }

    size_t operator()(uint64_t x) const {
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64(x + FIXED_RANDOM);
    }
};

struct pair_hash {
    size_t operator()(pair<int, int> x) const {
        return int_hash{}(x.first) ^ (int_hash{}(x.second) << 16);
    }
};

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

const int MOD = 1000000007;
const ll INF = numeric_limits<ll>::max();
const int inf = 1e7;
const int MX = 100001; //check the limits, dummy

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

    ll h; cin >> h;
    ll ans = 0, count = 1;
    while(h) {
        ans += count;
        count *= 2;
        h /= 2;
    }

    cout << ans << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#pragma GCC optimize("O3")

#define fi first
#define se second
#define vi vector<int>
#define vpi vector<pair<int,int>>
#define vll vector<ll>
#define vpll vector<pair<ll,ll>>
#define endl '\n'

#define si(v) int((v).size())
#define all(v) (v).begin(), (v).end()
#define rep(i, n) for (ll i = 0; i < (ll)(n); ++i) 
#define rep2(i, n, m) for (ll i = n; i <= (ll)(m); ++i)
#define rep3(i, n, m) for (ll i = n; i >= (ll)(m); --i)

template<class T, class U> void chmax(T &a, U b) { if (a < b) a = b; }
template<class T, class U> void chmin(T &a, U b) { if (a > b) a = b; }

using ll = long long;
using ld = long double;
using namespace std;

constexpr ll MOD = 1000000007;

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

  int H, W, h, w; cin >> H >> W >> h >> w;

  cout << (H - h) * (W - w) << endl;

  return (0);
}


Measured memory_bytes: 3664
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define REP(i, n) for(int i=0;i<(int)(n);i++)
#define FOR(i, a, b) for(int i=(a);i<(b);i++)
const int inf=1e9+1;
template <class T>
void print(T x){cout << x << '\n';}



void solve(std::string S){
    S[3]='8';
    print(S);
}

int main(){
  std::string S;
  std::cin >> S;
  solve(S);
  return 0;
}


Measured memory_bytes: 256
def g(a)
  a.each_with_index{|hh, h|
    if w = hh.index("S")
      return [h, w]
    end
  }
end

def f(a, k)
  start = g(a)
  return 0 if start[0] == 0 || start[0] == H-1 || start[1] == 0 || start[1] == W-1

  visited = H.times.map{ [false]*W }

  queue = [start]
  visited[start[0]][start[1]] = true
  dirs = [[1,0], [-1,0], [0,1], [0,-1]]

  while !queue.empty?
    curr = queue.shift
    dirs.each{|d|
      h = curr[0] + d[0]
      next if !h.between?(0, H-1)
      w = curr[1] + d[1]
      next if !w.between?(0, W-1)
      next if visited[h][w]
      next if a[h][w] == "#"
      next if (h-start[0]).abs + (w-start[1]).abs > k
      queue << [h,w]
      visited[h][w] = true
    }
  end

  hs, ws = [], []
  visited.each_with_index{|hh, h|
    hh.each_with_index{|ww, w|
      if visited[h][w]
        hs << h
        ws << w
      end
    }
  }
  h_min, h_max = hs.minmax
  w_min, w_max = ws.minmax

  1 + [h_min.fdiv(k).ceil, (H-h_max-1).fdiv(k).ceil,
   w_min.fdiv(k).ceil, (W-w_max-1).fdiv(k).ceil,].min
end

H, W, K = gets.split.take(3).map(&:to_i)
A = H.times.map{ gets.chars.take(W) }
p f(A, K)


Measured memory_bytes: 62348
#include<bits/stdc++.h>
#define ll long long int
#define pb push_back
#define forn(i,a,n) for (ll i = a; i < (ll)(n); i++)
#define all(a) a.begin(),a.end()
#define fon(i,n) for (ll i = (ll)n-1; i >=0; i--)
#define vi          vector<ll>
#define vii vector<pair<ll,ll>>
#define pb push_back
#define mp make_pair
#define se second
#define fi first
#define ciin(v) forn(i,0,v.size()) cin>>v[i]
#define coutt(v) forn(i,0,v.size()) cout<<v[i]<<" "
using namespace std;
int main(){
    ios_base::sync_with_stdio(false); cin.tie(NULL);
    int t=1;
    // cin>>t;
    while(t--){ 
       ll n,m;
       cin>>n>>m;
       char v[n][m];
       ll dp[n+1][m+1];
       forn(i,0,n){
        forn(j,0,m){
            cin>>v[i][j];
        }
       }
       memset(dp,0,sizeof(dp));
       forn(i,0,n){
        forn(j,0,m){
            if(i==0 and j==0) dp[i][j]=1;
            else if(i==0){ if(v[i][j]=='.') dp[i][j]=dp[i][j-1]%1000000007;}
            else if(j==0) {if(v[i][j]=='.') dp[i][j]=dp[i-1][j]%1000000007;}
            else{
               if(v[i-1][j]=='.') dp[i][j]=dp[i-1][j]%1000000007;
               if(v[i][j-1]=='.') dp[i][j]+=dp[i][j-1]%1000000007;
            }
        }
       }
       //       
       // 
       cout<<dp[n-1][m-1]%1000000007;



}    
}


Measured memory_bytes: 12408
#2*2以上では隅:4回､辺:6回､内部:9回
#(n-2)*(m-2)

#1*mでは2333333...332となってるので(m-2)*1
#1*1では1なので1
n,m=map(int,input().split())
if n==1:
  if m==1:
    ans=1
  else:
    ans=1*(m-2)
else:
  if m==1:
    ans=(n-2)*1
  else:
    ans=(n-2)*(m-2)
    
print(ans)
    

Measured memory_bytes: 2940
#include <bits/stdc++.h>
#define rep(i,n) for(ll i=0;i<(n);++i)
#define all(a) (a).begin(),(a).end()
using namespace std;
using Graph = vector<vector<int>>;
typedef pair<int,int> P;
typedef long long ll;

int main(){
    ll n, m; cin >> n >> m;
    vector<P> p(m); rep(i,m) cin >> p[i].second >> p[i].first;

    ll ans = 0;
    sort(all(p));

    ll frontier = 0;

    rep(i,m){
        if(p[i].first > frontier){
            if(p[i].second >= frontier){
                frontier = p[i].first;
                ans++;
            }
        }
    }

    cout << ans << endl;
}


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

public class Main {

    static final int M = 1046527;  // オープンアドレス法ではmが素数でないと生成できないハッシュが存在してしまう
    static String[] hashTable = new String[M];

    public static void main(String[] args) {
        MyScanner sc = new MyScanner();
        PrintWriter pw = new PrintWriter(System.out);

        int n = sc.nextInt();
        for (int i = 0; i < n; i++) {
            String order = sc.next();
            String str = sc.next();

            if (order.equals("insert")) {
                insert(str);
            } else if (order.equals("find")) {
                if (find(str)) {
                    pw.println("yes");
                } else {
                    pw.println("no");
                }
            }
        }

        pw.flush();
    }

    // 文字から数値に変換
    static int getChar(char ch) {
        if (ch == 'A') return 1;
        else if (ch == 'C') return 2;
        else if (ch == 'G') return 3;
        else if (ch == 'T') return 4;
        else return 0;
    }

    // 文字列から数値へ変換してkeyを生成する
    static int getKey(char[] str) {
        int sum = 0, p = 1;
        for (int i = 0; i < str.length; i++) {
            sum += p * getChar(str[i]);
            p *= 5;
        }
        return sum;
    }

    static int h1(int key) { return key % M; }
    static int h2(int key) { return 1 + (key % (M - 1)); }

    static boolean find(String str) {
        int key = getKey(str.toCharArray());  // 文字列を数値に変換
        for (int i = 0; ; i++) {
            int h = (h1(key) + i * h2(key)) % M;
            if (hashTable[h] == null || hashTable[h].length() <= 0) {
                return false;
            } else if (hashTable[h].equals(str)) {
                return true;
            }
        }
    }

    static void insert(String str) {
        int key = getKey(str.toCharArray());  // 文字列を数値に変換
        for (int i = 0; ; i++) {
            int h = (h1(key) + i * h2(key)) % M;
            if (hashTable[h] == null || hashTable[h].length() <= 0) {
                hashTable[h] = str;
                return;
            } else if (hashTable[h].equals(str)) {
                return;
            }
        }
    }

    static class MyScanner {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in), 1 << 15);
        StringTokenizer tokenizer;

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

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

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


Measured memory_bytes: 126988
import sys
input=sys.stdin.readline
import string
import bisect

def main():

    S = input().strip()
    T = input().strip()

    dS = {c:[] for c in string.ascii_lowercase}
    for i, s in enumerate(S):
        dS[s].append(i)
    
    ans = 0
    pos = 0
    ls = len(S)
    for c in T:
        if not dS[c]:
            print(-1)
            return
        if dS[c][-1] < pos:
            pos = 0
            ans += ls
        bi = bisect.bisect_left(dS[c], pos)
        pos = dS[c][bi] + 1

    print(ans + pos)

if __name__ == '__main__':
    main()


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


void solve(long long N, std::vector<long long> A){
    long long ans = 0;
    long long a = A[0];
    for(int i = 1; i < N; ++i){
        if(A[i] - a >= 0) a = A[i];
        else ans += abs(A[i] - a);
    }
    cout << ans << endl;
}

int main(){
    long long N;
    scanf("%lld",&N);
    std::vector<long long> A(N);
    for(int i = 0 ; i < N ; i++){
        scanf("%lld",&A[i]);
    }
    solve(N, std::move(A));
    return 0;
}


Measured memory_bytes: 4840
#include<bits/stdc++.h>
using namespace std;
int main(){
	int n,k;
	cin>>n>>k;
	vector<int> a(n);
	for(int i=0;i<n;i++) cin>>a[i];
	sort(a.begin(),a.end());
	reverse(a.begin(),a.end());
	int ans=0;
	for(int i=0;i<k;i++) ans+=a[i];
	cout<<ans;
	return 0;
}


Measured memory_bytes: 3636
from collections import deque
from sys import stdin
input = stdin.readline

class Unionfind():
    def __init__(self, n):
        self.n = n
        self.parent = [-1]*n
    
    def find(self, x):
        if self.parent[x] < 0:
            return x
        else:
            self.parent[x] = self.find(self.parent[x])
            return self.parent[x]
    
    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)
        
        if x == y:
            return
        if self.parent[x] < self.parent[y]:
            x,y = y,x
        
        self.parent[x] += self.parent[y]
        self.parent[y] = x
        

N,M = map(int, input().split())
A = [-1]*M; B = [-1]*M
for i in range(M):
    a,b = map(lambda x: int(x) - 1, input().split())
    A[i] = a; B[i] = b

ans = 0
for exclude_idx in range(M):
    uf = Unionfind(N)
    for i in range(M):
        if i == exclude_idx:
            continue
        uf.union(A[i],B[i])
    
    cnt = 0
    for parent in uf.parent:
        if parent < 0:
            cnt += 1
    if cnt >= 2:
        ans += 1

print(ans)

Measured memory_bytes: 9480
s = list(input())

phase = "R"

len_s = len(s)

l = [0] * len_s
r = [0] * len_s

#R
c = 0
for i in range(len(s)-1):
    if s[i] == "R":
        c += 1
        if s[i+1] == "L":
            r[i] = (c+1) // 2
            r[i+1] = c // 2
            c = 0

#L
d = 0
for i in reversed(range(1, len(s))):
    if s[i] == "L":
        d += 1
        if s[i-1] == "R":
            l[i] = (d+1) // 2
            l[i-1] = d // 2
            d = 0

a = ["0"] * len_s
for i in range(len_s):
    a[i] = str(l[i] + r[i])

print(" ".join(a))


Measured memory_bytes: 81276
#include<iostream>
#include <iomanip>
using namespace std;
int main()
{
  int a,b;

  cin >> a >> b;
  double error = 1;
  cout << (a/b) << " "<<(a%b)<<" "<< fixed << setprecision(9) << ((double)a/(double)b)<< endl;
  //cout << endl;
}



Measured memory_bytes: 3280
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace C
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = RInt();
            string s = RSt();
            int resA = s.Count(x => x == '#');
            int resB = s.Count(x => x == '.');
            int allChange = Math.Min(resA, resB);

            int[] sharpCnts = new int[s.Length];
            sharpCnts[0] = s[0] == '#' ? 1 : 0;
            for (int i = 1; i < s.Length; i++)
            {
                if (s[i] == '#')
                {
                    sharpCnts[i] = sharpCnts[i - 1] + 1;
                }
                else
                {
                    sharpCnts[i] = sharpCnts[i - 1];
                }
            }

            int res = int.MaxValue;
            for (int i = 0; i < s.Length - 1; i++)
            {
                if (s[i] == '.' && s[i + 1] == '#')
                {
                    res = Math.Min(res, sharpCnts[i] + ((s.Length - (i + 1)) - (sharpCnts[s.Length - 1] - sharpCnts[i + 1] + 1)));
                }
            }
            Console.WriteLine(Math.Min(res, allChange));
        }
        static string RSt() { return Console.ReadLine(); }
        static int RInt() { return int.Parse(Console.ReadLine().Trim()); }
        static long RLong() { return long.Parse(Console.ReadLine().Trim()); }
        static double RDouble() { return double.Parse(Console.ReadLine()); }
        static string[] RArSt(char sep = ' ') { return Console.ReadLine().Trim().Split(sep); }
        static int[] RArInt(char sep = ' ') { return Array.ConvertAll(Console.ReadLine().Trim().Split(sep), e => int.Parse(e)); }
        static long[] RArLong(char sep = ' ') { return Array.ConvertAll(Console.ReadLine().Trim().Split(sep), e => long.Parse(e)); }
        static double[] RArDouble(char sep = ' ') { return Array.ConvertAll(Console.ReadLine().Trim().Split(sep), e => double.Parse(e)); }
        static string WAr<T>(IEnumerable<T> array, string sep = " ") { return string.Join(sep, array.Select(x => x.ToString()).ToArray()); }
    }
}


Measured memory_bytes: 13216
#include<bits/stdc++.h>
using namespace std;
using ll =long long;
#define REP(i,m,n) for(int i=(int)(m);i<(int)(n);++i)
#define rep(i,n) REP(i,0,n)
#define SORT(i) sort((i).begin(),(i).end())
constexpr int INF = 2000000000;
constexpr int mod = 1000000007;

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

int main() {
	int N; cin >> N;
	int mn = INF, mx = 0;
	rep(i, N) {
		int a; cin >> a;
		mn = min(mn, a);
		mx = max(mx, a);
	}
	cout << mx - mn << "\n";

	return 0;
}

Measured memory_bytes: 256
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include<bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define pii pair<int,int>
#define pp pair<pair<ll, ll>,pair<ll, ll>>
#define pll pair<ll,ll>
#define pdd pair<double,double>
#define vii vector<int>
#define vll vector<ll>
#define mat vector<vector<ll>>
#define lb lower_bound
#define ub upper_bound
#define pb push_back
#define fi first
#define sc second
#define rep(i,n) for(ll i=0;i<n;i++)
#define rep2(i,a,b) for(ll i=a;i<b;i++)
#define repr(i,n) for(ll i=n-1;i>=0;i--)
#define all(x) x.begin(),x.end()
#define sz(x) (ll) (x).size()
#define pq priority_queue<ll>
#define pqg priority_queue<ll,vector<ll>,greater<ll>>
#define LB(v,x) (lower_bound(v.begin(),v.end(),x)-v.begin())
#define UB(v,x) (upper_bound(v.begin(),v.end(),x)-v.begin())
#define ERASE(v) sort(v.begin(),v.end());v.erase(unique(v.begin(),v.end()),v.end())
#define int ll
using namespace std;
const ll INF = (1 << 30 ) - 1;
const ll LLINF = (1LL << 60LL);
const ll MOD = 1000000007;
const ll mod = 998244353;
const ll MAX = 1100000;
const double pi = acos(-1);
const double eps = 1e-10;
ll dx[4] ={1,0,-1,0} , dy[4] ={0,1,0,-1};

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

struct Timer{
    chrono::system_clock::time_point start, end;
    Timer(){ start = chrono::system_clock::now(); }
    ~Timer(){
        end = chrono::system_clock::now();
        auto msec = chrono::duration_cast<chrono::milliseconds>(end - start).count();
        cerr<<"time : "<<msec<<" ms"<<endl;
    }
};


void solve(){
    ll a[4];
    rep(i,3) cin>>a[i];
    sort(a,a+3);
    ll k;cin>>k;
    rep(i,k) a[2]*=2;
    cout<<a[0]+a[1]+a[2]<<endl;
}



signed main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    // Timer TM;
    
    solve();

    return 0;
}


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

int main(){
  ll t1,t2,a1,a2,b1,b2; cin>>t1>>t2>>a1>>a2>>b1>>b2;
  ll x1=t1*a1,x2=t2*a2,y1=t1*b1,y2=t2*b2;
  if(x1+x2==y1+y2){
    cout<<"infinity"<<endl;
    return 0;
  }
  if((x1+x2)>(y1+y2) && a1>b1){
    cout<<0<<endl;
    return 0;
  }else if((x1+x2)<(y1+y2) && a1<b1){
    cout<<0<<endl;
    return 0;
  }else{
    if(a1>b1){ //aのほうが常に長い距離にする
      swap(a1,b1); swap(a2,b2);
      swap(x1,y1); swap(x2,y2);
    }
    ll d=y1-x1,diff=(x1+x2)-(y1+y2);
    ll ans=1,i=1;
    ans+=(d/diff)*2;
    if(d%diff==0) ans--;
    cout<<ans<<endl;
    return 0;
  }
}

Measured memory_bytes: 256
// 22
/****************************************************
https://searleser97.gitlab.io/algorithms/template.cpp
****************************************************/

#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define fors(_, x, n, s) for (int _ = x; _ < n; _ += s)
#define forn(_, x, n) fors(_, x, n, 1)
#define rep(_, n) forn(_, 0, n)
#define forrs(_, x, n, s) for (int _ = x; _ > n; _ -= s)
#define forrn(_, x, n) forrs(_, x, n, 1)
#define rrep(_, n) forrn(_, n - 1, -1)
#define fi first
#define se second
#define pb push_back
#define pairii pair<int, int>
#define all(x) x.begin(), x.end()
#ifdef LOCAL
#define cerr(s) cerr << "\033[48;5;196m\033[38;5;15m" s << "\033[0m"
#else
#define cerr(s)
#endif
// typedef __int128_t lli;
typedef long long int li;
typedef long double ld;
// 12

void _main(int tc) {
  string s, t;
  cin >> s >> t;

  /************* Recursive *************
  vector<vector<int>> mem(s.size() + 1, vector<int>(t.size() + 1, -1));

  function<int(int, int)> lcs = [&](int i, int j) -> int {
    if (i == s.size() or j == t.size()) return 0;
    if (mem[i][j] != -1) return mem[i][j];
    if (s[i] == t[j])
      return mem[i][j] = 1 + lcs(i + 1, j + 1);
    else
      return mem[i][j] = max(lcs(i + 1, j), lcs(i, j + 1));
  };

  int i = 0, j = 0;
  string ans;
  ans.reserve(lcs(0, 0));
  while (i < s.size() && j < t.size()) {
    if (s[i] == t[j])
      ans += s[i], i++, j++;
    else if (mem[i + 1][j] > mem[i][j + 1])
      i++;
    else
      j++;
  }
  std::cout << ans << endl;
  *********** End Recursive ***********/

  vector<vector<int>> mem(s.size() + 1, vector<int>(t.size() + 1, 0));

  rrep(i, s.size()) {
    rrep(j, t.size()) {
      if (s[i] == t[j]) {
        mem[i][j] = 1 + mem[i + 1][j + 1];
      } else {
        mem[i][j] = max(mem[i + 1][j], mem[i][j + 1]);
      }
    }
  }

  mem[s.size()] = vector<int>(t.size(), -1);
  rep(i, s.size()) mem[i][t.size()] = -1;

  int i = 0, j = 0;
  string ans;
  ans.reserve(mem[0][0]);
  while (i < s.size() && j < t.size()) {
    if (s[i] == t[j])
      ans += s[i], i++, j++;
    else if (mem[i + 1][j] > mem[i][j + 1])
      i++;
    else
      j++;
  }
  std::cout << ans << endl;

#ifdef LOCAL
  cerr(<< setw(4) << " ");
  rep(i, t.size()) cerr(<< setw(4) << t[i]);
  cerr(<< endl);
  rep(i, s.size() + 1) {
    if (i < s.size())
      cerr(<< setw(4) << s[i]);
    else
      cerr(<< setw(4) << " ");
    rep(j, t.size() + 1) cerr(<< setw(4) << mem[i][j]);
    cerr(<< endl);
  }
#endif
}

int main() {
  ios_base::sync_with_stdio(0), cin.tie(0);
  _main(0), exit(0);
  int tc;
  cin >> tc;
  rep(i, tc) _main(i + 1);
}

Measured memory_bytes: 35584
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int d;
  cin >> d;
  switch (d) {
    case 25 :
      cout << "Christmas" << endl;
      break;
    case 24 :
      cout << "Christmas Eve" << endl;
      break;
    case 23 :
      cout << "Christmas Eve Eve" << endl;
      break;
    case 22 :
      cout << "Christmas Eve Eve Eve" << endl;
      break; 
  }
}

Measured memory_bytes: 256
d = []
while True:
    try:
        n,b = input().split(',')
        d.append(b)
    except EOFError:
        break

A,B,O,AB = [],[],[],[]
for i in range(len(d)):
    if d[i] == 'A':
        A.append(i)
    elif d[i] == 'B':
        B.append(i)
    elif d[i] == 'AB':
        AB.append(i)
    elif d[i] == 'O':
        O.append(i)
    else:
        print('error')
print(len(A))
print(len(B))
print(len(AB))
print(len(O))

Measured memory_bytes: 7364
#include <stdio.h>
#include <iostream>
#include <algorithm>
using namespace std;

int L[201];
int main(){
	int N, i, sum = 0;
	cin >> N;
	for(i = 0; i < 2 * N; i++){
		cin >> L[i];
	}
	sort(L, L + 2 * N);
	for(i = 0; i < N; i++){
		sum += L[2 * i];
	}
	cout << sum;
}

Measured memory_bytes: 256
using namespace std;
#include <iostream>
#include <vector>
#include <queue>
#define rep(i,n) for (int i=0; i<n;++i)
int N,K;
vector<int> kouho;
queue<int> que;

int bfs() {
  int k = que.front(); que.pop();
  while(k<N) {
    for(auto p: kouho) que.push(k*10+p);
    k = que.front(); que.pop();
  }
  return k;
}
bool D[10];
int main() {
  cin >> N >> K;
  int d;
  rep(i, K) {
    cin >> d;
    D[d] = true;
  }
  
  rep(i, 10) {
    if (!D[i]) {
      kouho.push_back(i);
      if (i>0) que.push(i);
    }
  }
  cout << bfs() << endl;
}


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


#define int  long long
#define rep(i,begin,end) for(__typeof(end)i=(begin)-((begin)>(end));i!=(end)-((begin)>(end));i+=1-2*((begin)>(end)))
#define F first
#define S second
#define sz(x) ((int)x.size())
#define pb push_back
#define pf push_front
#define eb emplace_back
#define all(v) (v).begin(), (v).end()
#define mod 1000000007
#define what_is(x) cerr << #x << " is " << x <<"\n";
#define sortA(v) sort(v.begin(), v.end())
#define sortD(v) sort(v.rbegin(), v.rend())
#define PI 3.14159265358979323846
#define vout(a) for(auto x:a) cout<<x<<" ";
#define INF 10000000000000000 //1e16

// #define ordered_set tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update>


// using namespace __gnu_pbds;
using namespace std;

using ll  = long long;
using vi  = vector<int>;
using pii = pair<int,int>;
using vii = vector<pii>;
using mi  = multiset<int>;
using mii = multiset<pii>;

int lcm(int a,int b) {return (a*(b/__gcd(a,b)));}

vi a(200005);

void solve()
{
    int t,n,m,i,k,r,l,u,v,w,j,s,sum=0,pos,flag=0,count=0;
    string S,T,U; 
    // int a,b;
    char c;
    cin>>c;
    if(c>90)
    {
        cout<<'a';
    }
    else cout<<"A";

}


signed main()
{
    #ifndef ONLINE_JUDGE 
       freopen("input.txt","r",stdin);
       freopen("output.txt","w",stdout);
    #endif
    ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
    int t=1;
    // cin>>t;
    while(t--)
    {
        solve();
        if(t)cout<<"\n";
    }
    return 0;
}


Measured memory_bytes: 4644